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 15class BDirectory; 16class BEntry; 17class BPath; 18 19struct entry_ref; 20struct node_ref; 21 22 23namespace BPrivate { 24 25 26class BEntryOperationEngineBase { 27public: 28 class Entry; 29}; 30 31 32class BEntryOperationEngineBase::Entry { 33public: 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 53private: 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