2011-01-22 01:18:58 +03:00
|
|
|
/*
|
2018-06-28 00:01:51 +03:00
|
|
|
* Copyright 2011-2018, Haiku, Inc.
|
2011-01-22 01:18:58 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2011-01-25 20:07:27 +03:00
|
|
|
#ifndef _PACKAGE__REPOSITORY_CONFIG_H_
|
|
|
|
#define _PACKAGE__REPOSITORY_CONFIG_H_
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
#include <Entry.h>
|
2011-01-22 01:18:58 +03:00
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
namespace BPackageKit {
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-25 22:36:09 +03:00
|
|
|
class BRepositoryConfig {
|
2011-01-22 01:18:58 +03:00
|
|
|
public:
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryConfig();
|
|
|
|
BRepositoryConfig(const BString& name,
|
2011-01-25 22:36:09 +03:00
|
|
|
const BString& url, uint8 priority);
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryConfig(const BEntry& entry);
|
|
|
|
virtual ~BRepositoryConfig();
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2011-01-25 22:36:09 +03:00
|
|
|
status_t Store(const BEntry& entry) const;
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
status_t SetTo(const BEntry& entry);
|
2011-01-22 01:18:58 +03:00
|
|
|
status_t InitCheck() const;
|
|
|
|
|
|
|
|
const BString& Name() const;
|
2011-01-25 22:36:09 +03:00
|
|
|
const BString& BaseURL() const;
|
2018-06-28 00:01:51 +03:00
|
|
|
const BString& URL() const;
|
2011-01-22 01:18:58 +03:00
|
|
|
uint8 Priority() const;
|
|
|
|
bool IsUserSpecific() const;
|
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
const BEntry& Entry() const;
|
|
|
|
|
2013-07-06 20:06:02 +04:00
|
|
|
BString PackagesURL() const;
|
|
|
|
|
2011-01-22 01:18:58 +03:00
|
|
|
void SetName(const BString& name);
|
2011-01-25 22:36:09 +03:00
|
|
|
void SetBaseURL(const BString& url);
|
2018-06-28 00:01:51 +03:00
|
|
|
void SetURL(const BString& url);
|
2011-01-22 01:18:58 +03:00
|
|
|
void SetPriority(uint8 priority);
|
|
|
|
void SetIsUserSpecific(bool isUserSpecific);
|
|
|
|
|
|
|
|
public:
|
2011-01-25 22:36:09 +03:00
|
|
|
static const uint8 kUnsetPriority = 0;
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
status_t fInitStatus;
|
|
|
|
|
|
|
|
BString fName;
|
2011-01-25 22:36:09 +03:00
|
|
|
BString fBaseURL;
|
2018-06-28 00:01:51 +03:00
|
|
|
// this URL is the URL that can be used to access the data of
|
|
|
|
// the repository - it points to a single mirror.
|
|
|
|
BString fURL;
|
|
|
|
// this URL is actually an identifier for the repository
|
|
|
|
// that is consistent across mirrors.
|
2011-01-22 01:18:58 +03:00
|
|
|
uint8 fPriority;
|
|
|
|
bool fIsUserSpecific;
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
BEntry fEntry;
|
2011-01-22 01:18:58 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
} // namespace BPackageKit
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
#endif // _PACKAGE__REPOSITORY_CONFIG_H_
|