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

Side by Side Diff: chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.h

Issue 17101030: Media Galleries API - Picasa: Change PMP Parsing to deal with PlatformFile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READER_ H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READER_ H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READER_ H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READER_ H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/platform_file.h"
10 #include "base/time.h" 11 #include "base/time.h"
11 12
12 namespace picasa { 13 namespace picasa {
13 14
14 const base::Time::Exploded kPicasaVariantTimeEpoch = { 15 const base::Time::Exploded kPicasaVariantTimeEpoch = {
15 1899, 12, 7, 30, // Dec 30, 1899 (Saturday) 16 1899, 12, 7, 30, // Dec 30, 1899 (Saturday)
16 0, 0, 0, 0 // 00:00:00.000 17 0, 0, 0, 0 // 00:00:00.000
17 }; 18 };
18 19
19 const char kPicasaAlbumTableName[] = "albumdata"; 20 const char kPicasaAlbumTableName[] = "albumdata";
(...skipping 10 matching lines...) Expand all
30 const std::string& uid, const base::FilePath& path); 31 const std::string& uid, const base::FilePath& path);
31 32
32 ~AlbumInfo(); 33 ~AlbumInfo();
33 34
34 std::string name; 35 std::string name;
35 base::Time timestamp; 36 base::Time timestamp;
36 std::string uid; 37 std::string uid;
37 base::FilePath path; 38 base::FilePath path;
38 }; 39 };
39 40
41 struct PicasaAlbumTableFiles {
42 explicit PicasaAlbumTableFiles(const base::FilePath& directory_path);
43
44 base::PlatformFile indicator_file;
45
46 base::PlatformFile category_file;
47 base::PlatformFile date_file;
48 base::PlatformFile filename_file;
49 base::PlatformFile name_file;
50 base::PlatformFile token_file;
51 base::PlatformFile uid_file;
52 };
53
40 class PicasaAlbumTableReader { 54 class PicasaAlbumTableReader {
41 public: 55 public:
42 // |directory_path| is Picasa's db3 directory where the PMP table is stored. 56 explicit PicasaAlbumTableReader(const PicasaAlbumTableFiles& table_files);
43 explicit PicasaAlbumTableReader(const base::FilePath& directory_path);
44 virtual ~PicasaAlbumTableReader(); 57 virtual ~PicasaAlbumTableReader();
45 58
46 bool Init(); 59 bool Init();
47 60
48 const std::vector<AlbumInfo>& albums() const; 61 const std::vector<AlbumInfo>& albums() const;
49 const std::vector<AlbumInfo>& folders() const; 62 const std::vector<AlbumInfo>& folders() const;
50 63
51 private: 64 private:
52 const base::FilePath directory_path_; 65 PicasaAlbumTableFiles table_files_;
53 66
54 bool initialized_; 67 bool initialized_;
55 68
56 std::vector<AlbumInfo> albums_; 69 std::vector<AlbumInfo> albums_;
57 std::vector<AlbumInfo> folders_; 70 std::vector<AlbumInfo> folders_;
58 71
59 DISALLOW_COPY_AND_ASSIGN(PicasaAlbumTableReader); 72 DISALLOW_COPY_AND_ASSIGN(PicasaAlbumTableReader);
60 }; 73 };
61 74
62 } // namespace picasa 75 } // namespace picasa
63 76
64 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READ ER_H_ 77 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READ ER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698