| 106 | } |
| 107 | |
| 108 | std::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" |
| 134 | std::string GameData::getBaseName() const |