113bbb4d8SAndrew Lindesay /* 213bbb4d8SAndrew Lindesay * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>. 313bbb4d8SAndrew Lindesay * Copyright 2016-2023, Andrew Lindesay <apl@lindesay.co.nz>. 413bbb4d8SAndrew Lindesay * All rights reserved. Distributed under the terms of the MIT License. 513bbb4d8SAndrew Lindesay */ 613bbb4d8SAndrew Lindesay #ifndef DEPOT_INFO_H 713bbb4d8SAndrew Lindesay #define DEPOT_INFO_H 813bbb4d8SAndrew Lindesay 913bbb4d8SAndrew Lindesay #include <vector> 1013bbb4d8SAndrew Lindesay 1113bbb4d8SAndrew Lindesay #include <String.h> 1213bbb4d8SAndrew Lindesay #include <Referenceable.h> 1313bbb4d8SAndrew Lindesay 1413bbb4d8SAndrew Lindesay #include "PackageInfo.h" 1513bbb4d8SAndrew Lindesay 1613bbb4d8SAndrew Lindesay 1713bbb4d8SAndrew Lindesay class DepotInfo : public BReferenceable { 1813bbb4d8SAndrew Lindesay public: 1913bbb4d8SAndrew Lindesay DepotInfo(); 2013bbb4d8SAndrew Lindesay DepotInfo(const BString& name); 2113bbb4d8SAndrew Lindesay DepotInfo(const DepotInfo& other); 2213bbb4d8SAndrew Lindesay 2313bbb4d8SAndrew Lindesay DepotInfo& operator=(const DepotInfo& other); 2413bbb4d8SAndrew Lindesay bool operator==(const DepotInfo& other) const; 2513bbb4d8SAndrew Lindesay bool operator!=(const DepotInfo& other) const; 2613bbb4d8SAndrew Lindesay Name()2713bbb4d8SAndrew Lindesay const BString& Name() const 2813bbb4d8SAndrew Lindesay { return fName; } 2913bbb4d8SAndrew Lindesay 30*2af0f027SAndrew Lindesay void SetIdentifier(const BString& value); Identifier()31*2af0f027SAndrew Lindesay const BString& Identifier() const 32*2af0f027SAndrew Lindesay { return fIdentifier; } 33*2af0f027SAndrew Lindesay 3413bbb4d8SAndrew Lindesay int32 CountPackages() const; 3513bbb4d8SAndrew Lindesay PackageInfoRef PackageAtIndex(int32 index); 3613bbb4d8SAndrew Lindesay void AddPackage(PackageInfoRef& package); 3713bbb4d8SAndrew Lindesay PackageInfoRef PackageByName(const BString& packageName); 3813bbb4d8SAndrew Lindesay bool HasPackage(const BString& packageName); 3913bbb4d8SAndrew Lindesay 4013bbb4d8SAndrew Lindesay void SyncPackagesFromDepot( 4113bbb4d8SAndrew Lindesay const BReference<DepotInfo>& other); 4213bbb4d8SAndrew Lindesay 4313bbb4d8SAndrew Lindesay bool HasAnyProminentPackages() const; 4413bbb4d8SAndrew Lindesay 4513bbb4d8SAndrew Lindesay void SetWebAppRepositoryCode(const BString& code); WebAppRepositoryCode()4613bbb4d8SAndrew Lindesay const BString& WebAppRepositoryCode() const 4713bbb4d8SAndrew Lindesay { return fWebAppRepositoryCode; } 4813bbb4d8SAndrew Lindesay 4913bbb4d8SAndrew Lindesay void SetWebAppRepositorySourceCode( 5013bbb4d8SAndrew Lindesay const BString& code); WebAppRepositorySourceCode()5113bbb4d8SAndrew Lindesay const BString& WebAppRepositorySourceCode() const 5213bbb4d8SAndrew Lindesay { return fWebAppRepositorySourceCode; } 5313bbb4d8SAndrew Lindesay 5413bbb4d8SAndrew Lindesay private: 5513bbb4d8SAndrew Lindesay BString fName; 56*2af0f027SAndrew Lindesay BString fIdentifier; 5713bbb4d8SAndrew Lindesay std::vector<PackageInfoRef> 5813bbb4d8SAndrew Lindesay fPackages; 5913bbb4d8SAndrew Lindesay BString fWebAppRepositoryCode; 6013bbb4d8SAndrew Lindesay BString fWebAppRepositorySourceCode; 6113bbb4d8SAndrew Lindesay }; 6213bbb4d8SAndrew Lindesay 6313bbb4d8SAndrew Lindesay 6413bbb4d8SAndrew Lindesay typedef BReference<DepotInfo> DepotInfoRef; 6513bbb4d8SAndrew Lindesay 6613bbb4d8SAndrew Lindesay 6713bbb4d8SAndrew Lindesay #endif // DEPOT_INFO_H 68