BPathFinder: Coding style improvements

This commit is contained in:
Ingo Weinhold
2013-11-19 02:05:36 +01:00
parent 81522ad41b
commit 0eb197d40c
2 changed files with 34 additions and 34 deletions
+9 -9
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2013, Haiku Inc. All Rights Reserved. * Copyright 2013, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _PATH_FINDER_H #ifndef _PATH_FINDER_H
@@ -34,26 +34,26 @@ public:
status_t FindPath(const char* architecture, status_t FindPath(const char* architecture,
path_base_directory baseDirectory, path_base_directory baseDirectory,
const char* subPath, uint32 flags, const char* subPath, uint32 flags,
BPath& path); BPath& _path);
status_t FindPath(path_base_directory baseDirectory, status_t FindPath(path_base_directory baseDirectory,
const char* subPath, uint32 flags, const char* subPath, uint32 flags,
BPath& path); BPath& _path);
status_t FindPath(path_base_directory baseDirectory, status_t FindPath(path_base_directory baseDirectory,
const char* subPath, BPath& path); const char* subPath, BPath& _path);
status_t FindPath(path_base_directory baseDirectory, status_t FindPath(path_base_directory baseDirectory,
BPath& path); BPath& _path);
static status_t FindPaths(const char* architecture, static status_t FindPaths(const char* architecture,
path_base_directory baseDirectory, path_base_directory baseDirectory,
const char* subPath, uint32 flags, const char* subPath, uint32 flags,
BStringList& paths); BStringList& _paths);
static status_t FindPaths(path_base_directory baseDirectory, static status_t FindPaths(path_base_directory baseDirectory,
const char* subPath, uint32 flags, const char* subPath, uint32 flags,
BStringList& paths); BStringList& _paths);
static status_t FindPaths(path_base_directory baseDirectory, static status_t FindPaths(path_base_directory baseDirectory,
const char* subPath, BStringList& paths); const char* subPath, BStringList& _paths);
static status_t FindPaths(path_base_directory baseDirectory, static status_t FindPaths(path_base_directory baseDirectory,
BStringList& paths); BStringList& _paths);
private: private:
status_t _SetTo(const void* codePointer, status_t _SetTo(const void* codePointer,
+25 -25
View File
@@ -55,13 +55,12 @@ BPathFinder::SetTo(const entry_ref& ref, const char* dependency)
} }
status_t status_t
BPathFinder::FindPath(const char* architecture, BPathFinder::FindPath(const char* architecture,
path_base_directory baseDirectory, const char* subPath, uint32 flags, path_base_directory baseDirectory, const char* subPath, uint32 flags,
BPath& path) BPath& _path)
{ {
path.Unset(); _path.Unset();
if (fInitStatus != B_OK) if (fInitStatus != B_OK)
return fInitStatus; return fInitStatus;
@@ -83,38 +82,39 @@ BPathFinder::FindPath(const char* architecture,
if (error != B_OK) if (error != B_OK)
return error; return error;
return path.SetTo(pathBuffer); return _path.SetTo(pathBuffer);
}
status_t
BPathFinder::FindPath(path_base_directory baseDirectory, const char* subPath,
uint32 flags, BPath& path)
{
return FindPath(NULL, baseDirectory, subPath, flags, path);
} }
status_t status_t
BPathFinder::FindPath(path_base_directory baseDirectory, const char* subPath, BPathFinder::FindPath(path_base_directory baseDirectory, const char* subPath,
BPath& path) uint32 flags, BPath& _path)
{ {
return FindPath(NULL, baseDirectory, subPath, 0, path); return FindPath(NULL, baseDirectory, subPath, flags, _path);
} }
status_t status_t
BPathFinder::FindPath(path_base_directory baseDirectory, BPath& path) BPathFinder::FindPath(path_base_directory baseDirectory, const char* subPath,
BPath& _path)
{ {
return FindPath(NULL, baseDirectory, NULL, 0, path); return FindPath(NULL, baseDirectory, subPath, 0, _path);
}
status_t
BPathFinder::FindPath(path_base_directory baseDirectory, BPath& _path)
{
return FindPath(NULL, baseDirectory, NULL, 0, _path);
} }
/*static*/ status_t /*static*/ status_t
BPathFinder::FindPaths(const char* architecture, BPathFinder::FindPaths(const char* architecture,
path_base_directory baseDirectory, const char* subPath, uint32 flags, path_base_directory baseDirectory, const char* subPath, uint32 flags,
BStringList& paths) BStringList& _paths)
{ {
paths.MakeEmpty(); _paths.MakeEmpty();
// get the paths // get the paths
char** pathArray; char** pathArray;
@@ -127,8 +127,8 @@ BPathFinder::FindPaths(const char* architecture,
// add them to BStringList // add them to BStringList
for (size_t i = 0; i < pathCount; i++) { for (size_t i = 0; i < pathCount; i++) {
BString path(pathArray[i]); BString path(pathArray[i]);
if (path.IsEmpty() || !paths.Add(path)) { if (path.IsEmpty() || !_paths.Add(path)) {
paths.MakeEmpty(); _paths.MakeEmpty();
return B_NO_MEMORY; return B_NO_MEMORY;
} }
} }
@@ -139,24 +139,24 @@ BPathFinder::FindPaths(const char* architecture,
/*static*/ status_t /*static*/ status_t
BPathFinder::FindPaths(path_base_directory baseDirectory, const char* subPath, BPathFinder::FindPaths(path_base_directory baseDirectory, const char* subPath,
uint32 flags, BStringList& paths) uint32 flags, BStringList& _paths)
{ {
return FindPaths(NULL, baseDirectory, subPath, 0, paths); return FindPaths(NULL, baseDirectory, subPath, 0, _paths);
} }
/*static*/ status_t /*static*/ status_t
BPathFinder::FindPaths(path_base_directory baseDirectory, const char* subPath, BPathFinder::FindPaths(path_base_directory baseDirectory, const char* subPath,
BStringList& paths) BStringList& _paths)
{ {
return FindPaths(NULL, baseDirectory, subPath, 0, paths); return FindPaths(NULL, baseDirectory, subPath, 0, _paths);
} }
/*static*/ status_t /*static*/ status_t
BPathFinder::FindPaths(path_base_directory baseDirectory, BStringList& paths) BPathFinder::FindPaths(path_base_directory baseDirectory, BStringList& _paths)
{ {
return FindPaths(NULL, baseDirectory, NULL, 0, paths); return FindPaths(NULL, baseDirectory, NULL, 0, _paths);
} }