00001 #ifndef APPLICATION_CONFIG_CLASS
00002 #define APPLICATION_CONFIG_CLASS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "dll_processes.h"
00019
00020 #include <basis/object_base.h>
00021
00022
00023 class ini_configurator;
00024 class istring;
00025 class mutex;
00026 class section_manager;
00027 class string_table;
00028
00030
00035 class PROCESSES_CLASS_STYLE application_config
00036 {
00037 public:
00038 application_config(const istring &config_file, const istring &basename);
00040
00044 virtual ~application_config();
00045
00046
00047
00048 IMPLEMENT_CLASS_NAME("application_config");
00049
00050 static const char *STARTUP_SECTION();
00052
00053 static const char *STARTUP_APP_NAME();
00055
00057 static bool find_entry(const string_table &table, const istring &name,
00058 istring &location);
00060
00063 static istring make_startup_entry(const istring &product,
00064 const istring &parms, bool one_shot);
00066
00067 static bool parse_startup_entry(const istring &info, istring &product,
00068 istring &parms, bool &one_shot);
00070
00074 bool product_exists(const istring &product);
00076
00077 istring find_program(const istring &product, const istring &app_name,
00078 int &level);
00080
00084
00085
00086 bool find_section(const istring §ion_name, string_table &info_found);
00088
00089 bool add_section(const istring §ion_name, const string_table &info);
00091
00093 bool replace_section(const istring §ion_name, const string_table &info);
00095
00097 bool add_program(const istring &product, const istring &app_name,
00098 const istring &full_path, int level);
00100
00104 bool remove_program(const istring &product, const istring &app_name);
00106
00107 bool add_startup_entry(const istring &product, const istring &app_name,
00108 const istring ¶meters, int one_shot);
00110
00113 bool remove_startup_entry(const istring &product, const istring &app_name);
00115
00116 private:
00117 mutex *_lock;
00118 ini_configurator *_config;
00119 section_manager *_sector;
00120 };
00121
00122 #endif
00123