src/addon/addon.hpp

Go to the documentation of this file.
00001 //  SuperTux - Add-on
00002 //  Copyright (C) 2007 Christoph Sommer <christoph.sommer@2007.expires.deltadevelopment.de>
00003 //
00004 //  This program is free software: you can redistribute it and/or modify
00005 //  it under the terms of the GNU General Public License as published by
00006 //  the Free Software Foundation, either version 3 of the License, or
00007 //  (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 #ifndef HEADER_SUPERTUX_ADDON_ADDON_HPP
00018 #define HEADER_SUPERTUX_ADDON_ADDON_HPP
00019 
00020 #include <string>
00021 
00022 #include "util/reader_fwd.hpp"
00023 #include "util/writer_fwd.hpp"
00024 
00028 class Addon
00029 {
00030 public:
00031   std::string kind;
00032   std::string title;
00033   std::string author;
00034   std::string license;
00035   std::string http_url;
00037   std::string suggested_filename;
00039   std::string installed_physfs_filename;
00041   std::string installed_absolute_filename;
00042   std::string stored_md5;
00043   bool installed;
00044   bool loaded;
00045 
00049   std::string get_md5() const;
00050 
00054   void parse(const Reader& lisp);
00055 
00059   void parse(std::string fname);
00060 
00064   void write(Writer& writer) const;
00065 
00069   void write(std::string fname) const;
00070 
00075   bool operator==(Addon addon2) const;
00076 
00077 protected:
00078   friend class AddonManager;
00079 
00080   mutable std::string calculated_md5;
00081 
00082   Addon() :
00083     kind(),
00084     title(),
00085     author(),
00086     license(),
00087     http_url(),
00088     suggested_filename(), 
00089     installed_physfs_filename(), 
00090     installed_absolute_filename(),
00091     stored_md5(),
00092     installed(),
00093     loaded(),
00094     calculated_md5()
00095   {};
00096 };
00097 
00098 #endif
00099 
00100 /* EOF */

Generated on Mon Jun 9 03:38:16 2014 for SuperTux by  doxygen 1.5.1