Read up to line starting with cmd. Sets args to rest of line. Returns true if found, false if stream is not good anymore.
| 59 | // Read up to line starting with cmd. Sets args to rest of line. |
| 60 | // Returns true if found, false if stream is not good anymore. |
| 61 | bool Foam::fileFormats::AC3DsurfaceFormatCore::cueTo |
| 62 | ( |
| 63 | IFstream& is, |
| 64 | const string& cmd, |
| 65 | string& args |
| 66 | ) |
| 67 | { |
| 68 | while (is.good()) |
| 69 | { |
| 70 | string line; |
| 71 | is.getLine(line); |
| 72 | |
| 73 | string::size_type space = line.find(' '); |
| 74 | |
| 75 | if (space != string::npos) |
| 76 | { |
| 77 | if (line.substr(0, space) == cmd) |
| 78 | { |
| 79 | args = line.substr(space+1); |
| 80 | |
| 81 | return true; |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | return false; |
| 86 | } |
| 87 | |
| 88 | |
| 89 | // Similar to cueTo(), but throws error if cmd not found |
no test coverage detected