| 176 | }; |
| 177 | |
| 178 | static inline std::string toSourceString(const char* filePath, const int line) { |
| 179 | using namespace std; |
| 180 | stringstream s; |
| 181 | string file(filePath); |
| 182 | string::size_type pos = file.find_last_of("/\\"); |
| 183 | if (pos == string::npos) { |
| 184 | s << file; |
| 185 | } else { |
| 186 | s << file.substr(++pos); |
| 187 | } |
| 188 | s << ":" << line; |
| 189 | return s.str(); |
| 190 | } |
| 191 | |
| 192 | template<class T> |
| 193 | static int registerStep(const std::string& stepMatcher, const char* file, const int line) { |