X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Faddon.hpp;h=b65efe7041b3546d79c0da55d84644bcd3dcfc1d;hb=8ea989626785c9a386bf4aef1b44fd201b677a08;hp=9e9bcc1b019e60794a6ded163022f03a17f965bb;hpb=7ee27c4c9687de567f6cc9e811b6b962d6a62f39;p=supertux.git diff --git a/src/addon.hpp b/src/addon.hpp index 9e9bcc1b0..b65efe704 100644 --- a/src/addon.hpp +++ b/src/addon.hpp @@ -23,6 +23,9 @@ #include #include +#include "lisp/parser.hpp" +#include "lisp/lisp.hpp" +#include "lisp/writer.hpp" /** * Represents an (available or installed) Add-on, e.g. a level set @@ -30,9 +33,14 @@ class Addon { public: + std::string kind; std::string title; - std::string url; - std::string fname; + std::string author; + std::string license; + std::string http_url; + std::string file; + std::string md5; + bool isInstalled; /** @@ -45,7 +53,32 @@ public: */ void remove(); + /** + * Read additional information from given contents of a (supertux-addoninfo ...) block + */ + void parse(const lisp::Lisp& lisp); + + /** + * Read additional information from given file + */ + void parse(std::string fname); + + /** + * Writes out Add-on metainformation to a Lisp Writer + */ + void write(lisp::Writer& writer) const; + + /** + * Writes out Add-on metainformation to a file + */ + void write(std::string fname) const; + + /** + * Checks if Add-on is the same as given one. + * If available, checks MD5 sum, else relies on title alone. + */ + bool equals(const Addon& addon2) const; + }; #endif -