CppCMS
mount_point.h
1 //
3 // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
4 //
5 // See accompanying file COPYING.TXT file for licensing details.
6 //
8 #ifndef CPPCMS_MOUNT_POINT_H
9 #define CPPCMS_MOUNT_POINT_H
10 
11 #include <cppcms/defs.h>
12 #include <string>
13 #include <booster/perl_regex.h>
14 #include <booster/copy_ptr.h>
15 
16 namespace cppcms {
24  class CPPCMS_API mount_point {
25  public:
45  typedef enum {
47  match_script_name
49 
53  booster::regex host() const;
57  booster::regex script_name() const;
61  booster::regex path_info() const;
65  int group() const;
66 
70  selection_type selection() const;
71 
75  void host(booster::regex const &);
79  void script_name(booster::regex const &);
83  void path_info(booster::regex const &);
87  void group(int);
91  void selection(selection_type);
92 
98  std::pair<bool,std::string> match(std::string const &h,std::string const &s,std::string const &p) const;
104  std::pair<bool,std::string> match(char const *h,char const *s,char const *p) const;
105 
109  mount_point();
112  ~mount_point();
116  mount_point(mount_point const &);
120  mount_point const &operator=(mount_point const &);
121 
125  mount_point(std::string const &path,int group);
129  mount_point(std::string const &script);
134  mount_point(std::string const &script,std::string const &path,int group);
135 
143  mount_point( selection_type sel,
144  std::string const &selected_part,
145  int group);
146 
155  mount_point( selection_type sel,
156  std::string const &non_selected_part);
157 
168  mount_point( selection_type sel,
169  std::string const &non_selected_part,
170  std::string const &selected_part,
171  int group);
172 
179 
180  mount_point( selection_type sel,
181  booster::regex const &http_host,
182  booster::regex const &script,
183  booster::regex const &path,
184  int group);
185 
186  private:
187  booster::regex host_;
188  booster::regex script_name_;
189  booster::regex path_info_;
190  int group_;
191  selection_type selection_;
192  struct _data;
194  };
195 
196 } // cppcms
197 
198 #endif
199 
200 
This is a simple wrapper of PCRE library.
Definition: perl_regex.h:35
selection_type
Definition: mount_point.h:45
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
This class represents application&#39;s mount point or the rule on which specific application is selected...
Definition: mount_point.h:24
Pass PATH_INFO to applications.
Definition: mount_point.h:46