1 /* 2 * Copyright 2011, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _PACKAGE__REPOSITORY_CONFIG_H_ 6 #define _PACKAGE__REPOSITORY_CONFIG_H_ 7 8 9 #include <Entry.h> 10 #include <String.h> 11 12 13 namespace BPackageKit { 14 15 16 class BRepositoryConfig { 17 public: 18 BRepositoryConfig(); 19 BRepositoryConfig(const BString& name, 20 const BString& url, uint8 priority); 21 BRepositoryConfig(const BEntry& entry); 22 virtual ~BRepositoryConfig(); 23 24 status_t Store(const BEntry& entry) const; 25 26 status_t SetTo(const BEntry& entry); 27 status_t InitCheck() const; 28 29 const BString& Name() const; 30 const BString& BaseURL() const; 31 uint8 Priority() const; 32 bool IsUserSpecific() const; 33 34 const BEntry& Entry() const; 35 36 BString PackagesURL() const; 37 38 void SetName(const BString& name); 39 void SetBaseURL(const BString& url); 40 void SetPriority(uint8 priority); 41 void SetIsUserSpecific(bool isUserSpecific); 42 43 public: 44 static const uint8 kUnsetPriority = 0; 45 46 private: 47 status_t fInitStatus; 48 49 BString fName; 50 BString fBaseURL; 51 uint8 fPriority; 52 bool fIsUserSpecific; 53 54 BEntry fEntry; 55 }; 56 57 58 } // namespace BPackageKit 59 60 61 #endif // _PACKAGE__REPOSITORY_CONFIG_H_ 62