xref: /haiku/headers/private/storage/EntryOperationEngineBase.h (revision 22440f4105cafc95cc1d49f9bc65bb395c527d86)
1 /*
2  * Copyright 2013-2014, 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 _ENTRY_OPERATION_ENGINE_BASE_H
9 #define _ENTRY_OPERATION_ENGINE_BASE_H
10 
11 
12 #include <String.h>
13 
14 
15 class BDirectory;
16 class BEntry;
17 class BPath;
18 
19 struct entry_ref;
20 struct node_ref;
21 
22 
23 namespace BPrivate {
24 
25 
26 class BEntryOperationEngineBase {
27 public:
28 			class Entry;
29 };
30 
31 
32 class BEntryOperationEngineBase::Entry {
33 public:
34 								Entry(const char* path);
35 								Entry(const BDirectory& directory,
36 									const char* path = NULL);
37 								Entry(const BEntry& entry);
38 								Entry(const entry_ref& entryRef);
39 								Entry(const node_ref& directoryRef,
40 									const char* path = NULL);
41 								~Entry();
42 
43 			status_t			GetPath(BPath& buffer, const char*& _path)
44 									const;
45 			BString				Path() const;
46 
47 			status_t			GetPathOrName(BString& _path) const;
48 									// Tries to return some kind of string
49 									// representation. Useful only for debugging
50 									// and error reporting.
51 			BString				PathOrName() const;
52 
53 private:
54 			const BDirectory*	fDirectory;
55 			const char*			fPath;
56 			const BEntry*		fEntry;
57 			const entry_ref*	fEntryRef;
58 			const node_ref*		fDirectoryRef;
59 };
60 
61 
62 } // namespace BPrivate
63 
64 
65 #endif	// _ENTRY_OPERATION_ENGINE_BASE_H
66