Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Side by Side Diff: base/file_util.cc

Issue 9752: Added CreateTemporaryFileName that takes a FilePath argument. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <fstream> 9 #include <fstream>
10 10
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 return DirectoryExists(FilePath::FromWStringHack(path)); 336 return DirectoryExists(FilePath::FromWStringHack(path));
337 } 337 }
338 bool ContentsEqual(const std::wstring& filename1, 338 bool ContentsEqual(const std::wstring& filename1,
339 const std::wstring& filename2) { 339 const std::wstring& filename2) {
340 return ContentsEqual(FilePath::FromWStringHack(filename1), 340 return ContentsEqual(FilePath::FromWStringHack(filename1),
341 FilePath::FromWStringHack(filename2)); 341 FilePath::FromWStringHack(filename2));
342 } 342 }
343 bool CreateDirectory(const std::wstring& full_path) { 343 bool CreateDirectory(const std::wstring& full_path) {
344 return CreateDirectory(FilePath::FromWStringHack(full_path)); 344 return CreateDirectory(FilePath::FromWStringHack(full_path));
345 } 345 }
346 bool CreateTemporaryFileName(std::wstring* temp_file) {
347 FilePath temp_file_path;
348 if(!CreateTemporaryFileName(&temp_file_path))
Evan Martin 2008/11/10 23:45:35 space after if
349 return false;
350 *temp_file = temp_file_path.ToWStringHack();
351 return true;
352 }
346 bool GetCurrentDirectory(std::wstring* path_str) { 353 bool GetCurrentDirectory(std::wstring* path_str) {
347 FilePath path; 354 FilePath path;
348 if (!GetCurrentDirectory(&path)) 355 if (!GetCurrentDirectory(&path))
349 return false; 356 return false;
350 *path_str = path.ToWStringHack(); 357 *path_str = path.ToWStringHack();
351 return true; 358 return true;
352 } 359 }
353 bool GetFileInfo(const std::wstring& file_path, FileInfo* results) { 360 bool GetFileInfo(const std::wstring& file_path, FileInfo* results) {
354 return GetFileInfo(FilePath::FromWStringHack(file_path), results); 361 return GetFileInfo(FilePath::FromWStringHack(file_path), results);
355 } 362 }
356 bool GetFileSize(const std::wstring& file_path, int64* file_size) { 363 bool GetFileSize(const std::wstring& file_path, int64* file_size) {
357 return GetFileSize(FilePath::FromWStringHack(file_path), file_size); 364 return GetFileSize(FilePath::FromWStringHack(file_path), file_size);
358 } 365 }
359 bool GetTempDir(std::wstring* path_str) { 366 bool GetTempDir(std::wstring* path_str) {
360 FilePath path; 367 FilePath path;
361 if (!GetTempDir(&path)) 368 if (!GetTempDir(&path))
362 return false; 369 return false;
363 *path_str = path.ToWStringHack(); 370 *path_str = path.ToWStringHack();
364 return true; 371 return true;
365 } 372 }
366 373
367 } // namespace 374 } // namespace
368 375
OLDNEW
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698