vfs: check userland buffers before reading them.
[haiku.git] / headers / private / package / ActivationTransaction.h
blob02ceeb4e9e4ee49bee890e0a333bda4872a43824
1 /*
2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
7 */
8 #ifndef _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
9 #define _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
12 #include <Archivable.h>
13 #include <package/PackageDefs.h>
14 #include <StringList.h>
17 namespace BPackageKit {
18 namespace BPrivate {
21 class BActivationTransaction : public BArchivable {
22 public:
23 BActivationTransaction();
24 BActivationTransaction(BMessage* archive,
25 status_t* _error = NULL);
26 virtual ~BActivationTransaction();
28 status_t SetTo(BPackageInstallationLocation location,
29 int64 changeCount,
30 const BString& directoryName);
32 status_t InitCheck() const;
34 BPackageInstallationLocation Location() const;
35 void SetLocation(
36 BPackageInstallationLocation location);
38 int64 ChangeCount() const;
39 void SetChangeCount(int64 changeCount);
41 const BString& TransactionDirectoryName() const;
42 void SetTransactionDirectoryName(
43 const BString& directoryName);
45 const BStringList& PackagesToActivate() const;
46 bool SetPackagesToActivate(
47 const BStringList& packages);
48 bool AddPackageToActivate(const BString& package);
50 const BStringList& PackagesToDeactivate() const;
51 bool SetPackagesToDeactivate(
52 const BStringList& packages);
53 bool AddPackageToDeactivate(const BString& package);
55 virtual status_t Archive(BMessage* archive,
56 bool deep = true) const;
57 static BArchivable* Instantiate(BMessage* archive);
59 private:
60 static status_t _ExtractStringList(BMessage* archive,
61 const char* field, BStringList& _list);
63 private:
64 BPackageInstallationLocation fLocation;
65 int64 fChangeCount;
66 BString fTransactionDirectoryName;
67 BStringList fPackagesToActivate;
68 BStringList fPackagesToDeactivate;
72 } // namespace BPrivate
73 } // namespace BPackageKit
76 #endif // _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_