Skip to content

Commit

Permalink
Merge branch 'hotfix/1.28.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Nov 14, 2024
2 parents e49ef1f + 0db74ef commit c6ba793
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.28.2
1.28.3
16 changes: 16 additions & 0 deletions src/eckit/filesystem/LocalPathName.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "eckit/config/LibEcKit.h"
#include "eckit/config/Resource.h"
#include "eckit/filesystem/BasePathNameT.h"
#include "eckit/filesystem/PathName.h"
#include "eckit/filesystem/PathNameFactory.h"
#include "eckit/filesystem/StdDir.h"
#include "eckit/io/FileHandle.h"
Expand Down Expand Up @@ -149,6 +150,9 @@ static void init() {

//----------------------------------------------------------------------------------------------------------------------

LocalPathName::LocalPathName(const PathName& path) :
LocalPathName(path.path(), false, true) {}

LocalPathName LocalPathName::baseName(bool ext) const {
const char* q = path_.c_str();
int n = -1;
Expand Down Expand Up @@ -415,6 +419,18 @@ void operator>>(Stream& s, LocalPathName& path) {
s >> path.path_;
}

LocalPathName operator/(const LocalPathName& p1, const LocalPathName& p2) {
bool tildeIsUserHome = false;
bool skipTildeExpansion = true;
return eckit::LocalPathName(p1.path() + "/" + p2.path(), tildeIsUserHome, skipTildeExpansion);
}

LocalPathName operator/(const LocalPathName& p1, const char* p2) {
bool tildeIsUserHome = false;
bool skipTildeExpansion = true;
return eckit::LocalPathName(p1.path() + "/" + p2, tildeIsUserHome, skipTildeExpansion);
}

LocalPathName LocalPathName::fullName() const {
if (path_.length() > 0 && path_[0] != '/') {
char buf[PATH_MAX];
Expand Down
6 changes: 6 additions & 0 deletions src/eckit/filesystem/LocalPathName.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace eckit {
class Length;
class DataHandle;
class BasePathName;
class PathName;

struct FileSystemSize;

Expand All @@ -54,6 +55,7 @@ class LocalPathName {
tidy(tildeIsUserHome, skipTildeExpansion);
}
}
explicit LocalPathName(const PathName& path);
LocalPathName(const LocalPathName& p) :
path_(p.path_) {}

Expand Down Expand Up @@ -279,6 +281,10 @@ class LocalPathName {
friend LocalPathName operator+(const LocalPathName& p, const char* s) { return LocalPathName(p.path_ + s); }

friend LocalPathName operator+(const LocalPathName& p, char s) { return LocalPathName(p.path_ + s); }

friend LocalPathName operator/(const LocalPathName& p1, const LocalPathName& p2);

friend LocalPathName operator/(const LocalPathName& p1, const char* p2);
};

template <>
Expand Down

0 comments on commit c6ba793

Please sign in to comment.