39 int main(
int argc,
char *argv[])
43 std::string utf8_path =
48 std::cout <<
"Directory created!" << std::endl;
51 std::cout <<
"Path exists!" << std::endl;
54 std::cout <<
"Path is a directory!" << std::endl;
57 std::cout <<
"Path is empty!" << std::endl;
60 std::string file1_str = utf8_path +
"/file1.txt",
61 file2_str = utf8_path +
"/file2.sh",
62 file3_str = utf8_path +
"/file3.txt";
63 std::ofstream file1(file1_str);
64 std::ofstream file2(file2_str);
70 std::cout <<
"File1 has extension: " << stringTxt << std::endl;
72 std::cout <<
"File1 has extension: " << stringSh << std::endl;
80 std::cout <<
"File3 is a regular file!" << std::endl;
84 std::vector<std::string> files =
87 std::cout <<
"Files size is " << files.size() << std::endl;
89 for(
size_t i = 0; i < files.size(); ++i)
93 std::cout <<
"utf8 path was removed!" << std::endl;
int main(int argc, char *argv[])
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.
static std::string toUTF8(const std::string &src)
Convert a string from a current locale encoding to UTF-8.
static bool isRegularFile(const std::string &path)
Checks if a given path in UTF-8 is a regular file.