Use a CDATA section for preferences in replays
This commit is contained in:
@@ -206,7 +206,7 @@ bool sync_prefs() {
|
||||
prefs_recording << std::endl;
|
||||
}
|
||||
}
|
||||
record_action("load_prefs", prefs_recording.str());
|
||||
record_action("load_prefs", prefs_recording.str(), true);
|
||||
prefsLoaded = true;
|
||||
}else if(replaying && !prefsLoaded){
|
||||
replayUserDefaults = [[NSUserDefaults alloc] init];
|
||||
|
@@ -150,7 +150,7 @@ static bool load_prefs(std::istream& in) {
|
||||
prefs.swap(temp_prefs);
|
||||
|
||||
if (recording) {
|
||||
record_action("load_prefs", prefs_recording.str());
|
||||
record_action("load_prefs", prefs_recording.str(), true);
|
||||
}
|
||||
|
||||
return prefsLoaded = true;
|
||||
|
@@ -60,10 +60,11 @@ bool init_action_log(std::string command, std::string file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void record_action(std::string action_type, std::string inner_text) {
|
||||
void record_action(std::string action_type, std::string inner_text, bool cdata) {
|
||||
Element* root = log_document.FirstChildElement();
|
||||
Element next_action(action_type);
|
||||
Text action_text(inner_text);
|
||||
action_text.SetCDATA(cdata);
|
||||
next_action.InsertEndChild(action_text);
|
||||
root->InsertEndChild(next_action);
|
||||
log_document.SaveFile(log_file);
|
||||
@@ -151,4 +152,4 @@ short short_from_action(Element& action) {
|
||||
std::istringstream sstr(action.GetText());
|
||||
sstr >> s;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ extern bool recording;
|
||||
extern bool replaying;
|
||||
|
||||
extern bool init_action_log(std::string command, std::string file);
|
||||
extern void record_action(std::string action_type, std::string inner_text);
|
||||
extern void record_action(std::string action_type, std::string inner_text, bool cdata = false);
|
||||
extern void record_action(std::string action_type, std::map<std::string,std::string> info);
|
||||
extern bool has_next_action();
|
||||
extern std::string next_action_type();
|
||||
|
Reference in New Issue
Block a user