X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/191d6608f465c8d0f263bd676adea5aec9593984..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/common/dircmn.cpp diff --git a/src/common/dircmn.cpp b/src/common/dircmn.cpp index 89ec5076e2..f5b0c9fe8a 100644 --- a/src/common/dircmn.cpp +++ b/src/common/dircmn.cpp @@ -6,7 +6,7 @@ // Created: 19.05.01 // RCS-ID: $Id$ // Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -347,8 +347,7 @@ wxULongLong wxDir::GetTotalSize(const wxString &dirname, wxArrayString *filesSki return wxInvalidSize; wxDirTraverserSumSize traverser; - if (dir.Traverse(traverser) == (size_t)-1 || - traverser.GetTotalSize() == 0) + if (dir.Traverse(traverser) == (size_t)-1 ) return wxInvalidSize; if (filesSkipped) @@ -358,3 +357,26 @@ wxULongLong wxDir::GetTotalSize(const wxString &dirname, wxArrayString *filesSki } #endif // wxUSE_LONGLONG + +// ---------------------------------------------------------------------------- +// wxDir helpers +// ---------------------------------------------------------------------------- + +/* static */ +bool wxDir::Exists(const wxString& dir) +{ + return wxFileName::DirExists(dir); +} + +/* static */ +bool wxDir::Make(const wxString &dir, int perm, int flags) +{ + return wxFileName::Mkdir(dir, perm, flags); +} + +/* static */ +bool wxDir::Remove(const wxString &dir, int flags) +{ + return wxFileName::Rmdir(dir, flags); +} +