mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 20:26:48 +00:00 
			
		
		
		
	open fstreams from boost::filesystem::path, vol.1
This commit is contained in:
		
							parent
							
								
									18b3cfebdb
								
							
						
					
					
						commit
						a22ec223d8
					
				
					 3 changed files with 10 additions and 6 deletions
				
			
		|  | @ -1,6 +1,6 @@ | |||
| #include "unshieldthread.hpp" | ||||
| 
 | ||||
| #include <fstream> | ||||
| #include <boost/filesystem/fstream.hpp> | ||||
| #include <components/misc/stringops.hpp> | ||||
|     | ||||
| namespace bfs = boost::filesystem; | ||||
|  | @ -49,7 +49,7 @@ namespace | |||
| 
 | ||||
|     std::string read_to_string(const bfs::path& path) | ||||
|     { | ||||
|         std::ifstream strstream(path.c_str(), std::ios::in | std::ios::binary); | ||||
|         bfs::ifstream strstream(path, std::ios::in | std::ios::binary); | ||||
|         std::string str; | ||||
| 
 | ||||
|         strstream.seekg(0, std::ios::end); | ||||
|  | @ -201,7 +201,7 @@ namespace | |||
|             add_setting("Archives", "Archive 1", "Bloodmoon.bsa", ini); | ||||
|         } | ||||
| 
 | ||||
|         std::ofstream inistream(ini_path.c_str()); | ||||
|         bfs::ofstream inistream(ini_path) | ||||
|         inistream << ini; | ||||
|         inistream.close(); | ||||
|     } | ||||
|  |  | |||
|  | @ -1,5 +1,8 @@ | |||
| #include "console.hpp" | ||||
| 
 | ||||
| #include <boost/filesystem.hpp> | ||||
| #include <boost/filesystem/fstream.hpp> | ||||
| 
 | ||||
| #include <components/compiler/exception.hpp> | ||||
| #include <components/compiler/extensions0.hpp> | ||||
| 
 | ||||
|  | @ -194,7 +197,8 @@ namespace MWGui | |||
| 
 | ||||
|     void Console::executeFile (const std::string& path) | ||||
|     { | ||||
|         std::ifstream stream (path.c_str()); | ||||
|         namespace bfs = boost::filesystem; | ||||
|         bfs::ifstream stream (bfs::path(path)); | ||||
| 
 | ||||
|         if (!stream.is_open()) | ||||
|             printError ("failed to open file: " + path); | ||||
|  |  | |||
|  | @ -1,12 +1,12 @@ | |||
| #include "configurationmanager.hpp" | ||||
| 
 | ||||
| #include <string> | ||||
| #include <fstream> | ||||
| #include <iostream> | ||||
| #include <algorithm> | ||||
| 
 | ||||
| #include <boost/bind.hpp> | ||||
| #include <boost/algorithm/string/erase.hpp> | ||||
| #include <boost/filesystem/fstream.hpp> | ||||
| 
 | ||||
| /**
 | ||||
|  * \namespace Files | ||||
|  | @ -125,7 +125,7 @@ void ConfigurationManager::loadConfig(const boost::filesystem::path& path, | |||
|     { | ||||
|         std::cout << "Loading config file: " << cfgFile.string() << "... "; | ||||
| 
 | ||||
|         std::ifstream configFileStream(cfgFile.string().c_str()); | ||||
|         boost::filesystem::ifstream configFileStream(cfgFile); | ||||
|         if (configFileStream.is_open()) | ||||
|         { | ||||
|             boost::program_options::store(boost::program_options::parse_config_file( | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue