diff options
author | Brad King <brad.king@kitware.com> | 2013-11-25 16:19:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-25 16:19:42 (GMT) |
commit | f668112039798f5ebc955e127f9c3e4e7cdb5cc4 (patch) | |
tree | c08b9117d4d6288c7dd34af6cbffd7e0314188a7 /Source/kwsys/Directory.cxx | |
parent | da6b86f4f031b189768dc474721145a1b99f71ea (diff) | |
parent | 704ab3d24827cfe5754a00028086f21503c2e08b (diff) | |
download | CMake-f668112039798f5ebc955e127f9c3e4e7cdb5cc4.zip CMake-f668112039798f5ebc955e127f9c3e4e7cdb5cc4.tar.gz CMake-f668112039798f5ebc955e127f9c3e4e7cdb5cc4.tar.bz2 |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/Directory.cxx')
-rw-r--r-- | Source/kwsys/Directory.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx index b884747..d54e607 100644 --- a/Source/kwsys/Directory.cxx +++ b/Source/kwsys/Directory.cxx @@ -14,6 +14,8 @@ #include KWSYS_HEADER(Configure.hxx) +#include KWSYS_HEADER(Encoding.hxx) + #include KWSYS_HEADER(stl/string) #include KWSYS_HEADER(stl/vector) @@ -22,6 +24,7 @@ #if 0 # include "Directory.hxx.in" # include "Configure.hxx.in" +# include "Encoding.hxx.in" # include "kwsys_stl.hxx.in" # include "kwsys_stl_string.hxx.in" # include "kwsys_stl_vector.hxx.in" @@ -120,10 +123,10 @@ bool Directory::Load(const char* name) buf = new char[n + 2 + 1]; sprintf(buf, "%s/*", name); } - struct _finddata_t data; // data of current file + struct _wfinddata_t data; // data of current file // Now put them into the file array - srchHandle = _findfirst(buf, &data); + srchHandle = _wfindfirst((wchar_t*)Encoding::ToWide(buf).c_str(), &data); delete [] buf; if ( srchHandle == -1 ) @@ -134,9 +137,9 @@ bool Directory::Load(const char* name) // Loop through names do { - this->Internal->Files.push_back(data.name); + this->Internal->Files.push_back(Encoding::ToNarrow(data.name)); } - while ( _findnext(srchHandle, &data) != -1 ); + while ( _wfindnext(srchHandle, &data) != -1 ); this->Internal->Path = name; return _findclose(srchHandle) != -1; } @@ -160,10 +163,10 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const char* name) buf = new char[n + 2 + 1]; sprintf(buf, "%s/*", name); } - struct _finddata_t data; // data of current file + struct _wfinddata_t data; // data of current file // Now put them into the file array - srchHandle = _findfirst(buf, &data); + srchHandle = _wfindfirst((wchar_t*)Encoding::ToWide(buf).c_str(), &data); delete [] buf; if ( srchHandle == -1 ) @@ -177,7 +180,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const char* name) { count++; } - while ( _findnext(srchHandle, &data) != -1 ); + while ( _wfindnext(srchHandle, &data) != -1 ); _findclose(srchHandle); return count; } |