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

Side by Side Diff: chrome/browser/media_galleries/fileapi/itunes_library_parser.h

Issue 16231016: Extract track information from iTunes library xml file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698