xref: /haiku/headers/private/storage/RemoveEngine.h (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
1 /*
2  * Copyright 2013, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold <ingo_weinhold@gmx.de>
7  */
8 #ifndef _REMOVE_ENGINE_H
9 #define _REMOVE_ENGINE_H
10 
11 
12 #include <stdarg.h>
13 
14 #include <EntryOperationEngineBase.h>
15 
16 
17 namespace BPrivate {
18 
19 
20 class BRemoveEngine : public BEntryOperationEngineBase {
21 public:
22 			class BController;
23 
24 public:
25 								BRemoveEngine();
26 								~BRemoveEngine();
27 
28 			BController*		Controller() const;
29 			void				SetController(BController* controller);
30 
31 			status_t			RemoveEntry(const Entry& entry);
32 
33 private:
34 			status_t			_RemoveEntry(const char* path);
35 
36 			void				_NotifyErrorVarArgs(status_t error,
37 									const char* format, va_list args);
38 			status_t			_HandleEntryError(const char* path,
39 									status_t error, const char* format, ...);
40 
41 private:
42 			BController*		fController;
43 };
44 
45 
46 class BRemoveEngine::BController {
47 public:
48 								BController();
49 	virtual						~BController();
50 
51 	virtual	bool				EntryStarted(const char* path);
52 	virtual	bool				EntryFinished(const char* path, status_t error);
53 
54 	virtual	void				ErrorOccurred(const char* message,
55 									status_t error);
56 };
57 
58 
59 } // namespace BPrivate
60 
61 
62 using ::BPrivate::BRemoveEngine;
63 
64 
65 #endif	// _REMOVE_ENGINE_H
66