| OLD | NEW |
| (Empty) | |
| 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 #ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PICASA_ALBUM_TABLE_READER_H_ |
| 6 #define WEBKIT_FILEAPI_MEDIA_PICASA_PICASA_ALBUM_TABLE_READER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/files/file_path.h" |
| 10 #include "base/time.h" |
| 11 #include "webkit/storage/webkit_storage_export.h" |
| 12 |
| 13 namespace picasaimport { |
| 14 |
| 15 const char* kPicasaAlbumTableName = "albumdata"; |
| 16 |
| 17 const uint32 kAlbumCategoryUserAlbum = 0; |
| 18 const uint32 kAlbumCategoryFolder = 2; |
| 19 const uint32 kAlbumCategoryInvalid = 0xffff; // Sentinel value. |
| 20 |
| 21 const char* kAlbumTokenPrefix = "]album:"; |
| 22 |
| 23 struct AlbumInfo { |
| 24 AlbumInfo(const std::string& name, const base::Time& timestamp, |
| 25 const std::string& uid); |
| 26 |
| 27 std::string name; |
| 28 base::Time timestamp; |
| 29 std::string uid; |
| 30 }; |
| 31 |
| 32 struct FolderInfo { |
| 33 FolderInfo(const std::string& name, const base::Time& timestamp, |
| 34 const std::string& uid, const base::FilePath& path); |
| 35 |
| 36 std::string name; |
| 37 base::Time timestamp; |
| 38 std::string uid; |
| 39 base::FilePath path; |
| 40 }; |
| 41 |
| 42 class WEBKIT_STORAGE_EXPORT_PRIVATE PicasaAlbumTableReader { |
| 43 public: |
| 44 // |directory_path| is Picasa's db3 directory where the PMP table is stored. |
| 45 PicasaAlbumTableReader(const base::FilePath& directory_path); |
| 46 virtual ~PicasaAlbumTableReader(); |
| 47 |
| 48 virtual bool Init(); |
| 49 |
| 50 const std::vector<FolderInfo>& folders() const; |
| 51 |
| 52 const std::vector<AlbumInfo>& user_albums() const; |
| 53 |
| 54 private: |
| 55 const base::FilePath directory_path_; |
| 56 bool initialized_; |
| 57 |
| 58 std::vector<FolderInfo> folders_; |
| 59 std::vector<AlbumInfo> user_albums_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN (PicasaAlbumTableReader); |
| 62 }; |
| 63 |
| 64 } // namespace picasaimport |
| 65 |
| 66 #endif // WEBKIT_FILEAPI_MEDIA_PICASA_PICASA_ALBUM_TABLE_READER_H_ |
| OLD | NEW |