Chromium Code Reviews| Index: chrome/browser/media_galleries/fileapi/itunes_library_parser.h |
| diff --git a/chrome/browser/media_galleries/fileapi/itunes_library_parser.h b/chrome/browser/media_galleries/fileapi/itunes_library_parser.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bb7b91b70e0c027f5675271b4f3cc57433485749 |
| --- /dev/null |
| +++ b/chrome/browser/media_galleries/fileapi/itunes_library_parser.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ITUNES_LIBRARY_PARSER_H_ |
| +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ITUNES_LIBRARY_PARSER_H_ |
| + |
| +#include <map> |
| +#include <set> |
| + |
| +#include "base/files/file_path.h" |
| + |
| +namespace itunes { |
| + |
| +class ITunesLibraryParser { |
| + public: |
| + struct Track { |
| + 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
|
| + bool operator<(const Track& other) const; |
| + |
| + uint32_t id; |
| + base::FilePath location; |
| + }; |
| + |
| + typedef std::set<Track> Album; |
| + typedef std::map<std::string /*album name*/, Album> Albums; |
| + typedef std::map<std::string /*artist name*/, Albums> Library; |
| + |
| + ITunesLibraryParser(); |
| + |
| + bool Parse(const std::string& xml); |
| + |
| + const Library& library() { return library_; } |
| + |
| + private: |
| + Library library_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ITunesLibraryParser); |
| +}; |
| + |
| +} // namespace itunes |
| + |
| +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ITUNES_LIBRARY_PARSER_H_ |