4 // Copyright (C) 2007 Christoph Sommer <christoph.sommer@2007.expires.deltadevelopment.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 #include "lisp/parser.hpp"
27 #include "lisp/lisp.hpp"
28 #include "lisp/writer.hpp"
32 #include "addon/addon_manager.hpp"
35 * Represents an (available or installed) Add-on, e.g. a level set
45 std::string suggested_filename; /**< filename suggested by addon author, e.g. "pak0.zip" */
46 std::string installed_physfs_filename; /**< PhysFS filename on disk, e.g. "pak0.zip" */
47 std::string installed_absolute_filename; /**< complete path and filename on disk, e.g. "/home/sommer/.supertux2/pak0.zip" */
48 std::string stored_md5;
53 * Get MD5, based either on installed file's contents or stored value
55 std::string get_md5() const;
58 * Read additional information from given contents of a (supertux-addoninfo ...) block
60 void parse(const lisp::Lisp& lisp);
63 * Read additional information from given file
65 void parse(std::string fname);
68 * Writes out Add-on metainformation to a Lisp Writer
70 void write(lisp::Writer& writer) const;
73 * Writes out Add-on metainformation to a file
75 void write(std::string fname) const;
78 * Checks if Add-on is the same as given one.
79 * If available, checks MD5 sum, else relies on kind, author and title alone.
81 bool operator==(Addon addon2) const;
84 friend class AddonManager;
86 mutable std::string calculated_md5;