| 42 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // |
| 43 | |
| 44 | bool Foam::fileFormats::NASedgeFormat::read |
| 45 | ( |
| 46 | const fileName& filename |
| 47 | ) |
| 48 | { |
| 49 | clear(); |
| 50 | |
| 51 | IFstream is(filename); |
| 52 | if (!is.good()) |
| 53 | { |
| 54 | FatalErrorInFunction |
| 55 | << "Cannot read file " << filename |
| 56 | << exit(FatalError); |
| 57 | } |
| 58 | |
| 59 | DynamicList<point> dynPoints; |
| 60 | DynamicList<edge> dynEdges; |
| 61 | DynamicList<label> pointId; // Nastran index of points |
| 62 | |
| 63 | while (is.good()) |
| 64 | { |
| 65 | string line; |
| 66 | is.getLine(line); |
| 67 | |
| 68 | // Skip empty or comment |
| 69 | if (line.empty() || line[0] == '$') |
| 70 | { |
| 71 | continue; |
| 72 | } |
| 73 | |
| 74 | // Check if character 72 is continuation |
| 75 | if (line.size() > 72 && line[72] == '+') |
| 76 | { |
| 77 | line = line.substr(0, 72); |
| 78 | |
| 79 | while (true) |
| 80 | { |
| 81 | string buf; |
| 82 | is.getLine(buf); |
| 83 | |
| 84 | if (buf.size() > 72 && buf[72] == '+') |
| 85 | { |
| 86 | line += buf.substr(8, 64); |
| 87 | } |
| 88 | else |
| 89 | { |
| 90 | line += buf.substr(8, buf.size()-8); |
| 91 | break; |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | |
| 97 | // Read first word |
| 98 | IStringStream lineStream(line); |
| 99 | word cmd; |
| 100 | lineStream >> cmd; |
| 101 |
no test coverage detected