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
02546 class SoPreferences {
02547 public:
02548
02549
02577 SoNONUNICODE static const char* getValue (const char* name);
02578
02604 static const SbString* getStringValue( const SbString& name );
02605
02623 SoNONUNICODE static SbBool getBool( const char* name, SbBool defaultValue );
02624
02633 static SbBool getBool( const SbString& name, SbBool defaultValue );
02634
02646 SoNONUNICODE static int getInt( const char* name, int defaultValue );
02647
02657 static int getInt( const SbString& name, int defaultValue);
02658
02670 SoNONUNICODE static long getLong( const char* name, long defaultValue );
02671
02681 static long getLong( const SbString& name, long defaultValue );
02682
02694 SoNONUNICODE static float getFloat( const char* name, float defaultValue );
02695
02705 static float getFloat( const SbString& name, float defaultValue );
02706
02718 SoNONUNICODE static double getDouble( const char* name, double defaultValue );
02719
02729 static double getDouble( const SbString& name, double defaultValue );
02730
02743 SoNONUNICODE static const SbString& getString (const char* name, const SbString& defaultValue);
02744
02755 static const SbString& getString( const SbString& name, const SbString& defaultValue );
02756
02771 SoNONUNICODE static const SbVec3f& getVec3f( const char* name, const SbVec3f& defaultValue );
02772
02785 static const SbVec3f& getVec3f( const SbString& name, const SbVec3f& defaultValue );
02786
02801 SoNONUNICODE static const SbVec2s& getVec2s( const char* name, const SbVec2s& defaultValue );
02802
02815 static const SbVec2s& getVec2s( const SbString& name, const SbVec2s& defaultValue );
02816
02831 SoNONUNICODE static const SbColor& getColor( const char* name, const SbColor& defaultValue );
02832
02845 static const SbColor& getColor( const SbString& name, const SbColor& defaultValue );
02846
02847
02848
02849
02863 SoNONUNICODE static void setValue( const char* name, const char* value = NULL );
02864
02876 static void setValue( const SbString& name, const SbString* value = NULL );
02877
02884 SoNONUNICODE static void setBool( const char* name, SbBool value );
02885
02890 static void setBool( const SbString& name, SbBool value );
02891
02898 SoNONUNICODE static void setInt( const char* name, int value );
02899
02904 static void setInt( const SbString& name, int value );
02905
02912 SoNONUNICODE static void setLong( const char* name, long value );
02913
02918 static void setLong( const SbString& name, long value );
02919
02926 SoNONUNICODE static void setFloat( const char* name, float value );
02927
02932 static void setFloat( const SbString& name, float value );
02933
02940 SoNONUNICODE static void setDouble( const char* name, double value );
02941
02946 static void setDouble( const SbString& name, double value );
02947
02960 SoNONUNICODE static void setString (const char* name, const SbString& value);
02961
02971 static void setString( const SbString& name, const SbString& value );
02972
02979 SoNONUNICODE static void setVec3f( const char* name, const SbVec3f& value );
02980
02985 static void setVec3f( const SbString& name, const SbVec3f& value );
02986
02993 SoNONUNICODE static void setVec2s( const char* name, const SbVec2s& value );
02994
02999 static void setVec2s( const SbString& name, const SbVec2s& value );
03000
03007 SoNONUNICODE static void setColor( const char* name, const SbColor& value );
03008
03009
03014 static void setColor( const SbString& name, const SbColor& value );
03015
03023 SoNONUNICODE static void readFile (const char* filename);
03024
03030 static void readFile (const SbString& filename);
03031
03032 private:
03033 static SbDict* s_dictionary;
03034 static SbThreadMutex s_mutex;
03035 static void initialize ();
03036 static SbString s_unspecifiedValue;
03037 static bool s_verbose_env;
03038
03039 private:
03040 static void clean();
03041
03042 class SoPreferencesImpl;
03043 friend class SoPreferencesImpl;
03044
03045 };
03046 #endif // _SB_ENVIRONMENT_VARS_H
03047
03048