24 void GetFileName(
const std::wstring& path, std::wstring& fileName);
37 void FindFiles(
const std::wstring& searchExp,
38 std::list<std::wstring>& files);
41 bool GetMyDocuments(std::wstring& path);
55 bool Open(
const std::wstring& file,
DWORD dwAccess,
DWORD dwShared,
DWORD dwCreateDeposition);
56 bool Open(
const std::wstring& file,
DWORD dwAccess);
62 static bool Move(
const std::wstring& file,
63 const std::wstring& newfile,
bool overwrite);
66 static bool Delete(
const std::wstring& file);
70 bool Seek(
long distance);
78 static const int kReadSize = 1 << 20;
83 bool Open(
const std::wstring& file);
94 if (!
ReadSome((BYTE*)out,
sizeof(T)*(maxCount-1), &read))
return false;
95 if (read == 0)
return false;
96 DWORD nCharRead = read /
sizeof(T);
97 size_t x = 0, end = 0;
98 if (found) *found =
false;
99 for (; x < nCharRead; x++)
101 if (out[x] == T(
'\n')) {
102 if (found) *found =
true;
105 else if (out[x] == T(
'\r')) end = x;
107 if (end + 1 == x) out[end] = T(
'\0');
108 else out[x] = T(
'\0');
111 long distance = -(long)read + (x + 1);
112 if (distance != 0)
Seek(distance);
128 static const int kWriteSize = 1 << 20;