Simpact Cyan
Population based event driven simulation using mNRM
util.h
1 #ifndef UTIL_H
2 
3 #define UTIL_H
4 
5 #include <stdio.h>
6 #include <string>
7 #include <vector>
8 
9 //long double GetSystemTime();
10 bool ReadInputLine(FILE *fi, std::string &line);
11 void SplitLine(const std::string &line, std::vector<std::string> &args, const std::string &separatorChars = " \t",
12  const std::string &quoteChars = "\"'", const std::string &commentStartChars = "#",
13  bool ignoreZeroLengthFields = true);
14 
15 std::string createFullPath(const std::string &dir, const std::string &file);
16 
17 void abortWithMessage(const std::string &msg);
18 
19 bool parseAsInt(const std::string &str, int &number);
20 bool parseAsDouble(const std::string &str, double &number);
21 std::string doubleToString(double x);
22 
23 std::string trim(const std::string &str, const std::string &trimChars = " \t\r\n");
24 std::string replace(const std::string &input, const std::string &target, const std::string &replacement);
25 
26 #endif // UTIL_H
27