VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtDeSettings.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2012 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 
15 #include <vrvUtil/DtDeError.h>
16 
17 #include <vrvCore/DtDe.h>
18 
19 #include <string>
20 
21 #define DT_DE_SETTINGS_USE_BINARY_FILES 0
22 
23 namespace makVrv
24 {
25 
29  {
30  public:
31 
33  virtual ~DtDeSettings();
34 
36  const std::string& name() const;
37 
39  const std::string& extension() const;
40 
42  template <typename RecordType>
43  bool readDefaultRecord(RecordType& r);
44 
46  template <typename RecordType>
47  bool readBackupRecord(RecordType& r);
48 
49  template <typename RecordType>
50  bool readFactoryDefaultRecord(RecordType& r);
51 
53  template <typename RecordType>
54  bool writeDefaultRecord(const RecordType& r);
55 
57  template <typename RecordType>
58  bool writeBackupRecord(const RecordType& r);
59 
61  template <typename RecordType>
62  bool readRecordFrom(RecordType& r, const std::string& importFileName);
63 
65  template <typename RecordType>
66  bool readRecordFromBinary(RecordType& r, const std::string& importFileName);
67 
69  template <typename RecordType>
70  bool writeRecordTo( const RecordType& r, const std::string& exportFileName ) const;
71 
73  template <typename RecordType>
74  bool writeRecordToBinary( const RecordType& r, const std::string& exportFileName ) const;
75 
76  inline void setAutoSave( bool b )
77  {
78  myAutoSave = b;
79  }
80 
81  inline bool autoSave() const
82  {
83  return myAutoSave;
84  }
85 
88  bool defaultFileExists() const;
89  virtual std::string defaultFilePath() const;
90 
91  bool defaultBinaryFileExists() const;
92  virtual std::string defaultBinaryFilePath() const;
93 
95 
98  bool factoryFileExists() const;
99  virtual std::string factoryFilePath() const;
101 
104  bool backupFileExists() const;
105  virtual std::string backupFilePath() const;
107 
108  static std::string binaryFileExtension(void);
109 
110  protected:
111 
112  friend class DtDeSettingsManager;
113 
114  DtDeSettings( DtDe& de, const std::string& name,const std::string& ext );
115 
116  protected:
117 
119  std::string myName;
120  std::string myExtension;
122 
123  static const std::string myBinaryFileExtension;
124 
125  };
126 
127 }
128 
129 #define DtDeSettings_INL_
130 #include <vrvCore/DtDeSettings.inl>
131 #undef DtDeSettings_INL_

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)