Home | History | Annotate | Download | only in media_galleries
      1 // Copyright 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 // These data structures can be used to describe the contents of an iPhoto
      6 // library.
      7 
      8 #ifndef CHROME_COMMON_MEDIA_GALLERIES_IPHOTO_LIBRARY_H_
      9 #define CHROME_COMMON_MEDIA_GALLERIES_IPHOTO_LIBRARY_H_
     10 
     11 #include <map>
     12 #include <set>
     13 
     14 #include "base/files/file_path.h"
     15 
     16 namespace iphoto {
     17 namespace parser {
     18 
     19 struct Photo {
     20   Photo();
     21   Photo(uint64 id,
     22         const base::FilePath& location,
     23         const base::FilePath& original_location);
     24   bool operator<(const Photo& other) const;
     25 
     26   uint64 id;
     27   base::FilePath location;
     28   base::FilePath original_location;
     29 };
     30 
     31 typedef std::set<uint64> Album;
     32 typedef std::map<std::string /*album name*/, Album> Albums;
     33 
     34 struct Library {
     35   Library();
     36   Library(const Albums& albums, const std::set<Photo>& all_photos);
     37   ~Library();
     38 
     39   Albums albums;
     40   std::set<Photo> all_photos;
     41 };
     42 
     43 }  // namespace parser
     44 }  // namespace iphoto
     45 
     46 #endif  // CHROME_COMMON_MEDIA_GALLERIES_IPHOTO_LIBRARY_H_
     47 
     48