X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flisp%2Fwriter.hpp;h=a031ab7e8db0749a0acdf4b8ffc34e579667dc12;hb=b917bb4789b14d1bb1445b9777ab494e9623fd50;hp=40039dc39cfec269b9787a0f60597f83ecf78366;hpb=86181b0a14d89cf45daf97199c3556c4dd1ee7b7;p=supertux.git diff --git a/src/lisp/writer.hpp b/src/lisp/writer.hpp index 40039dc39..a031ab7e8 100644 --- a/src/lisp/writer.hpp +++ b/src/lisp/writer.hpp @@ -1,7 +1,7 @@ // $Id$ // -// SuperTux - A Jump'n Run -// Copyright (C) 2004 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -36,21 +36,25 @@ namespace lisp void write_comment(const std::string& comment); - void start_list(const std::string& listname); + void start_list(const std::string& listname, bool string = false); - void write_int(const std::string& name, int value); - void write_float(const std::string& name, float value); - void write_string(const std::string& name, const std::string& value, + void write(const std::string& name, int value); + void write(const std::string& name, float value); + void write(const std::string& name, const std::string& value, bool translatable = false); - void write_bool(const std::string& name, bool value); - void write_int_vector(const std::string& name, const std::vector& value); - void write_int_vector(const std::string& name, const std::vector& value); - void write_float_vector(const std::string& name, const std::vector& value); + void write(const std::string& name, const char* value, + bool translatable = false) { write(name, static_cast(value), translatable); } + void write(const std::string& name, bool value); + void write(const std::string& name, const std::vector& value); + void write(const std::string& name, const std::vector& value); + void write(const std::string& name, const std::vector& value); + void write(const std::string& name, const std::vector& value); // add more write-functions when needed... void end_list(const std::string& listname); private: + void write_escaped_string(const std::string& str); void indent(); std::ostream* out; @@ -58,8 +62,7 @@ namespace lisp int indent_depth; std::vector lists; }; - + } //namespace lisp #endif //SUPERTUX_LISPWRITER_H -