MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / getBashPath

Method getBashPath

src/GameData.cpp:108–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108std::string GameData::getBashPath() const
109{
110 //a quick and dirty way to insert a backslash before most characters that would mess up a bash path
111 std::string path = mPath;
112
113 const char* invalidChars = " '\"\\!$^&*(){}[]?;<>";
114 for(unsigned int i = 0; i < path.length(); i++)
115 {
116 char c;
117 unsigned int charNum = 0;
118 do {
119 c = invalidChars[charNum];
120 if(path[i] == c)
121 {
122 path.insert(i, "\\");
123 i++;
124 break;
125 }
126 charNum++;
127 } while(c != '\0');
128 }
129
130 return path;
131}
132
133//returns the boost::filesystem stem of our path - e.g. for "/foo/bar.rom" returns "bar"
134std::string GameData::getBaseName() const

Callers 1

launchGameMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected