application_config.h

Go to the documentation of this file.
00001 #ifndef APPLICATION_CONFIG_CLASS
00002 #define APPLICATION_CONFIG_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : application_config                                                *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2000 By Author.  This program is free software; you can       *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "dll_processes.h"
00019 
00020 #include <basis/object_base.h>
00021 
00022 // forward.
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   // this section has mainly informational functions.
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   // the following functions actually modify the configuration file.
00085 
00086   bool find_section(const istring &section_name, string_table &info_found);
00088 
00089   bool add_section(const istring &section_name, const string_table &info);
00091 
00093   bool replace_section(const istring &section_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 &parameters, 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 

Generated on Wed Nov 19 04:28:55 2008 for HOOPLE Libraries by  doxygen 1.5.1