| 389 | }; |
| 390 | |
| 391 | TEnumParser::TEnumParser(const TString& fileName) { |
| 392 | THolder<IInputStream> hIn; |
| 393 | IInputStream* in = nullptr; |
| 394 | if (fileName != "-") { |
| 395 | SourceFileName = fileName; |
| 396 | hIn.Reset(new TFileInput(fileName)); |
| 397 | in = hIn.Get(); |
| 398 | } else { |
| 399 | in = &Cin; |
| 400 | } |
| 401 | |
| 402 | TString contents = in->ReadAll(); |
| 403 | Parse(contents.data(), contents.size()); |
| 404 | } |
| 405 | |
| 406 | TEnumParser::TEnumParser(const char* data, size_t length) { |
| 407 | Parse(data, length); |