31 commands_.swap(other.commands_);
33 upload_log_.swap(other.upload_log_);
61 assert(pos <=
size());
96 if(
const auto upload_log =
data.optional_child(
"upload_log"))
100 for(
const config& command :
data.child_range(
"command"))
108 if(
auto upload_log =
data.optional_child(
"upload_log"))
112 for(
config& command :
data.child_range(
"command"))
115 new_config->
swap(command);
146 auto other_commands = other_replay.
child_range(
"command");
147 if(other_commands.size() >
commands_.size()) {
Class for writing a config out to a file in pieces.
void write_child(const std::string &key, const config &cfg)
A config object defines a single node in a WML file, with access to child nodes.
config & add_child(std::string_view key)
child_itors child_range(std::string_view key)
void swap(config &cfg) noexcept
void write(config_writer &out) const
void append_config(const config &data)
void delete_upcoming_commands()
config & get_upload_log()
bool is_ancestor(const config &other_replay) const
checks whether the parameter is an earlier state in the same "savegame gamestate branch"
void swap(replay_recorder_base &other) noexcept
config & get_command_at(int pos)
config & insert_command(int index)
boost::ptr_vector< config > commands_
void remove_command(int index)
std::size_t index(std::string_view str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
void swap(replay_recorder_base &lhs, replay_recorder_base &rhs) noexcept
Implement non-member swap function for std::swap (calls replay_recorder_base::swap).