1*13bbb4d8SAndrew Lindesay /* 2*13bbb4d8SAndrew Lindesay * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>. 3*13bbb4d8SAndrew Lindesay * Copyright 2016-2023, Andrew Lindesay <apl@lindesay.co.nz>. 4*13bbb4d8SAndrew Lindesay * All rights reserved. Distributed under the terms of the MIT License. 5*13bbb4d8SAndrew Lindesay */ 6*13bbb4d8SAndrew Lindesay #ifndef DEPOT_INFO_H 7*13bbb4d8SAndrew Lindesay #define DEPOT_INFO_H 8*13bbb4d8SAndrew Lindesay 9*13bbb4d8SAndrew Lindesay #include <vector> 10*13bbb4d8SAndrew Lindesay 11*13bbb4d8SAndrew Lindesay #include <String.h> 12*13bbb4d8SAndrew Lindesay #include <Referenceable.h> 13*13bbb4d8SAndrew Lindesay 14*13bbb4d8SAndrew Lindesay #include "PackageInfo.h" 15*13bbb4d8SAndrew Lindesay 16*13bbb4d8SAndrew Lindesay 17*13bbb4d8SAndrew Lindesay class DepotInfo : public BReferenceable { 18*13bbb4d8SAndrew Lindesay public: 19*13bbb4d8SAndrew Lindesay DepotInfo(); 20*13bbb4d8SAndrew Lindesay DepotInfo(const BString& name); 21*13bbb4d8SAndrew Lindesay DepotInfo(const DepotInfo& other); 22*13bbb4d8SAndrew Lindesay 23*13bbb4d8SAndrew Lindesay DepotInfo& operator=(const DepotInfo& other); 24*13bbb4d8SAndrew Lindesay bool operator==(const DepotInfo& other) const; 25*13bbb4d8SAndrew Lindesay bool operator!=(const DepotInfo& other) const; 26*13bbb4d8SAndrew Lindesay 27*13bbb4d8SAndrew Lindesay const BString& Name() const 28*13bbb4d8SAndrew Lindesay { return fName; } 29*13bbb4d8SAndrew Lindesay 30*13bbb4d8SAndrew Lindesay int32 CountPackages() const; 31*13bbb4d8SAndrew Lindesay PackageInfoRef PackageAtIndex(int32 index); 32*13bbb4d8SAndrew Lindesay void AddPackage(PackageInfoRef& package); 33*13bbb4d8SAndrew Lindesay PackageInfoRef PackageByName(const BString& packageName); 34*13bbb4d8SAndrew Lindesay bool HasPackage(const BString& packageName); 35*13bbb4d8SAndrew Lindesay 36*13bbb4d8SAndrew Lindesay void SyncPackagesFromDepot( 37*13bbb4d8SAndrew Lindesay const BReference<DepotInfo>& other); 38*13bbb4d8SAndrew Lindesay 39*13bbb4d8SAndrew Lindesay bool HasAnyProminentPackages() const; 40*13bbb4d8SAndrew Lindesay 41*13bbb4d8SAndrew Lindesay void SetURL(const BString& URL); 42*13bbb4d8SAndrew Lindesay const BString& URL() const 43*13bbb4d8SAndrew Lindesay { return fURL; } 44*13bbb4d8SAndrew Lindesay 45*13bbb4d8SAndrew Lindesay void SetWebAppRepositoryCode(const BString& code); 46*13bbb4d8SAndrew Lindesay const BString& WebAppRepositoryCode() const 47*13bbb4d8SAndrew Lindesay { return fWebAppRepositoryCode; } 48*13bbb4d8SAndrew Lindesay 49*13bbb4d8SAndrew Lindesay void SetWebAppRepositorySourceCode( 50*13bbb4d8SAndrew Lindesay const BString& code); 51*13bbb4d8SAndrew Lindesay const BString& WebAppRepositorySourceCode() const 52*13bbb4d8SAndrew Lindesay { return fWebAppRepositorySourceCode; } 53*13bbb4d8SAndrew Lindesay 54*13bbb4d8SAndrew Lindesay private: 55*13bbb4d8SAndrew Lindesay BString fName; 56*13bbb4d8SAndrew Lindesay std::vector<PackageInfoRef> 57*13bbb4d8SAndrew Lindesay fPackages; 58*13bbb4d8SAndrew Lindesay BString fWebAppRepositoryCode; 59*13bbb4d8SAndrew Lindesay BString fWebAppRepositorySourceCode; 60*13bbb4d8SAndrew Lindesay BString fURL; 61*13bbb4d8SAndrew Lindesay // this is actually a unique identifier for the repository. 62*13bbb4d8SAndrew Lindesay }; 63*13bbb4d8SAndrew Lindesay 64*13bbb4d8SAndrew Lindesay 65*13bbb4d8SAndrew Lindesay typedef BReference<DepotInfo> DepotInfoRef; 66*13bbb4d8SAndrew Lindesay 67*13bbb4d8SAndrew Lindesay 68*13bbb4d8SAndrew Lindesay #endif // DEPOT_INFO_H 69