]> git.mxchange.org Git - simgear.git/blobdiff - simgear/package/Package.hxx
Tweak HTTP code to always sleep.
[simgear.git] / simgear / package / Package.hxx
index 416384d84e41a0cb1dbd1ec919f3fa7a26a1ce58..19a69434ac392e8d28e6516d1d2e4e47ac64def4 100644 (file)
@@ -1,3 +1,20 @@
+// Copyright (C) 2013  James Turner - zakalawe@mac.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+
 #ifndef SG_PACKAGE_PACKAGE_HXX
 #define SG_PACKAGE_PACKAGE_HXX
 
@@ -18,7 +35,10 @@ namespace pkg
 // forward decls
 class Install;
 class Catalog;
+class Package;
 
+typedef std::vector<Package*> PackageList;
+    
 class Package
 {
 public:
@@ -31,6 +51,25 @@ public:
     
     std::string id() const;
     
+    /**
+     * human-readable name - note this is probably not localised,
+     * although this is not ruled out for the future.
+     */
+    std::string name() const;
+    
+    /**
+     * syntactic sugar to get the localised description
+     */
+    std::string description() const;
+    
+    /**
+     * access the raw property data in the package
+     */
+    SGPropertyNode* properties() const;
+    
+    /**
+     * hex-encoded MD5 sum of the download files
+     */
     std::string md5() const;
     
     std::string getLocalisedProp(const std::string& aName) const;
@@ -42,7 +81,19 @@ public:
     
     bool matches(const SGPropertyNode* aFilter) const;
     
+    /**
+     * download URLs for the package
+     */
     string_list downloadUrls() const;
+    
+    string_list thumbnailUrls() const;
+    
+    /**
+     * Packages we depend upon.
+     * If the dependency list cannot be satisifed for some reason,
+     * this will raise an sg_exception.
+     */
+    PackageList dependencies() const;
 private:
     friend class Catalog;
     
@@ -57,7 +108,7 @@ private:
     Catalog* m_catalog;
 };
 
-typedef std::vector<Package*> PackageList;
+
 
 
 } // of namespace pkg