/* * * ProLinga-Run * * Copyright (C) 2002-2008 Xobas Software. * All rights reserved. * * This file is part of ProLinga-Run. * * ProLinga-Run is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * ProLinga-Run is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ProLinga-Run. If not, see . * * More information is available at the following addresses: * * Website : http://www.prolinga.org * * Email : prolinga-list@prolinga.org * * */ #ifndef __RUN_CONFIG_HPP #define __RUN_CONFIG_HPP #define PRODUCT_NAME "Runner" /* Default configuration settings */ #define DEF_CONFIG_FILE SYSCONFDIR"/prolingaruncfg.xml" /* Config file name */ #define DEF_CLIENT_HOST "localhost" /* Client Host */ #define DEF_CLIENT_PORT 8005 /* Client Port */ #define DEF_CLIENT_COMP_LEVEL 6 /* Server compression */ #define DEF_SERVER_HOST "localhost" /* Server Host */ #define DEF_SERVER_PORT 8005 /* Server Port */ #define DEF_SERVER_COMP_LEVEL 6 /* Server compression */ #define DEF_NUMBER_THREADS 3 /* Number of Threads */ #define DEF_LOG_FILE "run.log" /* Log File */ #define DEF_LOG_LEVEL 5 /* Log Level */ #define DEF_REPOSITORY_HOST "localhost" /* Repository Host */ #define DEF_REPOSITORY_PORT 8001 /* Repository Port */ #define DEF_REPOSITORY_COMP_LEVEL 6 /* SOAP Compression Level */ #define DEF_VALIDATE_HOST "localhost" /* Validate Host */ #define DEF_VALIDATE_PORT 8003 /* Validate Port */ #define DEF_VALIDATE_COMP_LEVEL 6 /* SOAP Compression Level */ #define DEF_DATA_HOST "localhost" /* Data Host */ #define DEF_DATA_PORT 8007 /* Data Port */ #define DEF_DATA_COMP_LEVEL 6 /* SOAP Compression Level */ #define DEF_EXT_SCREEN_PAINTER "glade-2" /* External Screen Painter */ class ConfigRunSetting { friend class ConfigRun; public: ConfigRunSetting(); ~ConfigRunSetting(); private: char *getStringValue(ConfigRunSetting *confsetPtr, const char *name, const char *defValue); int getNumberValue(ConfigRunSetting *confsetPtr, const char *name, const int defValue); void putStringValue(ConfigRunSetting **confsetPtr, const char *name, const char *value); void putNumberValue(ConfigRunSetting **confsetPtr, const char *name, const int value); void deleteList(ConfigRunSetting **confsetPtr); void printList(ConfigRunSetting *confsetPtr) const; char confsetName[32]; char *confsetStringValue; int confsetNumberValue; ConfigRunSetting *nextPtr; }; typedef ConfigRunSetting *ConfigRunSettingPtr; class ConfigRun { public: ConfigRun(const char *configFileName); ~ConfigRun(); char *getStringValue(const char *name, const char *defValue); int getNumberValue(const char *name, const int defValue); void putStringValue(const char *name, const char *value); void putNumberValue(const char *name, const int value); void writeConfig(const char *logFileName) const; void printList(void) const; private: ConfigRunSetting *startPtr; }; typedef ConfigRun *ConfigRunPtr; #endif /* __RUN_CONFIG_HPP */