14cf3529cSIngo Weinhold/*
26077cad8SIngo Weinhold * Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
34cf3529cSIngo Weinhold * Distributed under the terms of the MIT License.
44cf3529cSIngo Weinhold *
54cf3529cSIngo Weinhold * Authors:
64cf3529cSIngo Weinhold *		Ingo Weinhold <ingo_weinhold@gmx.de>
74cf3529cSIngo Weinhold */
84cf3529cSIngo Weinhold#ifndef _ENTRY_OPERATION_ENGINE_BASE_H
94cf3529cSIngo Weinhold#define _ENTRY_OPERATION_ENGINE_BASE_H
104cf3529cSIngo Weinhold
114cf3529cSIngo Weinhold
124cf3529cSIngo Weinhold#include <String.h>
134cf3529cSIngo Weinhold
144cf3529cSIngo Weinhold
154cf3529cSIngo Weinholdclass BDirectory;
164cf3529cSIngo Weinholdclass BEntry;
174cf3529cSIngo Weinholdclass BPath;
184cf3529cSIngo Weinhold
194cf3529cSIngo Weinholdstruct entry_ref;
209680cf0bSIngo Weinholdstruct node_ref;
214cf3529cSIngo Weinhold
224cf3529cSIngo Weinhold
234cf3529cSIngo Weinholdnamespace BPrivate {
244cf3529cSIngo Weinhold
254cf3529cSIngo Weinhold
264cf3529cSIngo Weinholdclass BEntryOperationEngineBase {
274cf3529cSIngo Weinholdpublic:
284cf3529cSIngo Weinhold			class Entry;
294cf3529cSIngo Weinhold};
304cf3529cSIngo Weinhold
314cf3529cSIngo Weinhold
324cf3529cSIngo Weinholdclass BEntryOperationEngineBase::Entry {
334cf3529cSIngo Weinholdpublic:
344cf3529cSIngo Weinhold								Entry(const char* path);
354cf3529cSIngo Weinhold								Entry(const BDirectory& directory,
364cf3529cSIngo Weinhold									const char* path = NULL);
374cf3529cSIngo Weinhold								Entry(const BEntry& entry);
384cf3529cSIngo Weinhold								Entry(const entry_ref& entryRef);
399680cf0bSIngo Weinhold								Entry(const node_ref& directoryRef,
409680cf0bSIngo Weinhold									const char* path = NULL);
414cf3529cSIngo Weinhold								~Entry();
424cf3529cSIngo Weinhold
434cf3529cSIngo Weinhold			status_t			GetPath(BPath& buffer, const char*& _path)
444cf3529cSIngo Weinhold									const;
454cf3529cSIngo Weinhold			BString				Path() const;
464cf3529cSIngo Weinhold
476077cad8SIngo Weinhold			status_t			GetPathOrName(BString& _path) const;
486077cad8SIngo Weinhold									// Tries to return some kind of string
496077cad8SIngo Weinhold									// representation. Useful only for debugging
506077cad8SIngo Weinhold									// and error reporting.
516077cad8SIngo Weinhold			BString				PathOrName() const;
526077cad8SIngo Weinhold
534cf3529cSIngo Weinholdprivate:
544cf3529cSIngo Weinhold			const BDirectory*	fDirectory;
554cf3529cSIngo Weinhold			const char*			fPath;
564cf3529cSIngo Weinhold			const BEntry*		fEntry;
574cf3529cSIngo Weinhold			const entry_ref*	fEntryRef;
589680cf0bSIngo Weinhold			const node_ref*		fDirectoryRef;
594cf3529cSIngo Weinhold};
604cf3529cSIngo Weinhold
614cf3529cSIngo Weinhold
624cf3529cSIngo Weinhold} // namespace BPrivate
634cf3529cSIngo Weinhold
644cf3529cSIngo Weinhold
654cf3529cSIngo Weinhold#endif	// _ENTRY_OPERATION_ENGINE_BASE_H