The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
replay_recorder_base.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <cassert>
3 #include <boost/ptr_container/ptr_vector.hpp>
4 
5 #include "config.hpp"
6 
7 class config_writer;
9 {
10 public:
13 
14  void swap(replay_recorder_base& other);
15  int get_pos() const;
16 
17  int size() const;
18 
20 
21  config& add_child();
22 
24 
25  void remove_command(int index);
26 
27  config& insert_command(int index);
28 
29  void set_to_end();
30 
31  void set_pos(int pos);
32 
33  void append_config(const config& data);
34  /// Clears the passed config.
35  void append_config(config& data);
36 
37  void write(config_writer& out) const;
38 
39  void write(config& out) const;
40 
42 protected:
44  boost::ptr_vector<config> commands_;
45  int pos_;
46 };
int pos
Definition: formula.cpp:800
config & insert_command(int index)
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definition: glew.h:1347
Definitions for the interface to Wesnoth Markup Language (WML).
boost::ptr_vector< config > commands_
void remove_command(int index)
Class for writing a config out to a file in pieces.
void write(config_writer &out) const
config & get_command_at(int pos)
GLuint index
Definition: glew.h:1782
void append_config(const config &data)
void swap(replay_recorder_base &other)
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83