MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / cueTo

Function cueTo

src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.C:61–86  ·  view source on GitHub ↗

Read up to line starting with cmd. Sets args to rest of line. Returns true if found, false if stream is not good anymore.

Source from the content-addressed store, hash-verified

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.
61bool 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

Callers 2

Calls 1

goodMethod · 0.45

Tested by

no test coverage detected