 |
PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
|
Go to the documentation of this file.
7 #ifndef __PLIB_SYSTEM_H__
8 #define __PLIB_SYSTEM_H__
11 #include <sys/types.h>
16 bool getListFileInDir(std::list<std::string> & listFile,
const std::string & dirName,
const std::string & expr);
18 void makeListArgument(std::list<std::string> & listArgument,
int argc,
char** argv);
20 bool phoenix_setenv(
const std::string & name,
const std::string & value,
int overwrite = 1);
26 time_t
getFileInDirPerTime(std::vector<std::string> & vecFile,
const std::string & dirName, time_t mostRecentTime = 0lu);
33 int phoenix_popen(std::string & executionLog,
const std::string & command);
34 bool phoenix_popen(
const std::string & executionLogFile,
const std::string & command,
bool onlyLogOnFail);
35 bool phoenix_chmod(
const std::string & fileName, mode_t __mode = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
38 void phoenix_find(std::vector<std::string> & vecFile,
const std::string & path);
39 std::vector<std::string>
phoenix_find(
const std::string & path);
void getListFileInCurrentDir(std::list< std::string > &listFile, const std::string &expr)
Function like a ls in shell.
bool getListAllFileInDir(std::list< std::string > &listFile, const std::string &dirName)
Get the list of files in a directory.
bool phoenix_chmod(const std::string &fileName, mode_t __mode=S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH)
Change the mode of a file or directory.
time_t phoenix_getTime()
Get the current time of the program.
time_t getFileModificationTime(const std::string &fileName)
Get the last modification time of the given file.
std::string getHomeDir()
Gets the $HOME directory.
bool isStringMatchRegex(const std::string &str, const std::string &expression)
Fonction qui dit si une chaine de caractère correspond à une expression régulière de regex.
std::string getProgramDirectory()
Get the program directory.
bool getListFileInDir(std::list< std::string > &listFile, const std::string &dirName, const std::string &expr)
Get the list of files in a directory.
std::string getCurrentNodeName()
Get the name of the current node on which the program is running.
void makeListArgument(std::list< std::string > &listArgument, int argc, char **argv)
Makes the argument list of a program.
std::string phoenix_getenv(const std::string &varName)
Get the value of the given environment variable.
time_t getFileInDirPerTime(std::vector< std::string > &vecFile, const std::string &dirName, time_t mostRecentTime=0lu)
Get the list of most recent files in a directory.
double phoenix_getClockSec()
Get current time.
bool phoenix_setenv(const std::string &name, const std::string &value, int overwrite=1)
Set a environment variable.
bool createDirIfNotExist(const std::string &directoryName)
Creates a directory if it does not exist.
bool phoenix_unsetenv(const std::string &name)
Unset a environment variable.
std::string phoenix_getDateCompact()
Get the current date.
std::string getProgramPrefix()
Get the program prefix (installation directory without /bin)
time_t phoenix_getClock()
Get current time.
void phoenix_find(std::vector< std::string > &vecFile, const std::string &path)
Find all files which matches the path expression (example : /path/*.cpp)
std::string phoenix_getDate()
Get the current date.
std::string phoenix_popen(const std::string &command)
Execute the given command and returns the output of this command.
std::string getProgramLocation()
Get the program location.