we know the input string will be in the form :static const char* kernelname = \"
| 303 | |
| 304 | //we know the input string will be in the form :static const char* kernelname = \" |
| 305 | string FindKernelNameFromString(string inputLine) |
| 306 | { |
| 307 | string result; |
| 308 | size_t pos = inputLine.find( '*' ); |
| 309 | |
| 310 | size_t StartKernelName = 1+pos; |
| 311 | char space = inputLine[StartKernelName]; |
| 312 | while(space==' ') |
| 313 | { |
| 314 | StartKernelName++; |
| 315 | space = inputLine[StartKernelName]; |
| 316 | } |
| 317 | |
| 318 | size_t endKernelName = StartKernelName+1; |
| 319 | space = inputLine[endKernelName]; |
| 320 | while(space!=' ') |
| 321 | { |
| 322 | endKernelName++; |
| 323 | space = inputLine[endKernelName]; |
| 324 | } |
| 325 | result = inputLine.substr(StartKernelName,endKernelName-StartKernelName ); |
| 326 | return result; |
| 327 | } |
| 328 | |
| 329 | |
| 330 | int main( int argc, char *argv[] ) |