1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 03:39:55 +00:00

Remove some more of boost::

This commit is contained in:
jvoisin 2022-05-25 21:16:26 +02:00
parent 29328867dc
commit cb226e00f9
6 changed files with 18 additions and 14 deletions

View File

@ -1,5 +1,7 @@
#include "statemanagerimp.hpp" #include "statemanagerimp.hpp"
#include <filesystem>
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
#include <components/esm3/esmwriter.hpp> #include <components/esm3/esmwriter.hpp>
@ -388,7 +390,7 @@ void MWState::StateManager::loadGame (const Character *character, const std::str
{ {
cleanup(); cleanup();
Log(Debug::Info) << "Reading save file " << boost::filesystem::path(filepath).filename().string(); Log(Debug::Info) << "Reading save file " << std::filesystem::path(filepath).filename().string();
ESM::ESMReader reader; ESM::ESMReader reader;
reader.open (filepath); reader.open (filepath);

View File

@ -1,6 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <boost/filesystem/fstream.hpp> #include <fstream>
#include <filesystem>
#include <components/files/configurationmanager.hpp> #include <components/files/configurationmanager.hpp>
#include <components/esm3/esmreader.hpp> #include <components/esm3/esmreader.hpp>
@ -110,7 +111,7 @@ TEST_F(ContentFileTest, dialogue_merging_test)
const std::string file = "test_dialogue_merging.txt"; const std::string file = "test_dialogue_merging.txt";
boost::filesystem::ofstream stream; std::ofstream stream;
stream.open(file); stream.open(file);
const MWWorld::Store<ESM::Dialogue>& dialStore = mEsmStore.get<ESM::Dialogue>(); const MWWorld::Store<ESM::Dialogue>& dialStore = mEsmStore.get<ESM::Dialogue>();
@ -192,7 +193,7 @@ TEST_F(ContentFileTest, content_diagnostics_test)
const std::string file = "test_content_diagnostics.txt"; const std::string file = "test_content_diagnostics.txt";
boost::filesystem::ofstream stream; std::ofstream stream;
stream.open(file); stream.open(file);
RUN_TEST_FOR_TYPES(printRecords, mEsmStore, stream); RUN_TEST_FOR_TYPES(printRecords, mEsmStore, stream);

View File

@ -1,6 +1,6 @@
#include <components/settings/parser.hpp> #include <components/settings/parser.hpp>
#include <boost/filesystem/fstream.hpp> #include <fstream>
#include <gtest/gtest.h> #include <gtest/gtest.h>
@ -20,7 +20,7 @@ namespace
const auto path = std::string(UnitTest::GetInstance()->current_test_info()->name()) + ".cfg"; const auto path = std::string(UnitTest::GetInstance()->current_test_info()->name()) + ".cfg";
{ {
boost::filesystem::ofstream stream; std::ofstream stream;
stream.open(path); stream.open(path);
stream << content; stream << content;
stream.close(); stream.close();

View File

@ -1,6 +1,6 @@
#include <components/shader/shadermanager.hpp> #include <components/shader/shadermanager.hpp>
#include <boost/filesystem/fstream.hpp> #include <fstream>
#include <gtest/gtest.h> #include <gtest/gtest.h>
@ -31,7 +31,7 @@ namespace
const auto path = UnitTest::GetInstance()->current_test_info()->name() + suffix + ".glsl"; const auto path = UnitTest::GetInstance()->current_test_info()->name() + suffix + ".glsl";
{ {
boost::filesystem::ofstream stream; std::ofstream stream;
stream.open(path); stream.open(path);
stream << content; stream << content;
stream.close(); stream.close();

View File

@ -1,6 +1,7 @@
#include "settings.hpp" #include "settings.hpp"
#include "parser.hpp" #include "parser.hpp"
#include <filesystem>
#include <sstream> #include <sstream>
#include <components/files/configurationmanager.hpp> #include <components/files/configurationmanager.hpp>
@ -44,7 +45,7 @@ std::string Manager::load(const Files::ConfigurationManager& cfgMgr, bool loadEd
// Create the settings manager and load default settings file. // Create the settings manager and load default settings file.
const std::string defaultsBin = (paths.front() / defaultSettingsFile).string(); const std::string defaultsBin = (paths.front() / defaultSettingsFile).string();
if (!boost::filesystem::exists(defaultsBin)) if (!std::filesystem::exists(defaultsBin))
throw std::runtime_error ("No default settings file found! Make sure the file \"" + defaultSettingsFile + "\" was properly installed."); throw std::runtime_error ("No default settings file found! Make sure the file \"" + defaultSettingsFile + "\" was properly installed.");
parser.loadSettingsFile(defaultsBin, mDefaultSettings, true, false); parser.loadSettingsFile(defaultsBin, mDefaultSettings, true, false);
@ -52,13 +53,13 @@ std::string Manager::load(const Files::ConfigurationManager& cfgMgr, bool loadEd
for (int i = 0; i < static_cast<int>(paths.size()) - 1; ++i) for (int i = 0; i < static_cast<int>(paths.size()) - 1; ++i)
{ {
const std::string additionalDefaults = (paths[i] / userSettingsFile).string(); const std::string additionalDefaults = (paths[i] / userSettingsFile).string();
if (boost::filesystem::exists(additionalDefaults)) if (std::filesystem::exists(additionalDefaults))
parser.loadSettingsFile(additionalDefaults, mDefaultSettings, false, true); parser.loadSettingsFile(additionalDefaults, mDefaultSettings, false, true);
} }
// Load "settings.cfg" or "openmw-cs.cfg" from the last config dir as user settings. This path will be used to save modified settings. // Load "settings.cfg" or "openmw-cs.cfg" from the last config dir as user settings. This path will be used to save modified settings.
std::string settingspath = (paths.back() / userSettingsFile).string(); std::string settingspath = (paths.back() / userSettingsFile).string();
if (boost::filesystem::exists(settingspath)) if (std::filesystem::exists(settingspath))
parser.loadSettingsFile(settingspath, mUserSettings, false, false); parser.loadSettingsFile(settingspath, mUserSettings, false, false);
return settingspath; return settingspath;

View File

@ -1,6 +1,6 @@
#include "translation.hpp" #include "translation.hpp"
#include <boost/filesystem/fstream.hpp> #include <fstream>
namespace Translation namespace Translation
{ {
@ -32,8 +32,8 @@ namespace Translation
if (dataFileCollections.getCollection (extension).doesExist (fileName)) if (dataFileCollections.getCollection (extension).doesExist (fileName))
{ {
boost::filesystem::ifstream stream ( std::ifstream stream (
dataFileCollections.getCollection (extension).getPath (fileName)); dataFileCollections.getCollection (extension).getPath (fileName).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);