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

Side by Side Diff: power_prefs.cc

Issue 2689004: Convert 'char *' to 'char*' throughout power manager. (Closed) Base URL: ssh://git@chromiumos-git/power_manager.git
Patch Set: Created 10 years, 6 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
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 "power_manager/power_prefs.h" 5 #include "power_manager/power_prefs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
tfarina 2010/06/05 01:08:56 sort these alphabetical.
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 12
13 using std::string; 13 using std::string;
tfarina 2010/06/05 01:08:56 can we get rid of this using? there are just to ca
14 14
15 namespace power_manager { 15 namespace power_manager {
16 16
17 PowerPrefs::PowerPrefs(const FilePath& base_path) 17 PowerPrefs::PowerPrefs(const FilePath& base_path)
18 : base_path_(base_path) {} 18 : base_path_(base_path) {}
19 19
20 bool PowerPrefs::ReadSetting(const char* setting_name, int64 *val) { 20 bool PowerPrefs::ReadSetting(const char* setting_name, int64* val) {
21 FilePath path = base_path_.Append(setting_name); 21 FilePath path = base_path_.Append(setting_name);
tfarina 2010/06/05 01:08:56 David, I was going to do this change, but since I'
22 string buf; 22 string buf;
23 if (!file_util::ReadFileToString(path, &buf)) 23 if (!file_util::ReadFileToString(path, &buf))
24 return false; 24 return false;
25 TrimWhitespaceASCII(buf, TRIM_TRAILING, &buf); 25 TrimWhitespaceASCII(buf, TRIM_TRAILING, &buf);
26 return StringToInt64(buf, val); 26 return StringToInt64(buf, val);
27 } 27 }
28 28
29 bool PowerPrefs::WriteSetting(const char* setting_name, int64 val) { 29 bool PowerPrefs::WriteSetting(const char* setting_name, int64 val) {
30 FilePath path = base_path_.Append(setting_name); 30 FilePath path = base_path_.Append(setting_name);
31 string buf = Int64ToString(val); 31 string buf = Int64ToString(val);
32 return -1 != file_util::WriteFile(path, buf.data(), buf.size()); 32 return -1 != file_util::WriteFile(path, buf.data(), buf.size());
33 } 33 }
34 34
35 } // namespace power_manager 35 } // namespace power_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698