| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <iostream> | 5 #include <iostream> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 | 7 |
| 8 #include "chrome/browser/parsers/metadata_parser_filebase.h" | 8 #include "chrome/browser/parsers/metadata_parser_filebase.h" |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
| 25 value = WideToUTF8(path_.BaseName().value()); | 25 value = WideToUTF8(path_.BaseName().value()); |
| 26 properties_[MetadataParser::kPropertyTitle] = value; | 26 properties_[MetadataParser::kPropertyTitle] = value; |
| 27 #elif defined(OS_POSIX) | 27 #elif defined(OS_POSIX) |
| 28 properties_[MetadataParser::kPropertyTitle] = path_.BaseName().value(); | 28 properties_[MetadataParser::kPropertyTitle] = path_.BaseName().value(); |
| 29 #endif | 29 #endif |
| 30 return true; | 30 return true; |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool FileMetadataParser::GetProperty(const std::string&key, | 33 bool FileMetadataParser::GetProperty(const std::string& key, |
| 34 std::string* value) { | 34 std::string* value) { |
| 35 PropertyMap::iterator it = properties_.find(key.c_str()); | 35 PropertyMap::iterator it = properties_.find(key.c_str()); |
| 36 if (it == properties_.end()) { | 36 if (it == properties_.end()) { |
| 37 return false; | 37 return false; |
| 38 } | 38 } |
| 39 | 39 |
| 40 *value = properties_[key.c_str()]; | 40 *value = properties_[key.c_str()]; |
| 41 return true; | 41 return true; |
| 42 } | 42 } |
| 43 | 43 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 65 return properties_.size(); | 65 return properties_.size(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool FileMetadataPropertyIterator::IsEnd() { | 68 bool FileMetadataPropertyIterator::IsEnd() { |
| 69 if (it == properties_.end()) { | 69 if (it == properties_.end()) { |
| 70 return true; | 70 return true; |
| 71 } else { | 71 } else { |
| 72 return false; | 72 return false; |
| 73 } | 73 } |
| 74 } | 74 } |
| OLD | NEW |