parse std::map of replay action info elements
This commit is contained in:
@@ -105,6 +105,16 @@ Element* pop_next_action(std::string expected_action_type) {
|
||||
return clone;
|
||||
}
|
||||
|
||||
std::map<std::string,std::string> info_from_action(Element* action) {
|
||||
std::map<std::string,std::string> info = {};
|
||||
Element* next_child = action->FirstChildElement(false);
|
||||
while(next_child){
|
||||
info[next_child->Value()] = next_child->GetText();
|
||||
next_child = next_child->NextSiblingElement(false);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
std::string encode_file(fs::path file) {
|
||||
std::ifstream ifs(file.string(), std::ios::binary|std::ios::ate);
|
||||
std::ifstream::pos_type pos = ifs.tellg();
|
||||
|
@@ -19,6 +19,7 @@ extern void record_action(std::string action_type, std::map<std::string,std::str
|
||||
extern bool has_next_action();
|
||||
extern std::string next_action_type();
|
||||
extern Element* pop_next_action(std::string expected_action_type="");
|
||||
extern std::map<std::string,std::string> info_from_action(Element* action);
|
||||
extern std::string encode_file(fs::path file);
|
||||
extern void decode_file(std::string data, fs::path file);
|
||||
|
||||
|
Reference in New Issue
Block a user