KPath: Replaced booleans with flags field.

* No functional change intended; I chose the flags in a way that it
  should still work even if I missed a reference.
This commit is contained in:
Axel Dörfler
2017-04-30 17:13:39 +02:00
parent e1b4aed0cb
commit eac83fb33e
6 changed files with 42 additions and 38 deletions
+11 -6
View File
@@ -1,5 +1,6 @@
/*
* Copyright 2004-2008, Ingo Weinhold, [email protected].
* Copyright 2008-2017, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _K_PATH_H
@@ -13,23 +14,27 @@ namespace BPrivate {
namespace DiskDevice {
class KPath {
public:
enum {
DEFAULT = 0,
NORMALIZE = 0x01,
TRAVERSE_LEAF_LINK = 0x02,
};
public:
KPath(size_t bufferSize = B_PATH_NAME_LENGTH);
KPath(const char* path, bool normalize = false,
KPath(const char* path, int32 flags = DEFAULT,
size_t bufferSize = B_PATH_NAME_LENGTH);
KPath(const KPath& other);
~KPath();
status_t SetTo(const char* path, bool normalize = false,
size_t bufferSize = B_PATH_NAME_LENGTH,
bool traverseLeafLink = false);
status_t SetTo(const char* path, int32 flags = DEFAULT,
size_t bufferSize = B_PATH_NAME_LENGTH);
void Adopt(KPath& other);
status_t InitCheck() const;
status_t SetPath(const char* path,
bool normalize = false,
bool traverseLeafLink = false);
int32 flags = DEFAULT);
const char* Path() const;
size_t Length() const
{ return fPathLength; }