OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
savingstate.hpp
Go to the documentation of this file.
1 #ifndef CSM_DOC_SAVINGSTATE_H
2 #define CSM_DOC_SAVINGSTATE_H
3 
4 #include <fstream>
5 #include <map>
6 #include <deque>
7 
8 #include <boost/filesystem/path.hpp>
9 #include <boost/filesystem/fstream.hpp>
10 
12 
14 
15 namespace CSMDoc
16 {
17  class Operation;
18  class Document;
19 
21  {
23  boost::filesystem::path mPath;
24  boost::filesystem::path mTmpPath;
26  boost::filesystem::ofstream mStream;
28  boost::filesystem::path mProjectPath;
30  std::map<std::string, std::deque<int> > mSubRecords; // record ID, list of subrecords
31 
32  public:
33 
34  SavingState (Operation& operation, const boost::filesystem::path& projectPath,
35  ToUTF8::FromType encoding);
36 
37  bool hasError() const;
38 
39  void start (Document& document, bool project);
41 
42  const boost::filesystem::path& getPath() const;
43 
44  const boost::filesystem::path& getTmpPath() const;
45 
46  boost::filesystem::ofstream& getStream();
47 
49 
50  bool isProjectFile() const;
52 
53  std::map<std::string, std::deque<int> >& getSubRecords();
54  };
55 
56 
57 }
58 
59 #endif
Definition: operation.hpp:22
Operation & mOperation
Definition: savingstate.hpp:22
SavingState(Operation &operation, const boost::filesystem::path &projectPath, ToUTF8::FromType encoding)
Definition: savingstate.cpp:6
const boost::filesystem::path & getTmpPath() const
Definition: savingstate.cpp:46
bool isProjectFile() const
Currently saving project file? (instead of content file)
Definition: savingstate.cpp:61
boost::filesystem::path mTmpPath
Definition: savingstate.hpp:24
Definition: esmwriter.hpp:17
boost::filesystem::path mPath
Definition: savingstate.hpp:23
boost::filesystem::ofstream & getStream()
Definition: savingstate.cpp:51
ESM::ESMWriter mWriter
Definition: savingstate.hpp:27
FromType
Definition: to_utf8.hpp:11
ToUTF8::Utf8Encoder mEncoder
Definition: savingstate.hpp:25
Definition: document.hpp:57
std::map< std::string, std::deque< int > > mSubRecords
Definition: savingstate.hpp:30
bool hasError() const
Definition: savingstate.cpp:13
boost::filesystem::path mProjectPath
Definition: savingstate.hpp:28
std::map< std::string, std::deque< int > > & getSubRecords()
Definition: savingstate.cpp:66
const boost::filesystem::path & getPath() const
Definition: savingstate.cpp:41
Definition: savingstate.hpp:20
Definition: to_utf8.hpp:25
boost::filesystem::ofstream mStream
Definition: savingstate.hpp:26
ESM::ESMWriter & getWriter()
Definition: savingstate.cpp:56
bool mProjectFile
Definition: savingstate.hpp:29
void start(Document &document, bool project)
Definition: savingstate.cpp:18