File indexing completed on 2025-01-18 10:04:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Resource_Manager_HeaderFile
0018 #define _Resource_Manager_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022
0023 #include <TCollection_AsciiString.hxx>
0024 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
0025 #include <Resource_DataMapOfAsciiStringExtendedString.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <Standard_Transient.hxx>
0028 #include <Standard_CString.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <Standard_Real.hxx>
0031
0032
0033 class Resource_Manager;
0034 DEFINE_STANDARD_HANDLE(Resource_Manager, Standard_Transient)
0035
0036
0037 class Resource_Manager : public Standard_Transient
0038 {
0039 DEFINE_STANDARD_RTTIEXT(Resource_Manager,Standard_Transient)
0040 public:
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 Standard_EXPORT Resource_Manager(const Standard_CString aName, const Standard_Boolean Verbose = Standard_False);
0055
0056
0057 Standard_EXPORT Resource_Manager();
0058
0059
0060
0061
0062
0063
0064 Standard_EXPORT Resource_Manager (const TCollection_AsciiString& theName,
0065 const TCollection_AsciiString& theDefaultsDirectory,
0066 const TCollection_AsciiString& theUserDefaultsDirectory,
0067 const Standard_Boolean theIsVerbose = Standard_False);
0068
0069
0070
0071 Standard_EXPORT Standard_Boolean Save() const;
0072
0073
0074 Standard_EXPORT Standard_Boolean Find (const Standard_CString aResource) const;
0075
0076
0077 Standard_EXPORT Standard_Boolean Find (const TCollection_AsciiString& theResource,
0078 TCollection_AsciiString& theValue) const;
0079
0080
0081
0082 Standard_EXPORT virtual Standard_Integer Integer (const Standard_CString aResourceName) const;
0083
0084
0085
0086 Standard_EXPORT virtual Standard_Real Real (const Standard_CString aResourceName) const;
0087
0088
0089
0090 Standard_EXPORT virtual Standard_CString Value (const Standard_CString aResourceName) const;
0091
0092
0093
0094 Standard_EXPORT virtual Standard_ExtString ExtValue (const Standard_CString aResourceName);
0095
0096
0097
0098 Standard_EXPORT virtual void SetResource (const Standard_CString aResourceName, const Standard_Integer aValue);
0099
0100
0101
0102 Standard_EXPORT virtual void SetResource (const Standard_CString aResourceName, const Standard_Real aValue);
0103
0104
0105
0106 Standard_EXPORT virtual void SetResource (const Standard_CString aResourceName, const Standard_CString aValue);
0107
0108
0109
0110 Standard_EXPORT virtual void SetResource (const Standard_CString aResourceName, const Standard_ExtString aValue);
0111
0112
0113
0114
0115 Standard_EXPORT static void GetResourcePath (TCollection_AsciiString& aPath, const Standard_CString aName, const Standard_Boolean isUserDefaults);
0116
0117
0118 Standard_EXPORT Resource_DataMapOfAsciiStringAsciiString& GetMap(Standard_Boolean theRefMap = Standard_True);
0119
0120 private:
0121
0122 Standard_EXPORT void Load (const TCollection_AsciiString& thePath,
0123 Resource_DataMapOfAsciiStringAsciiString& aMap);
0124
0125 private:
0126
0127 TCollection_AsciiString myName;
0128 Resource_DataMapOfAsciiStringAsciiString myRefMap;
0129 Resource_DataMapOfAsciiStringAsciiString myUserMap;
0130 Resource_DataMapOfAsciiStringExtendedString myExtStrMap;
0131 Standard_Boolean myVerbose;
0132
0133 };
0134
0135 #endif