mirror of
https://review.haiku-os.org/haiku
synced 2025-01-30 18:24:53 +01:00
7d7ed9bf4b
* drop 'Haiku' namespace * rename 'Package' namespace to 'BPackageKit' * renamed all public classes to begin with a 'B' * renamed BPackageKit::Roster to BPackageKit::BPackageRoster to not clash with the BRoster from the application kit. * fix some instances of public headers including private ones Some functional changes, too: * JobQueue now removes and deletes dependants of failed jobs automatically * JobQueue supports waiting for jobs to become runnable * added a couple of InitCheck() methods where they make sense and invoke those in users of these classes git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40287 a95241bf-73f2-0310-859d-f6bbb57e9c96
76 lines
1.6 KiB
C++
76 lines
1.6 KiB
C++
/*
|
|
* Copyright 2011, Haiku, Inc.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _PACKAGE__REPOSITORY_CONFIG_H_
|
|
#define _PACKAGE__REPOSITORY_CONFIG_H_
|
|
|
|
|
|
#include <Archivable.h>
|
|
#include <Entry.h>
|
|
#include <String.h>
|
|
|
|
|
|
class BEntry;
|
|
|
|
|
|
namespace BPackageKit {
|
|
|
|
|
|
class BRepositoryConfig : public BArchivable {
|
|
typedef BArchivable inherited;
|
|
|
|
public:
|
|
BRepositoryConfig();
|
|
BRepositoryConfig(const BString& name,
|
|
const BString& url,
|
|
uint8 priority = kDefaultPriority);
|
|
BRepositoryConfig(const BEntry& entry);
|
|
BRepositoryConfig(BMessage* data);
|
|
virtual ~BRepositoryConfig();
|
|
|
|
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
|
|
|
status_t StoreAsConfigFile(const BEntry& entry) const;
|
|
|
|
status_t SetTo(const BEntry& entry);
|
|
status_t SetTo(const BMessage* data);
|
|
status_t InitCheck() const;
|
|
|
|
const BString& Name() const;
|
|
const BString& URL() const;
|
|
uint8 Priority() const;
|
|
bool IsUserSpecific() const;
|
|
|
|
const BEntry& Entry() const;
|
|
|
|
void SetName(const BString& name);
|
|
void SetURL(const BString& url);
|
|
void SetPriority(uint8 priority);
|
|
void SetIsUserSpecific(bool isUserSpecific);
|
|
|
|
public:
|
|
static BRepositoryConfig* Instantiate(BMessage* data);
|
|
|
|
static const uint8 kDefaultPriority;
|
|
static const char* kNameField;
|
|
static const char* kURLField;
|
|
static const char* kPriorityField;
|
|
|
|
private:
|
|
status_t fInitStatus;
|
|
|
|
BString fName;
|
|
BString fURL;
|
|
uint8 fPriority;
|
|
bool fIsUserSpecific;
|
|
|
|
BEntry fEntry;
|
|
};
|
|
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
#endif // _PACKAGE__REPOSITORY_CONFIG_H_
|