Added BEntry::Name() method.
* GetName() is a bad API, and should be deprecated.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2002-2012, Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _ENTRY_H
|
#ifndef _ENTRY_H
|
||||||
@@ -50,6 +50,8 @@ public:
|
|||||||
status_t InitCheck() const;
|
status_t InitCheck() const;
|
||||||
bool Exists() const;
|
bool Exists() const;
|
||||||
|
|
||||||
|
const char* Name() const;
|
||||||
|
|
||||||
virtual status_t GetStat(struct stat* stat) const;
|
virtual status_t GetStat(struct stat* stat) const;
|
||||||
|
|
||||||
status_t SetTo(const BDirectory* dir, const char* path,
|
status_t SetTo(const BDirectory* dir, const char* path,
|
||||||
|
|||||||
+17
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2009, Haiku Inc.
|
* Copyright 2002-2012, Haiku Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -191,6 +191,16 @@ BEntry::Exists() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char*
|
||||||
|
BEntry::Name() const
|
||||||
|
{
|
||||||
|
if (fCStatus != B_OK)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return fName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BEntry::SetTo(const BDirectory* dir, const char* path, bool traverse)
|
BEntry::SetTo(const BDirectory* dir, const char* path, bool traverse)
|
||||||
{
|
{
|
||||||
@@ -360,18 +370,13 @@ BEntry::GetParent(BDirectory* dir) const
|
|||||||
status_t
|
status_t
|
||||||
BEntry::GetName(char* buffer) const
|
BEntry::GetName(char* buffer) const
|
||||||
{
|
{
|
||||||
status_t result = B_ERROR;
|
if (fCStatus != B_OK)
|
||||||
|
return B_NO_INIT;
|
||||||
|
if (buffer == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (fCStatus != B_OK) {
|
strcpy(buffer, fName);
|
||||||
result = B_NO_INIT;
|
return B_OK;
|
||||||
} else if (buffer == NULL) {
|
|
||||||
result = B_BAD_VALUE;
|
|
||||||
} else {
|
|
||||||
strcpy(buffer, fName);
|
|
||||||
result = B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user