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

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: Fix win test 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(uint64 id, const base::FilePath& location);
19 bool operator<(const Track& other) const;
20
21 uint64 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 ~ITunesLibraryParser();
31
32 // Returns true if at least one track was found. Malformed track entries
33 // are silently ignored.
34 bool Parse(const std::string& xml);
35
36 const Library& library() { return library_; }
37
38 private:
39 Library library_;
40
41 DISALLOW_COPY_AND_ASSIGN(ITunesLibraryParser);
42 };
43
44 } // namespace itunes
45
46 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ITUNES_LIBRARY_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698