Use generic_category::message() instead of strerror() in filefuncs.cpp
This commit is contained in:
		
							parent
							
								
									5f2c83c997
								
							
						
					
					
						commit
						eb586a2899
					
				| @ -1,17 +1,19 @@ | ||||
| #include <fstream> | ||||
| #include <iostream> | ||||
| #include <cstring> | ||||
| #include <system_error> | ||||
| using namespace std; | ||||
| 
 | ||||
| string getFileContent(const string& file, const bool& parallel) | ||||
| { | ||||
|     ifstream fileStream(file, ios::in); | ||||
|     if (not fileStream.fail()) { | ||||
|         string lineinput, fullinput; | ||||
|     if (fileStream.is_open()) while (getline(fileStream, lineinput)) { | ||||
|         while (getline(fileStream, lineinput)) { | ||||
|             fullinput.append(lineinput += '\n'); | ||||
|     } else throw Yerbacon::Exception("Could not open \"" + file + "\"" + ((not parallel) ? string(" : ").append(strerror(errno)) : ".")); // TODO: Use a thread-safe function when the parallel mode is in use
 | ||||
|         } | ||||
|         fileStream.close(); | ||||
|         return fullinput; | ||||
|     } else throw Yerbacon::Exception("Could not open \"" + file + "\" : " + generic_category().message(errno)); | ||||
| } | ||||
| 
 | ||||
| void outputFileContent(const string& file, const string_view content) { | ||||
|  | ||||
| @ -18,11 +18,6 @@ | ||||
| #error "A valid std::threads implementation is required" | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| // #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
 | ||||
| #define _CRT_SECURE_NO_WARNINGS 1 | ||||
| #endif | ||||
| 
 | ||||
| #include <version> | ||||
| #if not defined(__cpp_lib_concepts) || not defined(__cpp_lib_integer_comparison_functions) | ||||
| #error "The current standard library is incomplete" | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user