aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/windows/windows-fs.cpp
diff options
context:
space:
mode:
authorMax Horn2006-04-04 20:54:55 +0000
committerMax Horn2006-04-04 20:54:55 +0000
commit112ba72222bf191a9c1e4d1ef8e83af1d43d3082 (patch)
treedd8d76377e0c1b3cd72e6083f50ac0fe0a1e60dc /backends/fs/windows/windows-fs.cpp
parentbca4dd001fae016b5c137d00d7c13d58c9f7937f (diff)
downloadscummvm-rg350-112ba72222bf191a9c1e4d1ef8e83af1d43d3082.tar.gz
scummvm-rg350-112ba72222bf191a9c1e4d1ef8e83af1d43d3082.tar.bz2
scummvm-rg350-112ba72222bf191a9c1e4d1ef8e83af1d43d3082.zip
Removing more pseudo copy constructors in favor of the standard copy constructor (gee, everybody is copying my bad code, it seems ;-)
svn-id: r21597
Diffstat (limited to 'backends/fs/windows/windows-fs.cpp')
-rw-r--r--backends/fs/windows/windows-fs.cpp35
1 files changed, 13 insertions, 22 deletions
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index b7a22a301f..5b220427d2 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -43,7 +43,6 @@ protected:
public:
WindowsFilesystemNode();
WindowsFilesystemNode(const String &path);
- WindowsFilesystemNode(const WindowsFilesystemNode *node);
virtual String displayName() const { return _displayName; }
virtual bool isValid() const { return _isValid; }
@@ -60,6 +59,17 @@ private:
};
+static const char *lastPathComponent(const Common::String &str) {
+ const char *start = str.c_str();
+ const char *cur = start + str.size() - 2;
+
+ while (cur > start && *cur != '\\') {
+ --cur;
+ }
+
+ return cur + 1;
+}
+
char* WindowsFilesystemNode::toAscii(TCHAR *x) {
#ifndef UNICODE
@@ -105,7 +115,7 @@ void WindowsFilesystemNode::addFile(FSList &list, ListMode mode, const char *bas
entry._isValid = true;
entry._isPseudoRoot = false;
- list.push_back(wrap(new WindowsFilesystemNode(&entry)));
+ list.push_back(wrap(new WindowsFilesystemNode(entry)));
}
AbstractFilesystemNode *FilesystemNode::getRoot() {
@@ -161,14 +171,6 @@ WindowsFilesystemNode::WindowsFilesystemNode(const String &p) {
}
}
-WindowsFilesystemNode::WindowsFilesystemNode(const WindowsFilesystemNode *node) {
- _displayName = node->_displayName;
- _isDirectory = node->_isDirectory;
- _isValid = node->_isValid;
- _isPseudoRoot = node->_isPseudoRoot;
- _path = node->_path;
-}
-
FSList WindowsFilesystemNode::listDir(ListMode mode) const {
assert(_isDirectory);
@@ -192,7 +194,7 @@ FSList WindowsFilesystemNode::listDir(ListMode mode) const {
entry._isValid = true;
entry._isPseudoRoot = false;
entry._path = toAscii(current_drive);
- myList.push_back(wrap(new WindowsFilesystemNode(&entry)));
+ myList.push_back(wrap(new WindowsFilesystemNode(entry)));
}
#endif
}
@@ -217,17 +219,6 @@ FSList WindowsFilesystemNode::listDir(ListMode mode) const {
return myList;
}
-const char *lastPathComponent(const Common::String &str) {
- const char *start = str.c_str();
- const char *cur = start + str.size() - 2;
-
- while (cur > start && *cur != '\\') {
- --cur;
- }
-
- return cur + 1;
-}
-
AbstractFilesystemNode *WindowsFilesystemNode::parent() const {
assert(_isValid || _isPseudoRoot);
if (_isPseudoRoot)