Reworked Logging class.
Added Populations for individual Species.
This commit is contained in:
@@ -166,4 +166,44 @@ inline std::string getHomebase() {
|
||||
inline std::string getDataPath() {
|
||||
return (getHomebase() + "src/mc_electron/data/");
|
||||
}
|
||||
|
||||
|
||||
inline std::string remove_catEnding (std::string inString) {
|
||||
if ( inString.substr(inString.size()-4, 4) == ".cat" ){
|
||||
return (inString.substr(0, inString.size()-4) );
|
||||
} else {
|
||||
return (inString);
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string getparName() {
|
||||
string parpath = getenv("parpath");
|
||||
string parfile = remove_catEnding(getenv("parfile"));
|
||||
return (parpath + "/" + parfile);
|
||||
}
|
||||
|
||||
inline bool isFile(std::string fileName) {
|
||||
struct stat buffer;
|
||||
return (stat (fileName.c_str(), &buffer) == 0);
|
||||
}
|
||||
|
||||
inline bool isDir(std::string dirPath) {
|
||||
struct stat info;
|
||||
if( stat( dirPath.c_str(), &info ) != 0 )
|
||||
return (false);
|
||||
else if( info.st_mode & S_IFDIR ) // S_ISDIR() doesn't exist on my windows
|
||||
return (true);
|
||||
else
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* read_system_h */
|
||||
|
||||
Reference in New Issue
Block a user