3 //=============================================================================
9 //=============================================================================
12 // = Forward declaration.
13 class HTTP_Config_Info
;
18 * @brief Stores server configuration information.
19 * Someday, this will be hip and cool and be able to parse
20 * NCSA httpd style config files like Apache does. For now,
21 * I'm just going to hack in environment variable stuff.
22 * Designed around Singleton pattern.
27 /// Access the Singleton.
28 static HTTP_Config_Info
*instance ();
31 /// Store the Singleton.
32 static HTTP_Config_Info
*instance_
;
36 * @class HTTP_Config_Info
38 * @brief This is where the information is really stored.
40 class HTTP_Config_Info
42 friend class HTTP_Config
;
47 // Accessors to the information
49 /// Where the root of the document tree begins. This prevents
50 /// clients from being able to examine your entire filesystem.
51 const char *document_root () const;
53 /// A search path for CGI files.
54 const char *cgi_path () const;
56 /// The directory which is appended to a home user directory, e.g.,
57 /// ".www-docs" or "public_html".
58 const char *user_dir () const;
60 /// What is the default index file for a directory, e.g.,
62 const char *dir_index () const;
64 /// Will the server support proxy requests?
65 int proxy_flag () const;
68 // = Accesors that can set the data
70 const char *document_root (const char *dr_string
);
71 const char *cgi_path (const char *cp_string
);
72 const char *user_dir (const char *ud_string
);
73 const char *dir_index (const char *di_string
);
75 int proxy_flag (int pf
);
80 /// The directory root from which documents will be fetched
81 const char *document_root_
;
83 /// The directories from which to expect CGI scripts
84 const char *cgi_path_
;
86 /// Name of the sub-directory where user Web pages are
87 const char *user_dir_
;
89 /// Name of the Web page to present in place of a directory listing
90 const char *dir_index_
;
92 /// Should we support proxy requests? Ignored for now.