MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / ParseFileHdr

Method ParseFileHdr

source/YamlHelper.cpp:61–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61UINT 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
86void YamlHelper::GetNextEvent(void)
87{

Callers 2

Snapshot_LoadState_v2Function · 0.80

Calls 2

LoadStringMethod · 0.80
LoadUintMethod · 0.80

Tested by

no test coverage detected