2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
14 #include <EntryOperationEngineBase.h>
24 class BCopyEngine
: public BEntryOperationEngineBase
{
29 COPY_RECURSIVELY
= 0x01,
30 MERGE_EXISTING_DIRECTORIES
= 0x02,
31 UNLINK_DESTINATION
= 0x04,
35 BCopyEngine(uint32 flags
= 0);
38 BController
* Controller() const;
39 void SetController(BController
* controller
);
42 BCopyEngine
& SetFlags(uint32 flags
);
43 BCopyEngine
& AddFlags(uint32 flags
);
44 BCopyEngine
& RemoveFlags(uint32 flags
);
46 status_t
CopyEntry(const Entry
& sourceEntry
,
47 const Entry
& destEntry
);
50 status_t
_CopyEntry(const char* sourcePath
,
51 const char* destPath
);
52 status_t
_CopyFileData(const char* sourcePath
,
53 BFile
& source
, const char* destPath
,
55 status_t
_CopyAttributes(const char* sourcePath
,
56 BNode
& source
, const char* destPath
,
59 void _NotifyError(status_t error
, const char* format
,
61 void _NotifyErrorVarArgs(status_t error
,
62 const char* format
, va_list args
);
63 status_t
_HandleEntryError(const char* path
,
64 status_t error
, const char* format
, ...);
65 status_t
_HandleAttributeError(const char* path
,
66 const char* attribute
, uint32 attributeType
,
67 status_t error
, const char* format
, ...);
70 BController
* fController
;
77 class BCopyEngine::BController
{
80 virtual ~BController();
82 virtual bool EntryStarted(const char* path
);
83 virtual bool EntryFinished(const char* path
, status_t error
);
85 virtual bool AttributeStarted(const char* path
,
86 const char* attribute
,
87 uint32 attributeType
);
88 virtual bool AttributeFinished(const char* path
,
89 const char* attribute
,
90 uint32 attributeType
, status_t error
);
92 virtual void ErrorOccurred(const char* message
,
97 } // namespace BPrivate
100 using ::BPrivate::BCopyEngine
;
103 #endif // _COPY_ENGINE_H