PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
string_system.h
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #ifndef __PLIB_SYSTEM_H__
8 #define __PLIB_SYSTEM_H__
9 
10 #include <sys/stat.h>
11 #include <sys/types.h>
12 #include "string_function.h"
13 
14 bool isStringMatchRegex(const std::string & str, const std::string & expression);
15 void getListFileInCurrentDir(std::list<std::string> & listFile, const std::string & expr);
16 bool getListFileInDir(std::list<std::string> & listFile, const std::string & dirName, const std::string & expr);
17 bool getListAllFileInDir(std::list<std::string> & listFile, const std::string & dirName);
18 void makeListArgument(std::list<std::string> & listArgument, int argc, char** argv);
19 std::string phoenix_getenv(const std::string & varName);
20 bool phoenix_setenv(const std::string & name, const std::string & value, int overwrite = 1);
21 bool phoenix_unsetenv(const std::string & name);
22 std::string getHomeDir();
23 bool createDirIfNotExist(const std::string & directoryName);
24 
25 time_t getFileModificationTime(const std::string & fileName);
26 time_t getFileInDirPerTime(std::vector<std::string> & vecFile, const std::string & dirName, time_t mostRecentTime = 0lu);
27 
28 std::string getProgramLocation();
29 std::string getProgramDirectory();
30 std::string getProgramPrefix();
31 
32 std::string phoenix_popen(const std::string & command);
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);
36 
37 std::string getCurrentNodeName();
38 void phoenix_find(std::vector<std::string> & vecFile, const std::string & path);
39 std::vector<std::string> phoenix_find(const std::string & path);
40 
41 time_t phoenix_getClock();
42 double phoenix_getClockSec();
43 time_t phoenix_getTime();
44 std::string phoenix_getDate();
45 std::string phoenix_getDateCompact();
46 
47 #endif
getListFileInCurrentDir
void getListFileInCurrentDir(std::list< std::string > &listFile, const std::string &expr)
Function like a ls in shell.
Definition: string_system.cpp:126
getListAllFileInDir
bool getListAllFileInDir(std::list< std::string > &listFile, const std::string &dirName)
Get the list of files in a directory.
Definition: string_system.cpp:171
phoenix_chmod
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.
Definition: string_system.cpp:395
phoenix_getTime
time_t phoenix_getTime()
Get the current time of the program.
Definition: string_system.cpp:445
getFileModificationTime
time_t getFileModificationTime(const std::string &fileName)
Get the last modification time of the given file.
Definition: string_system.cpp:255
getHomeDir
std::string getHomeDir()
Gets the $HOME directory.
Definition: string_system.cpp:234
isStringMatchRegex
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.
Definition: string_system.cpp:94
getProgramDirectory
std::string getProgramDirectory()
Get the program directory.
Definition: string_system.cpp:317
getListFileInDir
bool getListFileInDir(std::list< std::string > &listFile, const std::string &dirName, const std::string &expr)
Get the list of files in a directory.
Definition: string_system.cpp:150
getCurrentNodeName
std::string getCurrentNodeName()
Get the name of the current node on which the program is running.
Definition: string_system.cpp:406
makeListArgument
void makeListArgument(std::list< std::string > &listArgument, int argc, char **argv)
Makes the argument list of a program.
Definition: string_system.cpp:193
phoenix_getenv
std::string phoenix_getenv(const std::string &varName)
Get the value of the given environment variable.
Definition: string_system.cpp:204
getFileInDirPerTime
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.
Definition: string_system.cpp:274
phoenix_getClockSec
double phoenix_getClockSec()
Get current time.
Definition: string_system.cpp:438
phoenix_setenv
bool phoenix_setenv(const std::string &name, const std::string &value, int overwrite=1)
Set a environment variable.
Definition: string_system.cpp:219
string_function.h
createReleaseCurl.str
str
Definition: createReleaseCurl.py:128
createDirIfNotExist
bool createDirIfNotExist(const std::string &directoryName)
Creates a directory if it does not exist.
Definition: string_system.cpp:242
phoenix_unsetenv
bool phoenix_unsetenv(const std::string &name)
Unset a environment variable.
Definition: string_system.cpp:227
phoenix_getDateCompact
std::string phoenix_getDateCompact()
Get the current date.
Definition: string_system.cpp:463
getProgramPrefix
std::string getProgramPrefix()
Get the program prefix (installation directory without /bin)
Definition: string_system.cpp:333
phoenix_getClock
time_t phoenix_getClock()
Get current time.
Definition: string_system.cpp:431
phoenix_find
void phoenix_find(std::vector< std::string > &vecFile, const std::string &path)
Find all files which matches the path expression (example : /path/*.cpp)
Definition: string_system.cpp:414
phoenix_getDate
std::string phoenix_getDate()
Get the current date.
Definition: string_system.cpp:452
phoenix_popen
std::string phoenix_popen(const std::string &command)
Execute the given command and returns the output of this command.
Definition: string_system.cpp:341
getProgramLocation
std::string getProgramLocation()
Get the program location.
Definition: string_system.cpp:296