Skip to content

Commit

Permalink
Add namespace Storage to Path
Browse files Browse the repository at this point in the history
  • Loading branch information
jackburton79 committed Feb 12, 2024
1 parent 3442bfa commit 5c20e77
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion support/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ is_absolute_path(const char *path)
return (path && path[0] == '/');
}


using namespace Storage;

//! Creates an uninitialized BPath object.
Path::Path()
Expand Down
4 changes: 4 additions & 0 deletions support/Path.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "SupportDefs.h"

namespace Storage {

class Path {
public:
Path();
Expand Down Expand Up @@ -43,4 +45,6 @@ class Path {
status_t fCStatus;
};

}; // namespace Storage

#endif // _PATH_H
13 changes: 7 additions & 6 deletions support/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

#include <assert.h>
#include <algorithm>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>

#include <string>
#include <string.h>

#include <iostream>

Expand Down Expand Up @@ -45,9 +46,9 @@ fopen_case(const char* filename, const char* flags)
assert(filename != NULL);
assert(::strlen(filename) > 1);

Path normalizedFileName(filename);
Storage::Path normalizedFileName(filename);
std::string newPath("/");
char* start = (char*)normalizedFileName.String() + 1;
char* start = const_cast<char*>(normalizedFileName.String()) + 1;
char* end = start + ::strlen(normalizedFileName.String());
size_t where = 0;
while ((where = ::strcspn(start, "/")) > 0) {
Expand Down

0 comments on commit 5c20e77

Please sign in to comment.