vfs: check userland buffers before reading them.
[haiku.git] / headers / private / storage / EntryOperationEngineBase.h
blobad8accf6e4b4351723d052431abe9365bc756e8a
1 /*
2 * Copyright 2013-2014, 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 _ENTRY_OPERATION_ENGINE_BASE_H
9 #define _ENTRY_OPERATION_ENGINE_BASE_H
12 #include <String.h>
15 class BDirectory;
16 class BEntry;
17 class BPath;
19 struct entry_ref;
20 struct node_ref;
23 namespace BPrivate {
26 class BEntryOperationEngineBase {
27 public:
28 class Entry;
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();
43 status_t GetPath(BPath& buffer, const char*& _path)
44 const;
45 BString Path() const;
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;
53 private:
54 const BDirectory* fDirectory;
55 const char* fPath;
56 const BEntry* fEntry;
57 const entry_ref* fEntryRef;
58 const node_ref* fDirectoryRef;
62 } // namespace BPrivate
65 #endif // _ENTRY_OPERATION_ENGINE_BASE_H