Add windows code for AbstractFilesystemNode::child()
svn-id: r22253
This commit is contained in:
parent
ff7955f4d3
commit
7b7d290675
1 changed files with 13 additions and 1 deletions
|
@ -230,7 +230,19 @@ AbstractFilesystemNode *WindowsFilesystemNode::parent() const {
|
|||
}
|
||||
|
||||
AbstractFilesystemNode *WindowsFilesystemNode::child(const String &name) const {
|
||||
TODO
|
||||
assert(_isDirectory);
|
||||
String newPath(_path);
|
||||
if (_path.lastChar() != '\\')
|
||||
newPath += '\\';
|
||||
newPath += name;
|
||||
|
||||
// Check whether the directory actually exists
|
||||
DWORD fileAttribs = GetFileAttributes(toUnicode(newPath.c_str()));
|
||||
if (fileAttribs == 0xffffffff)
|
||||
return 0;
|
||||
|
||||
WindowsFilesystemNode *p = new WindowsFilesystemNode(newPath);
|
||||
return p;
|
||||
}
|
||||
|
||||
#endif // WIN32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue