| 59 | } |
| 60 | |
| 61 | UINT YamlHelper::ParseFileHdr(const char* tag) |
| 62 | { |
| 63 | std::string scalar; |
| 64 | if (!GetScalar(scalar)) |
| 65 | throw std::runtime_error(SS_YAML_KEY_FILEHDR ": Failed to find scalar"); |
| 66 | |
| 67 | if (scalar != SS_YAML_KEY_FILEHDR) |
| 68 | throw std::runtime_error("Failed to find file header"); |
| 69 | |
| 70 | GetMapStartEvent(); |
| 71 | |
| 72 | YamlLoadHelper yamlLoadHelper(*this); |
| 73 | |
| 74 | // |
| 75 | |
| 76 | std::string value = yamlLoadHelper.LoadString(SS_YAML_KEY_TAG); |
| 77 | if (value != tag) |
| 78 | { |
| 79 | //printf("%s: Bad tag (%s) - expected %s\n", SS_YAML_KEY_FILEHDR, value.c_str(), tag); |
| 80 | throw std::runtime_error(SS_YAML_KEY_FILEHDR ": Bad tag"); |
| 81 | } |
| 82 | |
| 83 | return yamlLoadHelper.LoadUint(SS_YAML_KEY_VERSION); |
| 84 | } |
| 85 | |
| 86 | void YamlHelper::GetNextEvent(void) |
| 87 | { |
no test coverage detected