39 #include <boost/test/unit_test.hpp> 45 std::string utf8_path =
54 std::string file1_str = utf8_path +
"/file1.txt",
55 file2_str = utf8_path +
"/file2.sh",
56 file3_str = utf8_path +
"/file3.txt";
57 std::ofstream file1(file1_str);
58 std::ofstream file2(file2_str);
68 std::vector<std::string> files =
71 BOOST_CHECK(files.size() == 3);
73 for(
size_t i = 0; i < files.size(); ++i)
79 BOOST_AUTO_TEST_SUITE_END()
static bool exists(const std::string &path)
Checks if a given path in UTF-8 exists.
static bool isDirectory(const std::string &path)
Checks if a given path in UTF-8 is a directory.
static std::vector< std::string > listDirectory(const std::string &path)
Lists a directory from a given path in UTF-8.
static bool isEmpty(const std::string &path)
Checks if a given path in UTF-8 is an empty directory.
static void rename(const std::string &old_p, const std::string &new_p)
Renames a file or directory from a given path in UTF-8.
static std::string extension(const std::string &path)
Retrives the extension of a given file path in UTF-8.
static bool remove(const std::string &path)
Removes a file or directory from a given path in UTF-8.
A class for handling system files and paths.
A class for handling character enconding/decoding.
static void copyFile(const std::string &from, const std::string &to)
Copies a file.
static bool createDirectory(const std::string &path)
Creates a directory from a given path in UTF-8.
BOOST_AUTO_TEST_SUITE(filesystem) BOOST_AUTO_TEST_CASE(filesystem_test)
static std::string toUTF8(const std::string &src)
Convert a string from a current locale encoding to UTF-8.
BOOST_AUTO_TEST_CASE(encoding_test_utf8_latin1)
static bool isRegularFile(const std::string &path)
Checks if a given path in UTF-8 is a regular file.