#include <cstddef>
#include <deque>
#include <filesystem>
#include <fstream>
#include <regex>
#include <sstream>
#include <string>
#include <vector>
#include <archive.h>
Go to the source code of this file.
Namespaces | |
namespace | aurostd |
namespace | aurostd::JSON |
unified namespace to read and write JSON | |
namespace | aurostd::EmbData |
Enumerations | |
enum | aurostd::compression_type { aurostd::None , aurostd::XZ , aurostd::ZIP , aurostd::BZ2 , aurostd::GZ , aurostd::ZSTD } |
Functions | |
compression_type | aurostd::GetCompressionType (const fs::path &path) |
bool | aurostd::DirectoryMake (const std::string &directory_raw) |
bool | aurostd::SSH_DirectoryMake (const std::string &user, std::string machine, std::string Directory) |
bool | aurostd::SubDirectoryLS (const std::string &directory_raw, std::vector< std::string > &vsubd) |
bool | aurostd::DirectoryLS (const std::string &directory_raw, std::vector< std::string > &vfiles) |
bool | aurostd::DirectoryLS (const std::string &directory_raw, std::deque< std::string > &vfiles) |
std::string | aurostd::dirname (const std::string &file) |
std::string | aurostd::basename (const std::string &file) |
std::string | aurostd::GetFileExtension (const std::string &FileName) |
std::string | aurostd::CleanFileName (const std::string &fileIN) |
bool | aurostd::DirectoryLocked (const std::string &directory, const std::string &LOCK) |
bool | aurostd::DirectoryLocked (const std::string &directory) |
bool | aurostd::DirectorySkipped (const std::string &directory) |
bool | aurostd::DirectoryWritable (const std::string &directory_raw) |
bool | aurostd::IsDirectory (const std::string &path) |
bool | aurostd::IsCompressed (const std::string &FileNameIn, std::string &FileNameOut) |
bool | aurostd::IsCompressed (const std::string &FileNameIn) |
bool | aurostd::FileExist (const std::string &FileName) |
bool | aurostd::FileExist (const std::string &FileName, std::string &FileNameOut) |
bool | aurostd::CompressFileExist (const std::string &FileName) |
bool | aurostd::CompressFileExist (const std::string &FileNameRaw, std::string &FileNameOut) |
bool | aurostd::CompressFileWithinList (const std::vector< std::string > &list, const std::string &input) |
bool | aurostd::CompressFileWithinList (const std::vector< std::string > &list, const std::string &input, std::string &output) |
bool | aurostd::FileEmpty (const std::string &FileNameRaw) |
bool | aurostd::FileNotEmpty (const std::string &FileName) |
long int | aurostd::GetTimestampModified (const std::string &) |
long int | aurostd::SecondsSinceFileModified (const std::string &) |
unsigned long long int | aurostd::FileSize (const std::string &FileName) |
void | aurostd::InFileExistCheck (const std::string &routine, const std::string &FileNameRaw, const std::ifstream &file_to_check) |
std::string | aurostd::TmpStrCreate (const std::string &identifier_raw="", const std::string &tmpdir_raw="", bool hidden=false, bool directory=false) |
std::string | aurostd::TmpFileCreate (const std::string &identifier="", const std::string &tmpdir="", bool hidden=false) |
std::string | aurostd::TmpDirectoryCreate (const std::string &identifier="", const std::string &tmpdir="", bool hidden=false) |
bool | aurostd::CopyFile (const std::string &file_from, const std::string &file_to) |
bool | aurostd::LinkFile (const std::string &file_from, const std::string &file_to, bool soft=true) |
bool | aurostd::file2directory (const std::string &file, const std::string &destination) |
bool | aurostd::file2directory (const std::vector< std::string > &files, const std::string &destination) |
bool | aurostd::file2file (const std::string &file, const std::string &destination) |
bool | aurostd::RemoveFile (const std::string &file) |
bool | aurostd::RemoveFile (const std::string &directory, const std::regex ®ex_pattern) |
bool | aurostd::RemoveFiles (const std::string &directory) |
bool | aurostd::RemoveFile (const std::vector< std::string > &files) |
bool | aurostd::RemoveDirectory (const std::string &directory) |
std::string | aurostd::file2string (const std::string &FileNameIN) |
size_t | aurostd::file2string (const std::string &FileNameIN, std::string &StringIN) |
std::string | aurostd::compressfile2string (const std::string &FileNameIN) |
size_t | aurostd::compressfile2string (const std::string &FileNameIN, std::string &content) |
size_t | aurostd::file2vectorstring (const std::string &FileNameIN, std::vector< std::string > &vline, bool consecutive=false, bool trim_edges=false) |
size_t | aurostd::file2vectorstring (const std::string &FileNameIN, std::deque< std::string > &vline) |
size_t | aurostd::compressfile2vectorstring (const std::string &FileNameIN, std::vector< std::string > &vline, bool consecutive=false, bool trim_edges=false) |
size_t | aurostd::compressfile2vectorstring (const std::string &FileNameIN, std::deque< std::string > &vline) |
void | aurostd::file2stringstream (const std::string &FileNameIN, std::stringstream &StringstreamIN) |
void | aurostd::compressfile2stringstream (const std::string &file_raw, std::stringstream &content) |
bool | aurostd::string2file (const std::string &StringOUTPUT, const std::string &FileNameRawOUTPUT, compression_type ct=None, const std::string &mode="") |
bool | aurostd::string2compressfile (const std::string &content, const std::string &file_raw, compression_type ct=XZ) |
bool | aurostd::stringstream2file (const std::stringstream &StringstreamOUTPUT, const std::string &FileNameOUTPUT, compression_type ct=None, const std::string &mode="") |
bool | aurostd::stringstream2compressfile (const std::stringstream &content, const std::string &file, compression_type ct=XZ) |
template<template< class... > class vtype> | |
bool | aurostd::vectorstring2file (const vtype< std::string > &vline, const std::string &FileNameOUT, compression_type ct=None) |
void | aurostd::CompressInit (archive *a, const compression_type ct, const bool single) |
initialize compression | |
void | aurostd::DecompressFile (const std::string &file_raw, const std::string &outfile_raw="", bool keep=false) |
void | aurostd::DecompressFile (const std::string &file_raw, bool keep) |
void | aurostd::DecompressFiles (const std::string &archive_file, const std::string &directory="", bool keep=false) |
void | aurostd::DecompressFiles (const std::string &archive_file, bool keep) |
void | aurostd::CompressFile (const std::string &file_raw, compression_type ct=XZ, bool keep=false) |
fs::path | aurostd::CompressFiles (const std::vector< std::string > &files, const fs::path &relative_to_path, const std::string &archive_name, compression_type ct=XZ, bool keep=false) |
bool | aurostd::MatchCompressed (const std::string &CompressedFileName, const std::string &FileNameOUT) |
bool | aurostd::compressfile2tempfile (const std::string &FileNameIN, std::string &FileNameOUT) |
bool | aurostd::compressfile2tempfile (const std::string &FileNameRawIN, std::string &FileNameOUT, bool &tempfile_created) |
void | aurostd::compressfile2compressfile (const std::string &file, compression_type ct, bool keep=false) |
void | aurostd::compressfiles2compressfiles (const std::string &directory, compression_type ct, bool keep=false) |
aurostd::JSON::object | aurostd::EmbData::get_unit_test () |
return data for unittests | |
std::string | aurostd::EmbData::get_test_file (std::string file) |
std::string | aurostd::EmbData::get_content (const std::string &filename, const std::string &collection) |
get the content of an embedded file | |
void | aurostd::EmbData::save_to_file (const std::string &filename, const std::string &collection, const std::string &target_path) |
write a embedded file into the filesystem | |
void | aurostd::EmbData::save_to_folder (const std::string &path, const std::string &collection, const std::string &target_path) |
write a embedded file into the filesystem | |
Variables | |
const std::vector< std::string > | aurostd::compression_suffix = {"", ".xz", ".zip", ".bz2", ".gz", ".zst"} |