You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
919 B
34 lines
919 B
#ifndef UTIL_H
|
|
#define UTIL_H
|
|
#include "project_lib.h"
|
|
|
|
using namespace std;
|
|
|
|
namespace Utils {
|
|
#define file_source_login_min_max "/etc/login.defs"
|
|
template<typename Type>
|
|
struct Result{
|
|
Type response;
|
|
int error;
|
|
};
|
|
|
|
struct Passwd {
|
|
string user;
|
|
int uid;
|
|
};
|
|
|
|
string format_str_size(int num, int index);
|
|
std::array<std::vector<std::string>, 5> read_csv(const std::string& filename);
|
|
std::string call(std::string cmd);
|
|
vector<int> find_all(string &str_ntp, string substr);
|
|
void str_remove(std::string& source, std::string to_remove);
|
|
void str_replace_all(string &str_base, string str_find, string str_replace);
|
|
std::vector<std::string> split(std::string text, char delim);
|
|
vector <string> pars_users();
|
|
int synopsis_show(string str_link);
|
|
string file_read(string filename);
|
|
unsigned short read_uid_min_max(string filename, string search);
|
|
vector<string> pars_users();
|
|
vector<string> pars_group();
|
|
}
|
|
#endif |