Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

lookparameters.h

00001 /* liblookdb: lookparameters.h - Handles command line parameters 
00002     Copyright (C) 1998-2001 LOOK Systems
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public
00015     License along with this library; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018 #ifndef LIBLOOKDB_LOOKPARAMETERS_H
00019 #define LIBLOOKDB_LOOKPARAMETERS_H
00020 
00021 // $Id: lookparameters.h,v 1.7 2001/07/06 17:14:19 clive Exp $
00022 
00023 #include "lookdbutils.h"
00024 #include "lkstring.h"
00025 #include "t_list.h"
00026 #include "lookstringlist.h"
00027 #include "lkinteger.h"
00028 #include <map>
00029 
00030 namespace look {
00031 
00032 #ifdef WIN32
00033 template class LOOKDBUTILITIES_DLL std::map<LookString, LookString>;
00034 template class LOOKDBUTILITIES_DLL std::map<LookString, LookInteger>;
00035 #endif
00036 
00037 typedef std::map<LookString, LookString> LookStringStringMap;
00038 typedef std::map<LookString, LookInteger> LookStringIntegerMap;
00039 
00041 
00068 class LOOKDBUTILITIES_DLL LookParameters
00069 {
00070 public:
00071 
00072         static LookString GetParameter( const LookString& theKey );
00073         static void SetParameter( const LookString& theKey, const LookString& theValue );
00074 
00075         static bool ParameterExists( const LookString& theKey );
00076 
00077         static void FindParametersNotInList( const LookStringList& theList,
00078                 LookStringList& theReturnList );
00079 
00080         static bool ParseApplicationParameters( int argc, char** argv );
00081         static bool ParseParameter( LookString theParameter );
00082         static bool ParseParameterFile( const LookString& theFilename );
00083 
00084         static long GetParameterAsLong( const LookString& theKey );
00085         static bool GetParameterAsBool( const LookString& theKey,
00086                 const LookString& theTrueValue = "TRUE",
00087                 bool forceUpper = true );
00088 
00089         static long GetParameterAsDecode( const LookString& theKey,
00090                 LookStringIntegerMap& theMap, long theDefault,
00091                 bool forceUpper );
00092 
00093         static void SetCaseSensitive( bool isCaseSensitive = true );
00094 
00095 protected:
00096 
00097         static LookStringStringMap itsParameters;
00098         static bool itIsCaseSensitive;
00099 };
00100 
00101 
00102 } // end of "look" namespace
00103 #endif 

Generated at Thu Jan 17 12:53:06 2002 for liblookdb by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001