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

Side by Side Diff: tools/gn/input_file.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months 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 | « tools/gn/function_read_file.cc ('k') | ui/gfx/color_profile_win.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "tools/gn/input_file.h" 5 #include "tools/gn/input_file.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 8
9 InputFile::InputFile(const SourceFile& name) 9 InputFile::InputFile(const SourceFile& name)
10 : name_(name), 10 : name_(name),
11 dir_(name_.GetDir()), 11 dir_(name_.GetDir()),
12 contents_loaded_(false) { 12 contents_loaded_(false) {
13 } 13 }
14 14
15 InputFile::~InputFile() { 15 InputFile::~InputFile() {
16 } 16 }
17 17
18 void InputFile::SetContents(const std::string& c) { 18 void InputFile::SetContents(const std::string& c) {
19 contents_loaded_ = true; 19 contents_loaded_ = true;
20 contents_ = c; 20 contents_ = c;
21 } 21 }
22 22
23 bool InputFile::Load(const base::FilePath& system_path) { 23 bool InputFile::Load(const base::FilePath& system_path) {
24 if (file_util::ReadFileToString(system_path, &contents_)) { 24 if (base::ReadFileToString(system_path, &contents_)) {
25 contents_loaded_ = true; 25 contents_loaded_ = true;
26 physical_name_ = system_path; 26 physical_name_ = system_path;
27 return true; 27 return true;
28 } 28 }
29 return false; 29 return false;
30 } 30 }
31 31
OLDNEW
« no previous file with comments | « tools/gn/function_read_file.cc ('k') | ui/gfx/color_profile_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698