forked from mirror/openmw-tes3mp
open fstreams from boost::filesystem::path, vol.2
This commit is contained in:
parent
2236216344
commit
424d06a6f8
2 changed files with 9 additions and 7 deletions
|
@ -1,7 +1,8 @@
|
|||
#include "settings.hpp"
|
||||
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
|
||||
#include <OgreResourceGroupManager.h>
|
||||
#include <OgreStringConverter.h>
|
||||
|
@ -25,7 +26,8 @@ void Manager::loadDefault (const std::string& file)
|
|||
|
||||
void Manager::saveUser(const std::string& file)
|
||||
{
|
||||
std::fstream fout(file.c_str(), std::ios::out);
|
||||
namespace bfs = boost::filesystem;
|
||||
bfs::ofstream fout(bfs::path(file));
|
||||
|
||||
Ogre::ConfigFile::SectionIterator seci = mFile.getSectionIterator();
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include "translation.hpp"
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
||||
namespace Translation
|
||||
{
|
||||
|
@ -28,9 +29,8 @@ namespace Translation
|
|||
|
||||
if (dataFileCollections.getCollection (extension).doesExist (fileName))
|
||||
{
|
||||
std::string path = dataFileCollections.getCollection (extension).getPath (fileName).string();
|
||||
|
||||
std::ifstream stream (path.c_str());
|
||||
boost::filesystem::ifstream stream (
|
||||
dataFileCollections.getCollection (extension).getPath (fileName));
|
||||
|
||||
if (!stream.is_open())
|
||||
throw std::runtime_error ("failed to open translation file: " + fileName);
|
||||
|
|
Loading…
Reference in a new issue