|
Login Languish
|
handles file related tasks More...
#include <vector>#include <string>#include <filesystem>

Go to the source code of this file.
Functions | |
| std::vector< fs::path > | file_utils::listSubdirectories (fs::path path) |
| lists subdirectories in a directory More... | |
| std::vector< fs::path > | file_utils::listFiles (fs::path path) |
| lists files in a directory More... | |
| std::vector< fs::path > | file_utils::getNRandomFilesFromSubdirectories (size_t n, const std::vector< fs::path > &directories) |
| retrieves n random files from given subdirectories More... | |
| std::vector< fs::path > | file_utils::getNRandomFiles (size_t n, fs::path directory) |
| retrieves n random files More... | |
| fs::path | file_utils::getRandomFile (fs::path directory) |
| retrieves a random file More... | |
| fs::path | file_utils::getPathToResource (const std::string &resource) |
| retrieves the resource path More... | |
| std::vector< std::string > | file_utils::convertPathsToFrontendStrings (const std::vector< fs::path > &paths) |
| converts file paths to frontend strings More... | |
| std::string | file_utils::convertPathToFrontendString (fs::path path) |
| converts file path to frontend string More... | |
| std::vector< std::vector< std::string > > | file_utils::readCSV (fs::path path) |
handles file related tasks
| std::vector< std::string > file_utils::convertPathsToFrontendStrings | ( | const std::vector< fs::path > & | paths | ) |
converts file paths to frontend strings
passes file paths in a given vector to a helper function to convert into strings for the frontend
| paths | vector of file paths |
| std::string file_utils::convertPathToFrontendString | ( | fs::path | path | ) |
converts file path to frontend string
converts the file path to a string relative to the frontend and url encodes it
| path | a file path |
| std::vector< fs::path > file_utils::getNRandomFiles | ( | size_t | n, |
| fs::path | directory | ||
| ) |
retrieves n random files
creates and returns a filepath vector of n random files in the directory
| n | number of random files to return |
| directory | path of the directory to retrieve files from |
| std::vector< fs::path > file_utils::getNRandomFilesFromSubdirectories | ( | size_t | n, |
| const std::vector< fs::path > & | directories | ||
| ) |
retrieves n random files from given subdirectories
creates and returns a file path vector of n random files from the subdirectories
| n | number of random files to return |
| subdirectories | vector of subdirectories to retrieve random files from |
| fs::path file_utils::getPathToResource | ( | const std::string & | resource | ) |
retrieves the resource path
| resource | string representation of resource |
| fs::path file_utils::getRandomFile | ( | fs::path | directory | ) |
retrieves a random file
returns the filepath of a random file in the directory
| path | path of the directory to retrieve the file from |
| std::vector< fs::path > file_utils::listFiles | ( | fs::path | path | ) |
lists files in a directory
creates and returns a filepath vector of the files in directory
| path | path of the directory to list files from |
| std::vector< fs::path > file_utils::listSubdirectories | ( | fs::path | path | ) |
lists subdirectories in a directory
creates and returns a filepath vector of the subdirectories in the directory
| path | path of the directory to list subdirectories from |
1.8.13