summaryrefslogtreecommitdiffstats
path: root/chrome/common/media_galleries/iphoto_library.h
blob: 00e8758a429dcaffc184989d867e7199ba48bb83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 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.

// These data structures can be used to describe the contents of an iPhoto
// library.

#ifndef CHROME_COMMON_MEDIA_GALLERIES_IPHOTO_LIBRARY_H_
#define CHROME_COMMON_MEDIA_GALLERIES_IPHOTO_LIBRARY_H_

#include <map>
#include <set>

#include "base/files/file_path.h"

namespace iphoto {
namespace parser {

struct Photo {
  Photo();
  Photo(uint64 id,
        const base::FilePath& location,
        const base::FilePath& original_location);
  bool operator<(const Photo& other) const;

  uint64 id;
  base::FilePath location;
  base::FilePath original_location;
};

typedef std::set<uint64> Album;
typedef std::map<std::string /*album name*/, Album> Albums;

struct Library {
  Library();
  Library(const Albums& albums, const std::set<Photo>& all_photos);
  ~Library();

  Albums albums;
  std::set<Photo> all_photos;
};

}  // namespace parser
}  // namespace iphoto

#endif  // CHROME_COMMON_MEDIA_GALLERIES_IPHOTO_LIBRARY_H_