Astra Linux Directory Client Core API
1.7.0
|
#include <sys/stat.h>
#include <sys/capability.h>
#include <string>
#include <list>
#include <map>
#include <vector>
#include <cstdint>
#include <ctime>
Классы | |
class | ALD::CALDFormatCall |
class | ALD::CALDStaticHelper |
Пространства имен | |
ALD | |
Макросы | |
#define | FMTSTR CALDFormatCall(__FILE__, __FUNCTION__, __LINE__) |
#define | ALD_HOST_MAX_SIZE 255 |
Макросы работы с управляющими кодами терминала | |
#define | T_CMD(list) "\x1b[" list "m" |
#define | T_DFLT "\x1b[0;m" |
#define | T_NORM "0" |
#define | T_BOLD "1" |
#define | T_UNDE "4" |
#define | T_BLINK "5" |
#define | T_INVERT "7" |
#define | T_FBLACK "30" |
#define | T_FRED "31" |
#define | T_FGREEN "32" |
#define | T_FYELLOW "33" |
#define | T_FBLUE "34" |
#define | T_FMAGENTA "35" |
#define | T_FCYAN "36" |
#define | T_FWHITE "37" |
#define | T_BBLACK "30" |
#define | T_BRED "31" |
#define | T_BGREEN "32" |
#define | T_BYELLOW "33" |
#define | T_BBLUE "34" |
#define | T_BMAGENTA "35" |
#define | T_BCYAN "36" |
#define | T_BWHITE "37" |
Макросы работы с цветовым офрмлением терминала | |
#define | BRED t_cmd(T_BOLD ";" T_FRED) |
#define | BGREEN t_cmd(T_BOLD ";" T_FGREEN) |
#define | BYELLOW t_cmd(T_BOLD ";" T_FYELLOW) |
#define | BBLUE t_cmd(T_BOLD ";" T_FBLUE) |
#define | BMAGENTA t_cmd(T_BOLD ";" T_FMAGENTA) |
#define | BCYAN t_cmd(T_BOLD ";" T_FCYAN) |
#define | BWHITE t_cmd(T_BOLD ";" T_FWHITE) |
#define | RED t_cmd(T_FRED) |
#define | GREEN t_cmd(T_FGREEN) |
#define | YELLOW t_cmd(T_FYELLOW) |
#define | BLUE t_cmd(T_FBLUE) |
#define | MAGENTA t_cmd(T_FMAGENTA) |
#define | CYAN t_cmd(T_FCYAN) |
#define | WHITE t_cmd(T_FWHITE) |
#define | NORMAL t_dflt() |
#define | OUT_COLOR(out, msg, color) do{out << color; out << msg; out << NORMAL; out << endl;}while(0) |
#define | COUT_COLOR(msg, color) OUT_COLOR(cout, msg, color) |
#define | COUT_ERR(msg) COUT_COLOR(msg, BRED) |
#define | COUT_WARN(msg) COUT_COLOR(msg, YELLOW) |
#define | COUT_CHECK(msg) COUT_COLOR(msg, GREEN) |
#define | COUT_INFO(msg) COUT_COLOR(msg, CYAN) |
#define | COUT_TEST(msg) COUT_COLOR(msg, MAGENTA) |
Макросы поддержки форматирования тестов целостности | |
#define | TI_ITEM_INFO(info) {if(bVerbose){TestIntegrityItem(info);}} |
#define | TI_SECTION_INFO(info) TestIntegritySection(info, bVerbose) |
#define | TI_OK {if(bVerbose){TestIntegrityOK();}} |
#define | TI_ERROR {if(bVerbose){TestIntegrityERROR();}} |
#define | TI_WARNING {if(bVerbose){TestIntegrityWARNING();}} |
#define | TI_FIXED {if(bVerbose){TestIntegrityFIXED();}} |
#define | TI_ITEM_RES(res) {if(res) TI_OK else TI_ERROR;} |
#define | TI_SECTION_RES(res) {if(!bVerbose) { cout << t_cmd(T_BOLD); res? TestIntegrityOK(): TestIntegrityERROR();}} |
#define | TI_ADD_ERRINFO(info, errlist) errlist.push_back(YELLOW+std::string(info)+NORMAL); |
Определения типов | |
typedef list< string > | ALD::ald_string_list |
typedef list< int > | ALD::ald_int_list |
typedef vector< string > | ALD::ald_string_vector |
typedef vector< int > | ALD::ald_int_vector |
typedef pair< string, string > | ALD::ald_string_pair |
typedef map< string, string > | ALD::ald_string_map |
typedef multimap< string, string > | ALD::ald_string_multimap |
Функции | |
void | ALD::UseTermColors (bool colored) |
bool | ALD::IsTermColored () |
string | ALD::t_cmd (const char *cmd) |
string | ALD::t_dflt () |
const char * | ALD::ExtractFileName (const char *pszFileName) |
const char * | ALD::ExtractFuncName (const char *pszFuncName) |
bool | ALD::ParsePair (const string &line, string &name, string &value) |
string | ALD::CurrentUser () |
string | ALD::DefaultCodeset () |
string | ALD::HostName (const string &host) |
string | ALD::TildeSubst (const string &file) |
string | ALD::HostDomain (const string &host) |
string | ALD::PFM2Name (const string &PFM) |
Функции преобразования строк и целых | |
bool | ALD::str2i (const string &str, int &val) |
string | ALD::i2str (int val) |
bool | ALD::str2u (const string &str, unsigned int &val) |
string | ALD::u2str (unsigned int val) |
bool | ALD::hex2u (const string &str, unsigned int &val) |
string | ALD::u2hex (unsigned int val) |
bool | ALD::oct2u (const string &str, unsigned int &val) |
string | ALD::u2oct (unsigned int val) |
bool | ALD::strTou64 (const string &str, uint64_t &val) |
string | ALD::u64Tostr (uint64_t val) |
Функции преобразования строк и типов времени | |
string | ALD::TimeToStr (time_t t, bool rfc2822) |
time_t | ALD::StrToTime (const string &strdt, bool rfc2822) |
time_t | ALD::GeneralizedTimeToTime (const string >) |
string | ALD::GeneralizedTimeToStr (const string >, bool rfc2822) |
string | ALD::TimeToGeneralizedTime (time_t t) |
Функции работы со строками | |
string | ALD::TrimLeft (const string &str) |
string | ALD::TrimRight (const string &str) |
string | ALD::Trim (const string &str) |
string | ALD::Unquote (const string &str) |
string | ALD::Quote (const string &str, bool force=false) |
string | ALD::Capitallize (const string &str) |
string | ALD::string2upper (const string &str) |
string | ALD::string2lower (const string &str) |
string & | ALD::StrAppend (string &str1, const string &str2) |
char * | ALD::strdup (const char *str) |
char * | ALD::strdup (const string &str) |
Функции преобразования имен доменов | |
string | ALD::DomainToDn (const string &domain) |
string | ALD::DomainToRealm (const string &domain) |
string | ALD::RemoveRealm (const string &str) |
string | ALD::DnToDomain (const string &dn) |
string | ALD::RealmToDomain (const string &realm) |
string | ALD::RemoveDomain (const string &str, const string &domain) |
Функции запроса ответа у пользователя | |
string | ALD::AskPassword (const string &prompt, size_t size, char star) |
string | ALD::AskText (const string &prompt, size_t size) |
string | ALD::AskTextDef (const string &prompt, const string &defText, size_t size) |
bool | ALD::AskYesNo (const string &prompt, bool defYes) |
unsigned int | ALD::AskNumber (const string &prompt, unsigned int defVal) |
Функции работы со списками строк | |
void | ALD::list_merge (ald_string_list &al1, const ald_string_list &al2) |
void | ALD::list_subtract (ald_string_list &al1, const ald_string_list &al2) |
void | ALD::list_intersect (ald_string_list &al1, const ald_string_list &al2) |
bool | ALD::IsMemberOfList (const ald_string_list &list, const string &str) |
string | ALD::listToStr (const ald_string_list &list) |
void | ALD::StrTolist (const string &str, ald_string_list &list, char delim= ',') |
Функции работы с путями и файлами | |
bool | ALD::IsFileExist (const string &path) |
bool | ALD::IsDirExist (const string &path) |
bool | ALD::IsPathExist (const string &path) |
void | ALD::RemoveDir (const string &path, bool force) |
void | ALD::RemoveFile (const string &path) |
void | ALD::RemovePath (const string &path, bool force) |
void | ALD::RemoveFiles (const string &path, const string &pattern) |
void | ALD::CreateDir (const string &path, mode_t mode) |
void | ALD::EnsureDir (const string &path, mode_t mode) |
void | ALD::Chown (const string &path, uid_t uid, gid_t gid, bool rec=false) |
void | ALD::Chown (const string &path, const string &ouser, const string &ogroup, bool rec=false) |
void | ALD::Chmod (const string &path, mode_t mode, bool rec=false) |
bool | ALD::IsDirectory (const string &path) |
bool | ALD::IsFile (const string &path) |
void | ALD::RenameFile (const string &file, const string &targetFile) |
void | ALD::CopyFile (const string &file, const string &targetFile) |
void | ALD::CopyPath (const string &path, const string &targetPath, mode_t mode) |
void | ALD::CreateFile (const string &file) |
string | ALD::GetFileName (const string &file) |
string | ALD::GetFilePath (const string &file) |
string | ALD::GetFileExt (const string &file) |
Функции работы со сжатием файлов | |
void | ALD::GZipFile (const string &file, const string &targetFile) |
void | ALD::GunZipFile (const string &file, const string &targetFile) |
void | ALD::TarCreate (const ald_string_list &files, const string &targetFile, int mode) |
void | ALD::TarExtract (const string &file, const string &targetPath, int mode) |
void | ALD::Pack (const ald_string_list &files, const string &targetFile, int mode) |
void | ALD::Unpack (const string &file, const string &targetPath, int mode) |
Функции поддержки форматирования тестов целостности | |
void | ALD::TestIntegrityItem (const string &info) |
void | ALD::TestIntegritySection (const string &info, bool verb) |
void | ALD::TestIntegrityOK () |
void | ALD::TestIntegrityERROR () |
void | ALD::TestIntegrityWARNING () |
void | ALD::TestIntegrityFIXED () |
Объявление вспомогательных типов и функций общего назначения