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

Side by Side Diff: chrome/browser/parsers/metadata_parser_filebase.cc

Issue 3056029: Move the number conversions from string_util to a new file.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/parsers/metadata_parser_filebase.h" 5 #include "chrome/browser/parsers/metadata_parser_filebase.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/string_util.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 10
11 FileMetadataParser::FileMetadataParser(const FilePath& path) 11 FileMetadataParser::FileMetadataParser(const FilePath& path)
12 : MetadataParser(path) { 12 : MetadataParser(path) {
13 path_ = path; 13 path_ = path;
14 } 14 }
15 15
16 bool FileMetadataParser::Parse() { 16 bool FileMetadataParser::Parse() {
17 std::string value; 17 std::string value;
18 int64 size; 18 int64 size;
19 if (file_util::GetFileSize(path_, &size)) { 19 if (file_util::GetFileSize(path_, &size)) {
20 properties_[MetadataParser::kPropertyFilesize] = Int64ToString(size); 20 properties_[MetadataParser::kPropertyFilesize] = base::Int64ToString(size);
21 } 21 }
22 #if defined(OS_WIN) 22 #if defined(OS_WIN)
23 value = WideToUTF8(path_.BaseName().value()); 23 value = WideToUTF8(path_.BaseName().value());
24 properties_[MetadataParser::kPropertyTitle] = value; 24 properties_[MetadataParser::kPropertyTitle] = value;
25 #elif defined(OS_POSIX) 25 #elif defined(OS_POSIX)
26 properties_[MetadataParser::kPropertyTitle] = path_.BaseName().value(); 26 properties_[MetadataParser::kPropertyTitle] = path_.BaseName().value();
27 #endif 27 #endif
28 return true; 28 return true;
29 } 29 }
30 30
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return properties_.size(); 63 return properties_.size();
64 } 64 }
65 65
66 bool FileMetadataPropertyIterator::IsEnd() { 66 bool FileMetadataPropertyIterator::IsEnd() {
67 if (it == properties_.end()) { 67 if (it == properties_.end()) {
68 return true; 68 return true;
69 } else { 69 } else {
70 return false; 70 return false;
71 } 71 }
72 } 72 }
OLDNEW
« no previous file with comments | « chrome/browser/page_state.cc ('k') | chrome/browser/parsers/metadata_parser_filebase_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698