ifw-core 7.0.0
 
Loading...
Searching...
No Matches
file.hpp
Go to the documentation of this file.
1
6
7#ifndef IFW_CORE_UTILS_FILE_HPP_
8#define IFW_CORE_UTILS_FILE_HPP_
9
10#include <string>
11
13
14
15namespace ifw::core::utils::file {
16
18 std::string CheckAddExtension(const std::string& filename,
19 const std::string& extension);
20
22 void RemoveFile(const std::string& filename);
23
29 std::string LoadFile(const std::string& filename,
30 std::string* complete_filename = nullptr);
31
38 void SaveFile(const std::string& filename,
39 const std::string& buffer,
40 const bool overwrite = true);
41
46 void CheckCreatePath(const std::string& path);
47
48}
49
50#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:40
void CheckCreatePath(const std::string &path)
Check if the given path exists. If not, create it.
Definition file.cpp:91
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:63
void RemoveFile(const std::string &filename)
Remove the referenced file, if it exists.
Definition file.cpp:29