nexuslua
|
various helper functions More...
Functions | |
NEXUSLUA_EXPORT std::string | ReadHttp (const std::string &URL, const std::string &outFile="", std::function< void(DownloadProgress, std::string)> progress=nullptr, std::function< bool()> abort=nullptr) |
reads a file from a the given URL (no https) | |
NEXUSLUA_EXPORT std::string | ReadHttp (const std::string &host, const std::string &port, const std::string &path, const std::string &outFile="", std::function< void(DownloadProgress, std::string)> progress=nullptr, std::function< bool()> abort=nullptr) |
reads a file from a the given URL (no https) | |
NEXUSLUA_EXPORT std::string | ReadHttps (const std::string &host, const std::string &port, const std::string &path, const std::string &outFile="", std::function< void(DownloadProgress, std::string)> progress=nullptr, std::function< bool()> abort=nullptr) |
reads a file from a the given URL | |
NEXUSLUA_EXPORT std::string | RemoveWsFromParams (std::string signature) |
removes redundant white spaces from the given function signature | |
NEXUSLUA_EXPORT void | ParseHostPortPath (std::string URL, std::string &host, std::string &port, std::string &path) |
splits up the given URL into the three components host, port and path and sets the reference parameters to these | |
NEXUSLUA_EXPORT bool | Unzip (std::filesystem::path zip_file, std::filesystem::path target_dir) |
unzips the given zip file to the given target dir. Throws std::runtime_error in case of errors. | |
NEXUSLUA_EXPORT bool | Zip (std::filesystem::path source_dir, std::filesystem::path zip_file) |
zips the given target directory to the given output zip file. Throws std::runtime_error in case of errors. |
various helper functions
NEXUSLUA_EXPORT void nexuslua::utility::ParseHostPortPath | ( | std::string | URL, |
std::string & | host, | ||
std::string & | port, | ||
std::string & | path ) |
splits up the given URL into the three components host, port and path and sets the reference parameters to these
NEXUSLUA_EXPORT std::string nexuslua::utility::ReadHttp | ( | const std::string & | host, |
const std::string & | port, | ||
const std::string & | path, | ||
const std::string & | outFile = "", | ||
std::function< void(DownloadProgress, std::string)> | progress = nullptr, | ||
std::function< bool()> | abort = nullptr ) |
reads a file from a the given URL (no https)
host | the host to read from |
port | the port to read from |
path | the path on the host to read from |
outFile | an optional path to an output file |
progress | an optional callback function that will be called to set the progress during the download |
abort | an optional callback function that will be checked during download; if it returns true, the download will be canceled |
NEXUSLUA_EXPORT std::string nexuslua::utility::ReadHttp | ( | const std::string & | URL, |
const std::string & | outFile = "", | ||
std::function< void(DownloadProgress, std::string)> | progress = nullptr, | ||
std::function< bool()> | abort = nullptr ) |
reads a file from a the given URL (no https)
URL | the URL to read from |
outFile | an optional path to an output file |
progress | an optional callback function that will be called to set the progress during the download |
abort | an optional callback function that will be checked during download; if it returns true, the download will be canceled |
NEXUSLUA_EXPORT std::string nexuslua::utility::ReadHttps | ( | const std::string & | host, |
const std::string & | port, | ||
const std::string & | path, | ||
const std::string & | outFile = "", | ||
std::function< void(DownloadProgress, std::string)> | progress = nullptr, | ||
std::function< bool()> | abort = nullptr ) |
reads a file from a the given URL
host | the host to read from |
port | the port to read from |
path | the path on the host to read from |
outFile | an optional path to an output file |
progress | an optional callback function that will be called to set the progress during the download |
abort | an optional callback function that will be checked during download; if it returns true, the download will be canceled |
NEXUSLUA_EXPORT std::string nexuslua::utility::RemoveWsFromParams | ( | std::string | signature | ) |
removes redundant white spaces from the given function signature
NEXUSLUA_EXPORT bool nexuslua::utility::Unzip | ( | std::filesystem::path | zip_file, |
std::filesystem::path | target_dir ) |
unzips the given zip file to the given target dir. Throws std::runtime_error in case of errors.
NEXUSLUA_EXPORT bool nexuslua::utility::Zip | ( | std::filesystem::path | source_dir, |
std::filesystem::path | zip_file ) |
zips the given target directory to the given output zip file. Throws std::runtime_error in case of errors.