BCopyEngine: Add base class BEntryOperationEngineBase

It contains a helper class Entry, which allows to generalize the
BCopyEngine::CopyEntry() parameters.
This commit is contained in:
Ingo Weinhold
2013-09-27 00:51:30 +02:00
parent 43ff23ebbf
commit 4cf3529cbb
5 changed files with 172 additions and 6 deletions
+4 -4
View File
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <SupportDefs.h>
#include <EntryOperationEngineBase.h>
class BFile;
@@ -21,7 +21,7 @@ class BNode;
namespace BPrivate {
class BCopyEngine {
class BCopyEngine : public BEntryOperationEngineBase {
public:
class BController;
@@ -43,8 +43,8 @@ public:
BCopyEngine& AddFlags(uint32 flags);
BCopyEngine& RemoveFlags(uint32 flags);
status_t CopyEntry(const char* sourcePath,
const char* destPath);
status_t CopyEntry(const Entry& sourceEntry,
const Entry& destEntry);
private:
status_t _CopyEntry(const char* sourcePath,
@@ -0,0 +1,55 @@
/*
* Copyright 2013, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold <[email protected]>
*/
#ifndef _ENTRY_OPERATION_ENGINE_BASE_H
#define _ENTRY_OPERATION_ENGINE_BASE_H
#include <String.h>
class BDirectory;
class BEntry;
class BPath;
struct entry_ref;
namespace BPrivate {
class BEntryOperationEngineBase {
public:
class Entry;
};
class BEntryOperationEngineBase::Entry {
public:
Entry(const char* path);
Entry(const BDirectory& directory,
const char* path = NULL);
Entry(const BEntry& entry);
Entry(const entry_ref& entryRef);
~Entry();
status_t GetPath(BPath& buffer, const char*& _path)
const;
BString Path() const;
private:
const BDirectory* fDirectory;
const char* fPath;
const BEntry* fEntry;
const entry_ref* fEntryRef;
};
} // namespace BPrivate
#endif // _ENTRY_OPERATION_ENGINE_BASE_H