![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /***************************************************************************** 00002 * Copyright (c) 2012 MAK Technologies, Inc. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 00009 00010 #pragma once 00011 00012 #include <vrvCore/vrvCore.h> 00013 00014 #include <vrvUtil/DtVrvFilesystem.h> 00015 #include <vrvUtil/DtDeError.h> 00016 00017 #include <vrvCore/DtDe.h> 00018 00019 #include <string> 00020 00021 namespace makVrv 00022 { 00023 00026 class DT_DLL_VRVCORE DtDeSettings 00027 { 00028 public: 00029 00031 virtual ~DtDeSettings(); 00032 00034 const std::string& name() const; 00035 00037 const std::string& extension() const; 00038 00040 template <typename RecordType> 00041 bool readDefaultRecord(RecordType& r); 00042 00044 template <typename RecordType> 00045 bool readBackupRecord(RecordType& r); 00046 00047 template <typename RecordType> 00048 bool readFactoryDefaultRecord(RecordType& r); 00049 00051 template <typename RecordType> 00052 bool writeDefaultRecord(const RecordType& r); 00053 00055 template <typename RecordType> 00056 bool writeBackupRecord(const RecordType& r); 00057 00059 template <typename RecordType> 00060 bool readRecordFrom(RecordType& r, const std::string& importFileName); 00061 00063 template <typename RecordType> 00064 bool writeRecordTo( const RecordType& r, const std::string& exportFileName ) const; 00065 00066 inline void setAutoSave( bool b ) 00067 { 00068 myAutoSave = b; 00069 } 00070 00071 inline bool autoSave() const 00072 { 00073 return myAutoSave; 00074 } 00075 00078 bool defaultFileExists() const; 00079 virtual std::string defaultFilePath() const; 00081 00084 bool factoryFileExists() const; 00085 virtual std::string factoryFilePath() const; 00087 00090 bool backupFileExists() const; 00091 virtual std::string backupFilePath() const; 00093 00094 protected: 00095 00096 friend class DtDeSettingsManager; 00097 00098 DtDeSettings( DtDe& de, const std::string& name,const std::string& ext ); 00099 00100 protected: 00101 00102 DtDe& myDe; 00103 std::string myName; 00104 std::string myExtension; 00105 bool myAutoSave; 00106 00107 }; 00108 00109 } 00110 00111 #define DtDeSettings_INL_ 00112 #include <vrvCore/DtDeSettings.inl> 00113 #undef DtDeSettings_INL_