fix OpenCS saving to Unicode path destination

deque
greye 11 years ago
parent 9c6224c74d
commit db16bb8983

@ -27,7 +27,7 @@ void CSMDoc::OpenSaveStage::perform (int stage, Messages& messages)
{
mState.start (mDocument, mProjectFile);
mState.getStream().open ((mProjectFile ? mState.getPath() : mState.getTmpPath()).string().c_str());
mState.getStream().open (mProjectFile ? mState.getPath() : mState.getTmpPath());
if (!mState.getStream().is_open())
throw std::runtime_error ("failed to open stream for saving");
@ -260,4 +260,4 @@ void CSMDoc::FinalSavingStage::perform (int stage, Messages& messages)
mDocument.getUndoStack().setClean();
}
}
}

@ -47,7 +47,7 @@ const boost::filesystem::path& CSMDoc::SavingState::getTmpPath() const
return mTmpPath;
}
std::ofstream& CSMDoc::SavingState::getStream()
boost::filesystem::ofstream& CSMDoc::SavingState::getStream()
{
return mStream;
}
@ -60,4 +60,4 @@ ESM::ESMWriter& CSMDoc::SavingState::getWriter()
bool CSMDoc::SavingState::isProjectFile() const
{
return mProjectFile;
}
}

@ -4,6 +4,7 @@
#include <fstream>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
#include <components/esm/esmwriter.hpp>
@ -20,7 +21,7 @@ namespace CSMDoc
boost::filesystem::path mPath;
boost::filesystem::path mTmpPath;
ToUTF8::Utf8Encoder mEncoder;
std::ofstream mStream;
boost::filesystem::ofstream mStream;
ESM::ESMWriter mWriter;
boost::filesystem::path mProjectPath;
bool mProjectFile;
@ -39,7 +40,7 @@ namespace CSMDoc
const boost::filesystem::path& getTmpPath() const;
std::ofstream& getStream();
boost::filesystem::ofstream& getStream();
ESM::ESMWriter& getWriter();
@ -50,4 +51,4 @@ namespace CSMDoc
}
#endif
#endif

Loading…
Cancel
Save