ifw-core 6.0.0
Loading...
Searching...
No Matches
file.hpp
Go to the documentation of this file.
1
6#ifndef IFW_CORE_UTILS_FILE_HPP_
7#define IFW_CORE_UTILS_FILE_HPP_
8
9#include <string>
10
12
13
14namespace ifw::core::utils::file {
15
17 std::string CheckAddExtension(const std::string& filename,
18 const std::string& extension);
19
21 void RemoveFile(const std::string& filename);
22
28 std::string LoadFile(const std::string& filename,
29 std::string* complete_filename = nullptr);
30
37 void SaveFile(const std::string& filename,
38 const std::string& buffer,
39 const bool overwrite = true);
40
45 void CheckCreatePath(const std::string& path);
46
47}
48
49#endif // !IFW_CORE_UTILS_FILE_HPP_
Definition file.cpp:17
std::string CheckAddExtension(const std::string &filename, const std::string &extension)
Check if filename has the specified extension (no initiating dot). If not, add it.
Definition file.cpp:19
std::string LoadFile(const std::string &filename, std::string *complete_filename)
Load a file and return the content.
Definition file.cpp:46
void CheckCreatePath(const std::string &path)
Check if the given path exists. If not, create it.
Definition file.cpp:97
void SaveFile(const std::string &filename, const std::string &buffer, const bool overwrite)
Save the contents inthe buffer into the given filename.
Definition file.cpp:69
void RemoveFile(const std::string &filename)
Remove the referenced file, if it exists.
Definition file.cpp:29