mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
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 "settings.hpp"
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <boost/filesystem/path.hpp>
|
||||||
|
#include <boost/filesystem/fstream.hpp>
|
||||||
|
|
||||||
#include <OgreResourceGroupManager.h>
|
#include <OgreResourceGroupManager.h>
|
||||||
#include <OgreStringConverter.h>
|
#include <OgreStringConverter.h>
|
||||||
|
@ -25,7 +26,8 @@ void Manager::loadDefault (const std::string& file)
|
||||||
|
|
||||||
void Manager::saveUser(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();
|
Ogre::ConfigFile::SectionIterator seci = mFile.getSectionIterator();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#include "translation.hpp"
|
#include "translation.hpp"
|
||||||
#include <components/misc/stringops.hpp>
|
|
||||||
|
|
||||||
#include <fstream>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
|
|
||||||
|
#include <components/misc/stringops.hpp>
|
||||||
|
|
||||||
namespace Translation
|
namespace Translation
|
||||||
{
|
{
|
||||||
|
@ -28,9 +29,8 @@ namespace Translation
|
||||||
|
|
||||||
if (dataFileCollections.getCollection (extension).doesExist (fileName))
|
if (dataFileCollections.getCollection (extension).doesExist (fileName))
|
||||||
{
|
{
|
||||||
std::string path = dataFileCollections.getCollection (extension).getPath (fileName).string();
|
boost::filesystem::ifstream stream (
|
||||||
|
dataFileCollections.getCollection (extension).getPath (fileName));
|
||||||
std::ifstream stream (path.c_str());
|
|
||||||
|
|
||||||
if (!stream.is_open())
|
if (!stream.is_open())
|
||||||
throw std::runtime_error ("failed to open translation file: " + fileName);
|
throw std::runtime_error ("failed to open translation file: " + fileName);
|
||||||
|
|
Loading…
Reference in a new issue