21 static void ReadLcf(std::vector<RPG::MoveCommand>& ref,
LcfReader& stream, uint32_t length);
22 static void WriteLcf(
const std::vector<RPG::MoveCommand>& ref,
LcfWriter& stream);
23 static int LcfSize(
const std::vector<RPG::MoveCommand>& ref,
LcfWriter& stream);
24 static void WriteXml(
const std::vector<RPG::MoveCommand>& ref,
XmlWriter& stream);
134 ref(ref), field(NULL), parameter_string(false) {}
136 if (strcmp(name,
"command_id") == 0)
138 else if (strcmp(name,
"parameter_a") == 0)
140 else if (strcmp(name,
"parameter_b") == 0)
142 else if (strcmp(name,
"parameter_c") == 0)
144 else if (strcmp(name,
"parameter_string") == 0)
145 parameter_string =
true;
147 stream.
Error(
"Unrecognized field '%s'", name);
149 parameter_string =
false;
154 parameter_string =
false;
159 else if (parameter_string)
172 unsigned long startpos = stream.
Tell();
173 unsigned long endpos = startpos + length;
177 ref.push_back(command);
178 }
while (stream.
Tell() != endpos);
182 std::vector<RPG::MoveCommand>::const_iterator it;
183 for (it = ref.begin(); it != ref.end(); it++)
189 std::vector<RPG::MoveCommand>::const_iterator it;
190 for (it = ref.begin(); it != ref.end(); it++)
196 std::vector<RPG::MoveCommand>::const_iterator it;
197 for (it = ref.begin(); it != ref.end(); it++)
206 if (strcmp(name,
"MoveCommand") != 0)
207 stream.
Error(
"Expecting %s but got %s",
"MoveCommand", name);
208 ref.resize(
ref.size() + 1);
213 std::vector<RPG::MoveCommand>&
ref;
MoveCommandXmlHandler(RPG::MoveCommand &ref)
void StartElement(XmlReader &stream, const char *name, const char **)
void SetHandler(XmlHandler *handler)
void BeginElement(const std::string &name)
std::string Decode(const std::string &str_to_encode)
void Read(void *ptr, size_t size, size_t nmemb)
void EndElement(const std::string &name)
static void ReadLcf(T &ref, LcfReader &stream, uint32_t length)
void Error(const char *fmt,...)
void Write(const void *ptr, size_t size, size_t nmemb)
void ReadString(std::string &ref, size_t size)
MoveCommandVectorXmlHandler(std::vector< RPG::MoveCommand > &ref)
std::string parameter_string
static void WriteLcf(const T &ref, LcfWriter &stream)
static int LcfSize(const T &ref, LcfWriter &stream)
void StartElement(XmlReader &stream, const char *name, const char **)
static int IntSize(unsigned int x)
static void BeginXml(T &ref, XmlReader &stream)
void CharacterData(XmlReader &, const std::string &data)
static void WriteXml(const T &ref, XmlWriter &stream)
void EndElement(XmlReader &, const char *)
void WriteNode(const std::string &name, const T &val)
std::vector< RPG::MoveCommand > & ref