Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ITUNES_LIBRARY_PARSER_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ITUNES_LIBRARY_PARSER_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <set> | |
| 10 | |
| 11 #include "base/files/file_path.h" | |
| 12 | |
| 13 namespace itunes { | |
| 14 | |
| 15 class ITunesLibraryParser { | |
| 16 public: | |
| 17 struct Track { | |
| 18 Track(uint32_t id, const base::FilePath& location); | |
|
Lei Zhang
2013/05/31 04:34:35
You may need uint32 instead to be x-platform? Try
vandebo (ex-Chrome)
2013/05/31 21:41:12
Fixed. Changed to uint64 (plist integers can be 6
| |
| 19 bool operator<(const Track& other) const; | |
| 20 | |
| 21 uint32_t id; | |
| 22 base::FilePath location; | |
| 23 }; | |
| 24 | |
| 25 typedef std::set<Track> Album; | |
| 26 typedef std::map<std::string /*album name*/, Album> Albums; | |
| 27 typedef std::map<std::string /*artist name*/, Albums> Library; | |
| 28 | |
| 29 ITunesLibraryParser(); | |
| 30 | |
| 31 bool Parse(const std::string& xml); | |
| 32 | |
| 33 const Library& library() { return library_; } | |
| 34 | |
| 35 private: | |
| 36 Library library_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(ITunesLibraryParser); | |
| 39 }; | |
| 40 | |
| 41 } // namespace itunes | |
| 42 | |
| 43 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ITUNES_LIBRARY_PARSER_H_ | |
| OLD | NEW |