2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef HEADER_SUPERTUX_LISP_WRITER_HPP
18 #define HEADER_SUPERTUX_LISP_WRITER_HPP
28 Writer(const std::string& filename);
29 Writer(std::ostream* out);
32 void write_comment(const std::string& comment);
34 void start_list(const std::string& listname, bool string = false);
36 void write(const std::string& name, int value);
37 void write(const std::string& name, float value);
38 void write(const std::string& name, const std::string& value,
39 bool translatable = false);
40 void write(const std::string& name, const char* value,
41 bool translatable = false) { write(name, static_cast<const std::string&>(value), translatable); }
42 void write(const std::string& name, bool value);
43 void write(const std::string& name, const std::vector<int>& value);
44 void write(const std::string& name, const std::vector<unsigned int>& value);
45 void write(const std::string& name, const std::vector<float>& value);
46 void write(const std::string& name, const std::vector<std::string>& value);
47 // add more write-functions when needed...
49 void end_list(const std::string& listname);
52 void write_escaped_string(const std::string& str);
59 std::vector<std::string> lists;
62 Writer(const Writer&);
63 Writer & operator=(const Writer&);
68 #endif //SUPERTUX_LISPWRITER_H