VR-Vantage API Documentation
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 namespace makVrv
22 {
23 
27  {
28  public:
29 
31  virtual ~DtDeSettings();
32 
34  const std::string& name() const;
35 
37  const std::string& extension() const;
38 
40  template <typename RecordType>
41  bool readDefaultRecord(RecordType& r);
42 
44  template <typename RecordType>
45  bool readBackupRecord(RecordType& r);
46 
47  template <typename RecordType>
48  bool readFactoryDefaultRecord(RecordType& r);
49 
51  template <typename RecordType>
52  bool writeDefaultRecord(const RecordType& r);
53 
55  template <typename RecordType>
56  bool writeBackupRecord(const RecordType& r);
57 
59  template <typename RecordType>
60  bool readRecordFrom(RecordType& r, const std::string& importFileName);
61 
63  template <typename RecordType>
64  bool writeRecordTo( const RecordType& r, const std::string& exportFileName ) const;
65 
66  inline void setAutoSave( bool b )
67  {
68  myAutoSave = b;
69  }
70 
71  inline bool autoSave() const
72  {
73  return myAutoSave;
74  }
75 
78  bool defaultFileExists() const;
79  virtual std::string defaultFilePath() const;
81 
84  bool factoryFileExists() const;
85  virtual std::string factoryFilePath() const;
87 
90  bool backupFileExists() const;
91  virtual std::string backupFilePath() const;
93 
94  protected:
95 
96  friend class DtDeSettingsManager;
97 
98  DtDeSettings( DtDe& de, const std::string& name,const std::string& ext );
99 
100  protected:
101 
103  std::string myName;
104  std::string myExtension;
106 
107  };
108 
109 }
110 
111 #define DtDeSettings_INL_
112 #include <vrvCore/DtDeSettings.inl>
113 #undef DtDeSettings_INL_


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)