BEntryOperationEngineBase::Entry: Add node_ref+path c'tor
This commit is contained in:
@@ -17,6 +17,7 @@ class BEntry;
|
|||||||
class BPath;
|
class BPath;
|
||||||
|
|
||||||
struct entry_ref;
|
struct entry_ref;
|
||||||
|
struct node_ref;
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
@@ -35,6 +36,8 @@ public:
|
|||||||
const char* path = NULL);
|
const char* path = NULL);
|
||||||
Entry(const BEntry& entry);
|
Entry(const BEntry& entry);
|
||||||
Entry(const entry_ref& entryRef);
|
Entry(const entry_ref& entryRef);
|
||||||
|
Entry(const node_ref& directoryRef,
|
||||||
|
const char* path = NULL);
|
||||||
~Entry();
|
~Entry();
|
||||||
|
|
||||||
status_t GetPath(BPath& buffer, const char*& _path)
|
status_t GetPath(BPath& buffer, const char*& _path)
|
||||||
@@ -46,6 +49,7 @@ private:
|
|||||||
const char* fPath;
|
const char* fPath;
|
||||||
const BEntry* fEntry;
|
const BEntry* fEntry;
|
||||||
const entry_ref* fEntryRef;
|
const entry_ref* fEntryRef;
|
||||||
|
const node_ref* fDirectoryRef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,18 +19,20 @@ BEntryOperationEngineBase::Entry::Entry(const char* path)
|
|||||||
fDirectory(NULL),
|
fDirectory(NULL),
|
||||||
fPath(path),
|
fPath(path),
|
||||||
fEntry(NULL),
|
fEntry(NULL),
|
||||||
fEntryRef(NULL)
|
fEntryRef(NULL),
|
||||||
|
fDirectoryRef(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BEntryOperationEngineBase::Entry::Entry(const BDirectory& directory, const char* path)
|
BEntryOperationEngineBase::Entry::Entry(const BDirectory& directory,
|
||||||
|
const char* path)
|
||||||
:
|
:
|
||||||
fDirectory(&directory),
|
fDirectory(&directory),
|
||||||
fPath(path),
|
fPath(path),
|
||||||
fEntry(NULL),
|
fEntry(NULL),
|
||||||
fEntryRef(NULL)
|
fEntryRef(NULL),
|
||||||
|
fDirectoryRef(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +42,8 @@ BEntryOperationEngineBase::Entry::Entry(const BEntry& entry)
|
|||||||
fDirectory(NULL),
|
fDirectory(NULL),
|
||||||
fPath(NULL),
|
fPath(NULL),
|
||||||
fEntry(&entry),
|
fEntry(&entry),
|
||||||
fEntryRef(NULL)
|
fEntryRef(NULL),
|
||||||
|
fDirectoryRef(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +53,20 @@ BEntryOperationEngineBase::Entry::Entry(const entry_ref& entryRef)
|
|||||||
fDirectory(NULL),
|
fDirectory(NULL),
|
||||||
fPath(NULL),
|
fPath(NULL),
|
||||||
fEntry(NULL),
|
fEntry(NULL),
|
||||||
fEntryRef(&entryRef)
|
fEntryRef(&entryRef),
|
||||||
|
fDirectoryRef(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEntryOperationEngineBase::Entry::Entry(const node_ref& directoryRef,
|
||||||
|
const char* path)
|
||||||
|
:
|
||||||
|
fDirectory(NULL),
|
||||||
|
fPath(path),
|
||||||
|
fEntry(NULL),
|
||||||
|
fEntryRef(NULL),
|
||||||
|
fDirectoryRef(&directoryRef)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +88,11 @@ BEntryOperationEngineBase::Entry::GetPath(BPath& buffer, const char*& _path)
|
|||||||
error = buffer.SetTo(fDirectory, fPath);
|
error = buffer.SetTo(fDirectory, fPath);
|
||||||
} else if (fEntryRef != NULL) {
|
} else if (fEntryRef != NULL) {
|
||||||
error = buffer.SetTo(fEntryRef);
|
error = buffer.SetTo(fEntryRef);
|
||||||
|
} else if (fDirectoryRef != NULL) {
|
||||||
|
BDirectory directory;
|
||||||
|
error = directory.SetTo(fDirectoryRef);
|
||||||
|
if (error == B_OK)
|
||||||
|
error = buffer.SetTo(&directory, fPath);
|
||||||
} else if (fPath != NULL) {
|
} else if (fPath != NULL) {
|
||||||
_path = fPath;
|
_path = fPath;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user