INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
propfileutils.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCAICE_PROPERTY_FILE_UTILITIES_H 00012 #define ORCAICE_PROPERTY_FILE_UTILITIES_H 00013 00014 #include <string> 00015 #include <Ice/Properties.h> 00016 00017 namespace orcaice 00018 { 00019 namespace detail 00020 { 00021 00022 /* 00023 * Platform-independent function to find Orca global configuration file. 00024 * 00025 * 1. Tries to load the file specified in Orca.GlobalConfig configuration parameter. 00026 * 2. If it is not defined (or empty), tries to load the file specified by the 00027 * environment variable @c ORCAICE_GLOBAL_CONFIG 00028 * 3. If it is not defined (or empty), tries to load the defaultt file from a 00029 * system-dependent location: 00030 * > Linux: $HOME/.orcarc 00031 * > Win32: C:\orca.ini 00032 * Throws gbxutilacfr::Exception if none of the three options work out. 00033 */ 00034 std::string getGlobalConfigFilename( const Ice::PropertiesPtr &props ); 00035 00036 /* 00037 * Platform-independent function to find Orca component configuration file. 00038 * 00039 * 1. Returns the file name specified in Orca.Config configuration parameter. 00040 * $ mycomponent --Orca.Config=local.cfg 00041 * returns "local.cfg" 00042 * 2. Returns the file name specified in Ice.Config configuration parameter. 00043 * $ mycomponent --Ice.Config=local.cfg 00044 * returns "local.cfg" 00045 * 3. If Orca.Config is not defined (or empty), and there is only one command line argument 00046 * it is assumed to be the path to the config file. 00047 * ... unless it starts with a '-', i.e. looks like an option 00048 * $ mycomponent local.cfg 00049 * returns "local.cfg" 00050 * 4. File ./mycomponent.cfg when the component mycomponent is executed with 00051 * no command line arguments. 00052 * $ mycomponent 00053 * > mycomponent.exe 00054 * return "mycomponent.cfg" 00055 * 00056 * Returns an empty string if everything else fails. 00057 */ 00058 std::string getApplicationConfigFilename( const std::vector<std::string> & args ); 00059 00060 /* 00061 * Platform-independent function to find Orca component configuration file. 00062 * 00063 * 1. Returns the file name specified in Orca.Config configuration parameter. E.g. 00064 * IceBox.Service.MyService=MyService:create --Orca.Config=local.cfg 00065 * returns "local.cfg" 00066 * 00067 * 2. Returns the file name specified in Ice.Config configuration parameter. E.g. 00068 * IceBox.Service.MyService=MyService:create --Ice.Config=local.cfg 00069 * returns "local.cfg" 00070 * 00071 * Returns an empty string if the argument list is empty or 00072 * the argument contains no suitable properties. 00073 */ 00074 std::string getServiceConfigFilename( const std::vector<std::string> & args ); 00075 00076 } // namespace 00077 } // namespace 00078 00079 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)