30 #ifndef __TERRALIB_CORE_FILESYSTEM_FILESYSTEM_H__ 31 #define __TERRALIB_CORE_FILESYSTEM_FILESYSTEM_H__ 34 #include "../Config.h" 42 #include <boost/thread/mutex.hpp> 62 static std::string currentPath();
71 static std::string systemCompletePath(
const std::string& path);
78 static std::string tempDirectoryPath();
88 static std::string uniquePath(
89 const std::string& format =
"%%%%-%%%%-%%%%-%%%%");
98 static std::string absolutePath(
const std::string& path);
107 static std::string extension(
const std::string& path);
116 static std::string fileName(
const std::string& path);
125 static std::string stem(
const std::string& path);
134 static std::string parentPath(
const std::string& path);
143 static bool isDirectory(
const std::string& path);
152 static bool isEmpty(
const std::string& path);
160 static bool isRegularFile(
const std::string& path);
168 static std::string executableDirectory();
177 static bool exists(
const std::string& path);
186 static bool createDirectory(
const std::string& path);
195 static bool createDirectories(
const std::string& path);
204 static void copyFile(
const std::string& from,
const std::string& to);
216 static bool remove(
const std::string& path);
224 static void rename(
const std::string& old_p,
const std::string& new_p);
233 static std::vector<std::string> listDirectory(
const std::string& path);
245 static uintmax_t fileSize(
const std::string& path);
255 static std::string adjustPathToNativeForm(
const std::string& filePath);
265 static std::string adjustPathToGenericForm(
const std::string& filePath);
270 static std::string getNativeSeparator();
277 static std::string readFromFile(
const std::string& filePath);
286 static void writeToFile(
const std::string& filePath,
const std::string& content);
296 static std::string createTempFilePathString(
const std::string& filePath);
298 static std::string createTempFileDirectoryPathString();
305 static std::string getFileContent(
const std::string& filePath);
312 static bool isBlank(
const std::string& filePath);
319 static bool isInvalid(
const std::string& content);
329 #endif //__TERRALIB_CORE_FILESYSTEM_FILESYSTEM_H__ A class for handling system files and paths using UTF-8 strings.
static boost::mutex mutexFileSystem
Used to perform the tasks: write to file or read from file.