2 #ifndef ACE_HTBP_ENVIRONMENT_H
3 #define ACE_HTBP_ENVIRONMENT_H
4 #include /**/ "ace/pre.h"
6 #include "HTBP_Export.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 #include "ace/Configuration.h"
13 #include "ace/Configuration_Import_Export.h"
14 #include "ace/Singleton.h"
16 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 * This class manages the storage of configuration data, either in a
28 * flat file for Unix systems, or in the Windows registry
30 class HTBP_Export Environment
34 Environment (ACE_Configuration
*config
= 0,
35 int using_registry
= 0,
36 const ACE_TCHAR
*persistent_file
= 0);
41 /// removes all htbp related values from the configuration
44 /// Accessors to HTID URL
45 /// Returns 0 on success
47 int get_htid_url (ACE_TString
&htid_url
) const;
48 int set_htid_url (const ACE_TCHAR
*htid_generator_url
);
51 /// Accessors to HTID via proxy - If value is true, HTID request goes
52 /// through configured proxy otherwise it uses a direct connection.
53 /// Returns 0 on success
55 int get_htid_via_proxy (int &htid_via_proxy
) const;
56 int set_htid_via_proxy (int htid_via_proxy
);
59 /// Accessors to Proxy Address
60 /// Returns 0 on success
62 int get_proxy_host (ACE_TString
&proxy_host
) const;
63 int set_proxy_host (const ACE_TCHAR
*proxy_host
);
66 /// Returns 0 on success
68 int get_proxy_port (unsigned int &proxy_port
) const;
69 int set_proxy_port (unsigned int proxy_port
);
72 /// Import the configuration from the filename
73 int import_config (const ACE_TCHAR
*filename
);
75 /// Export the configuration to the filename
76 int export_config (const ACE_TCHAR
*filename
);
79 /// Open config, set sections etc
80 int initialize (int use_registry
,
81 const ACE_TCHAR
*persistent_file
);
83 /// Open an ACE_Configuration of the appropriate type.
84 int open_registry_config ();
85 int open_persistent_config (const ACE_TCHAR
*persistent_file
);
87 /// Our Proxy and HTID generator URL database
88 ACE_Configuration
*config_
;
90 /// Flat section of HTBP related items
91 ACE_Configuration_Section_Key htbp_key_
;
93 /// the wrapper used to import or export initialization values
94 ACE_Ini_ImpExp
*imp_exp_
;
96 /// We created the config instance, so we must clean it up
102 ACE_END_VERSIONED_NAMESPACE_DECL
104 #include /**/ "ace/post.h"
105 #endif /* ACE_HTBP_ENVIRONMENT_H */