Lines Matching full:pathname
50 bool Win32Filesystem::CreateFolder(const Pathname &pathname) {
51 if (pathname.pathname().empty() || !pathname.filename().empty())
55 if (!Utf8ToWindowsFilename(pathname.pathname(), &path16))
69 if (!pathname.parent_folder().empty()) {
70 Pathname parent(pathname);
71 parent.SetFolder(pathname.parent_folder());
80 FileStream *Win32Filesystem::OpenFile(const Pathname &filename,
83 if (fs && !fs->Open(filename.pathname().c_str(), mode.c_str(), NULL)) {
90 bool Win32Filesystem::CreatePrivateFile(const Pathname &filename) {
180 ToUtf16(filename.pathname()).c_str(),
198 bool Win32Filesystem::DeleteFile(const Pathname &filename) {
199 LOG(LS_INFO) << "Deleting file " << filename.pathname();
204 return ::DeleteFile(ToUtf16(filename.pathname()).c_str()) != 0;
207 bool Win32Filesystem::DeleteEmptyFolder(const Pathname &folder) {
208 LOG(LS_INFO) << "Deleting folder " << folder.pathname();
210 std::string no_slash(folder.pathname(), 0, folder.pathname().length()-1);
214 bool Win32Filesystem::GetTemporaryFolder(Pathname &pathname, bool create,
228 pathname.clear();
229 pathname.SetFolder(ToUtf8(buffer));
232 pathname.AppendFolder(*append);
234 return !create || CreateFolder(pathname);
237 std::string Win32Filesystem::TempFilename(const Pathname &dir,
240 if (::GetTempFileName(ToUtf16(dir.pathname()).c_str(),
247 bool Win32Filesystem::MoveFile(const Pathname &old_path,
248 const Pathname &new_path) {
253 LOG(LS_INFO) << "Moving " << old_path.pathname()
254 << " to " << new_path.pathname();
255 return ::MoveFile(ToUtf16(old_path.pathname()).c_str(),
256 ToUtf16(new_path.pathname()).c_str()) != 0;
259 bool Win32Filesystem::MoveFolder(const Pathname &old_path,
260 const Pathname &new_path) {
265 LOG(LS_INFO) << "Moving " << old_path.pathname()
266 << " to " << new_path.pathname();
267 if (::MoveFile(ToUtf16(old_path.pathname()).c_str(),
268 ToUtf16(new_path.pathname()).c_str()) == 0) {
281 bool Win32Filesystem::IsFolder(const Pathname &path) {
283 if (0 == ::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(),
290 bool Win32Filesystem::IsFile(const Pathname &path) {
292 if (0 == ::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(),
298 bool Win32Filesystem::IsAbsent(const Pathname& path) {
300 if (0 != ::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(),
307 bool Win32Filesystem::CopyFile(const Pathname &old_path,
308 const Pathname &new_path) {
309 return ::CopyFile(ToUtf16(old_path.pathname()).c_str(),
310 ToUtf16(new_path.pathname()).c_str(), TRUE) != 0;
313 bool Win32Filesystem::IsTemporaryPath(const Pathname& pathname) {
320 return (::strnicmp(ToUtf16(pathname.pathname()).c_str(),
324 bool Win32Filesystem::GetFileSize(const Pathname &pathname, size_t *size) {
326 if (::GetFileAttributesEx(ToUtf16(pathname.pathname()).c_str(),
333 bool Win32Filesystem::GetFileTime(const Pathname& path, FileTimeType which,
336 if (::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(),
355 bool Win32Filesystem::GetAppPathname(Pathname* path) {
363 bool Win32Filesystem::GetAppDataFolder(Pathname* path, bool per_user) {
391 bool Win32Filesystem::GetAppTempFolder(Pathname* path) {
398 bool Win32Filesystem::GetDiskFreeSpace(const Pathname& path, int64 *freebytes) {
415 // TODO: Add method to Pathname to determine if the path is relative.
416 // TODO: Add method to Pathname to convert a path to absolute.
440 Pathname Win32Filesystem::GetCurrentDirectory() {
441 Pathname cwd;
449 return cwd; // returns empty pathname
466 std::wstring temp_path16 = ToUtf16(temp_path.pathname());