13 std::vector<std::string>&
split(
const std::string &
string,
char delimiter, std::vector<std::string> &elements){
14 std::stringstream stringStream(
string);
17 while(std::getline(stringStream, item, delimiter)){
18 std::stringstream trimmer;
21 elements.push_back(item);
26 std::string&
replaceAll(std::string &
string, std::string toFind, std::string replacement){
27 size_t pos =
string.find(toFind);
28 while(pos!=std::string::npos){
29 string.replace(pos,toFind.length(),replacement);
30 pos =
string.find(toFind);
35 void addPath(cPar ¶meter, std::string &pathToAdd){
36 std::string path = parameter.stdstringValue();
39 path.append(pathToAdd);
40 parameter.setStringValue(path);
44 std::size_t pos = path.rfind(
'.');
45 if(pos!=std::string::npos){
46 std::string modulePath = path.substr(0,pos);
47 std::string gateName = path.substr(pos+1);
48 cModule* module = cSimulation::getActiveSimulation()->getModuleByPath(modulePath.c_str());
50 return module->gate(gateName.c_str());
61 return ((seconds.raw() * 0x10000) / pow10(SIMTIME_NS-seconds.getScaleExp()));