------------------------------------------------------------------------------ Internal function to read in a line up to 256 characters and then skip to the next line in the file.
| 124 | // Internal function to read in a line up to 256 characters and then |
| 125 | // skip to the next line in the file. |
| 126 | int vtkMNIObjectReader::ReadLine(char* line, unsigned int maxlen) |
| 127 | { |
| 128 | this->LineNumber++; |
| 129 | istream& infile = *this->InputStream; |
| 130 | |
| 131 | infile.getline(line, maxlen); |
| 132 | this->CharPointer = line; |
| 133 | |
| 134 | if (infile.fail()) |
| 135 | { |
| 136 | if (infile.eof()) |
| 137 | { |
| 138 | return 0; |
| 139 | } |
| 140 | if (infile.gcount() == 255) |
| 141 | { |
| 142 | // Read 256 chars; ignoring the rest of the line. |
| 143 | infile.clear(); |
| 144 | infile.ignore(VTK_INT_MAX, '\n'); |
| 145 | vtkWarningMacro( |
| 146 | "Overlength line (limit is 255) in " << this->FileName << ":" << this->LineNumber); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | return 1; |
| 151 | } |
| 152 | |
| 153 | //------------------------------------------------------------------------------ |
| 154 | // Skip all whitespace, reading additional lines if necessary |
no test coverage detected