Skip to content

Commit

Permalink
COMMON: Delete getPath compatibility shim
Browse files Browse the repository at this point in the history
It's not needed anymore
  • Loading branch information
lephilousophe committed Dec 22, 2023
1 parent 46cc8c7 commit 2f5762c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
2 changes: 1 addition & 1 deletion backends/platform/sdl/posix/posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void OSystem_POSIX::addSysArchivesToSearchSet(Common::SearchSet &s, int priority
if (dataNode.exists() && dataNode.isDirectory()) {
// This is the same priority which is used for the data path (below),
// but we insert this one first, so it will be searched first.
s.add(dataNode.getPath(), new Common::FSDirectory(dataNode, 4), priority);
s.addDirectory(dataNode, priority, 4);
}
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions common/fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ FSNode FSNode::getParent() const {
}
}

PathProxy FSNode::getPath() const {
Path FSNode::getPath() const {
assert(_realNode);
return PathProxy(_realNode->getPath(), Common::Path::kNativeSeparator);
return Path(_realNode->getPath(), Common::Path::kNativeSeparator);
}

bool FSNode::isDirectory() const {
Expand Down
27 changes: 1 addition & 26 deletions common/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,6 @@ class SeekableReadStream;
class WriteStream;
class SeekableWriteStream;

/**
* A minimal and temporary class which can act like a Path and like a String
* This is used to ease transition of getPath() from String to Path
* FIXME: Remove this class when it's not needed anymore
*/
class PathProxy : public Path {
private:
String str() const { return toString(Path::kNativeSeparator); }
public:
using Path::Path;

operator String() const { return str(); };
operator U32String() const { return decode(); }

const char *c_str() const { return str().c_str(); }
U32String decode(CodePage page = kUtf8) const { return str().decode(page); }
bool matchString(const char *pat, bool ignoreCase = false, const char *wildcardExclusions = NULL) const {
return str().matchString(pat, ignoreCase, wildcardExclusions);
}

String substr(size_t pos = 0, size_t len = String::npos) const {
return str().substr(pos, len);
}
};

/**
* List of multiple file system nodes. For example, the contents of a given directory.
* This is a subclass instead of just a typedef so that forward declarations
Expand Down Expand Up @@ -226,7 +201,7 @@ class FSNode : public ArchiveMember {
*
* @return The 'path' represented by this file system node.
*/
PathProxy getPath() const;
Path getPath() const;

/**
* Get the parent node of this node. If this node has no parent node,
Expand Down

0 comments on commit 2f5762c

Please sign in to comment.