OpenMW
apps/opencs/model/doc/savingstate.hpp
Go to the documentation of this file.
00001 #ifndef CSM_DOC_SAVINGSTATE_H
00002 #define CSM_DOC_SAVINGSTATE_H
00003 
00004 #include <fstream>
00005 
00006 #include <boost/filesystem/path.hpp>
00007 
00008 #include <components/esm/esmwriter.hpp>
00009 
00010 namespace CSMDoc
00011 {
00012     class Operation;
00013     class Document;
00014 
00015     class SavingState
00016     {
00017             Operation& mOperation;
00018             boost::filesystem::path mPath;
00019             boost::filesystem::path mTmpPath;
00020             ToUTF8::Utf8Encoder mEncoder;
00021             std::ofstream mStream;
00022             ESM::ESMWriter mWriter;
00023             boost::filesystem::path mProjectPath;
00024             bool mProjectFile;
00025 
00026         public:
00027 
00028             SavingState (Operation& operation, const boost::filesystem::path& projectPath);
00029 
00030             bool hasError() const;
00031 
00032             void start (Document& document, bool project);
00034 
00035             const boost::filesystem::path& getPath() const;
00036 
00037             const boost::filesystem::path& getTmpPath() const;
00038 
00039             std::ofstream& getStream();
00040 
00041             ESM::ESMWriter& getWriter();
00042 
00043             bool isProjectFile() const;
00045     };
00046 
00047 
00048 }
00049 
00050 #endif