00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _SB_ENVIRONMENT_VARS_H
00036 #define _SB_ENVIRONMENT_VARS_H
00037
00038 #include <Inventor/SbBase.h>
00039 #include <Inventor/SbDict.h>
00040 #include <Inventor/SbColor.h>
00041 #include <Inventor/SbVec.h>
00042
00043 #include <Inventor/threads/SbThreadMutex.h>
00044
01907 class SoPreferences {
01908 public:
01909
01910
01938 SoNONUNICODE static const char* getValue (const char* name);
01939
01965 static const SbString* getStringValue( const SbString& name );
01966
01984 SoNONUNICODE static SbBool getBool( const char* name, SbBool defaultValue );
01985
01994 static SbBool getBool( const SbString& name, SbBool defaultValue );
01995
02007 SoNONUNICODE static int getInt( const char* name, int defaultValue );
02008
02018 static int getInt( const SbString& name, int defaultValue);
02019
02031 SoNONUNICODE static long getLong( const char* name, long defaultValue );
02032
02042 static long getLong( const SbString& name, long defaultValue );
02043
02055 SoNONUNICODE static float getFloat( const char* name, float defaultValue );
02056
02066 static float getFloat( const SbString& name, float defaultValue );
02067
02079 SoNONUNICODE static double getDouble( const char* name, double defaultValue );
02080
02090 static double getDouble( const SbString& name, double defaultValue );
02091
02104 SoNONUNICODE static const SbString& getString (const char* name, const SbString& defaultValue);
02105
02116 static const SbString& getString( const SbString& name, const SbString& defaultValue );
02117
02132 SoNONUNICODE static const SbVec3f& getVec3f( const char* name, const SbVec3f& defaultValue );
02133
02146 static const SbVec3f& getVec3f( const SbString& name, const SbVec3f& defaultValue );
02147
02162 SoNONUNICODE static const SbVec2s& getVec2s( const char* name, const SbVec2s& defaultValue );
02163
02176 static const SbVec2s& getVec2s( const SbString& name, const SbVec2s& defaultValue );
02177
02192 SoNONUNICODE static const SbColor& getColor( const char* name, const SbColor& defaultValue );
02193
02206 static const SbColor& getColor( const SbString& name, const SbColor& defaultValue );
02207
02208
02209
02210
02224 SoNONUNICODE static void setValue( const char* name, const char* value = NULL );
02225
02237 static void setValue( const SbString& name, const SbString* value = NULL );
02238
02245 SoNONUNICODE static void setBool( const char* name, SbBool value );
02246
02251 static void setBool( const SbString& name, SbBool value );
02252
02259 SoNONUNICODE static void setInt( const char* name, int value );
02260
02265 static void setInt( const SbString& name, int value );
02266
02273 SoNONUNICODE static void setLong( const char* name, long value );
02274
02279 static void setLong( const SbString& name, long value );
02280
02287 SoNONUNICODE static void setFloat( const char* name, float value );
02288
02293 static void setFloat( const SbString& name, float value );
02294
02301 SoNONUNICODE static void setDouble( const char* name, double value );
02302
02307 static void setDouble( const SbString& name, double value );
02308
02321 SoNONUNICODE static void setString (const char* name, const SbString& value);
02322
02332 static void setString( const SbString& name, const SbString& value );
02333
02340 SoNONUNICODE static void setVec3f( const char* name, const SbVec3f& value );
02341
02346 static void setVec3f( const SbString& name, const SbVec3f& value );
02347
02354 SoNONUNICODE static void setVec2s( const char* name, const SbVec2s& value );
02355
02360 static void setVec2s( const SbString& name, const SbVec2s& value );
02361
02368 SoNONUNICODE static void setColor( const char* name, const SbColor& value );
02369
02370
02375 static void setColor( const SbString& name, const SbColor& value );
02376
02384 SoNONUNICODE static void readFile (const char* filename);
02385
02391 static void readFile (const SbString& filename);
02392
02393 private:
02394 static SbDict* s_dictionary;
02395 static SbThreadMutex s_mutex;
02396 static void initialize ();
02397 static SbString s_unspecifiedValue;
02398 static bool s_verbose_env;
02399
02400 private:
02401 static void clean();
02402
02403 class SoPreferencesImpl;
02404 friend class SoPreferencesImpl;
02405
02406 };
02407 #endif // _SB_ENVIRONMENT_VARS_H
02408
02409