vfs: check userland buffers before reading them.
[haiku.git] / src / apps / haikudepot / server / BulkLoadContext.h
blob04d8ce2c2f60a7d48ca10cbddb1a179ff3876736
1 /*
2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef BULK_LOAD_CONTEXT_H
6 #define BULK_LOAD_CONTEXT_H
8 #include <String.h>
9 #include <File.h>
10 #include <Path.h>
12 #include "AbstractServerProcess.h"
13 #include "List.h"
16 typedef enum bulk_load_state {
17 BULK_LOAD_INITIAL = 1,
18 BULK_LOAD_REPOSITORY_AND_REFERENCE = 2,
19 BULK_LOAD_PKGS_AND_ICONS = 3,
20 BULK_LOAD_COMPLETE = 4
21 } bulk_load_state;
24 class BulkLoadContext {
25 public:
26 BulkLoadContext();
27 virtual ~BulkLoadContext();
29 void StopAllProcesses();
31 bulk_load_state State();
32 void SetState(bulk_load_state value);
34 AbstractServerProcess*
35 IconProcess();
36 void SetIconProcess(AbstractServerProcess* value);
38 AbstractServerProcess*
39 RepositoryProcess();
40 void SetRepositoryProcess(
41 AbstractServerProcess* value);
43 int32 CountPkgProcesses();
44 AbstractServerProcess*
45 PkgProcessAt(int32 index);
46 void AddPkgProcess(AbstractServerProcess *value);
48 void AddProcessOption(uint32 flag);
49 uint32 ProcessOptions();
51 private:
52 bulk_load_state
53 fState;
55 AbstractServerProcess*
56 fIconProcess;
57 AbstractServerProcess*
58 fRepositoryProcess;
59 List<AbstractServerProcess*, true>*
60 fPkgProcesses;
61 uint32 fProcessOptions;
66 #endif // BULK_LOAD_CONTEXT_H