Reads a std::string from the file at specified offset Omits whitespace and comments
| 216 | // Omits whitespace and comments |
| 217 | // |
| 218 | void IfcSpfLexer::TokenString(size_t offset, std::string& buffer) { |
| 219 | buffer.clear(); |
| 220 | auto local_stream = *this->stream; |
| 221 | local_stream.seek(offset); |
| 222 | while (!local_stream.eof()) { |
| 223 | char character = local_stream.peek(); |
| 224 | if (!buffer.empty() && (character == '(' || |
| 225 | character == ')' || |
| 226 | character == '=' || |
| 227 | character == ',' || |
| 228 | character == ';' || |
| 229 | character == '/')) { |
| 230 | break; |
| 231 | } |
| 232 | local_stream.increment(); |
| 233 | if (character == ' ' || |
| 234 | character == '\r' || |
| 235 | character == '\n' || |
| 236 | character == '\t') { |
| 237 | continue; |
| 238 | } |
| 239 | if (character == '\'') { |
| 240 | // todo, make decoder use local offset ptr |
| 241 | auto offset = local_stream.tell(); |
| 242 | buffer = decoder_->get(offset); |
| 243 | break; |
| 244 | } |
| 245 | buffer.push_back(character); |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | //Note: according to STEP standard, there may be newlines in tokens |
| 250 | /* |