| Index: webkit/fileapi/media/picasa/picasa_album_table_reader.h
|
| diff --git a/webkit/fileapi/media/picasa/picasa_album_table_reader.h b/webkit/fileapi/media/picasa/picasa_album_table_reader.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..56b7614de0dcf41001cfa432bb1415c18ed8d954
|
| --- /dev/null
|
| +++ b/webkit/fileapi/media/picasa/picasa_album_table_reader.h
|
| @@ -0,0 +1,66 @@
|
| +// 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.
|
| +
|
| +#ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PICASA_ALBUM_TABLE_READER_H_
|
| +#define WEBKIT_FILEAPI_MEDIA_PICASA_PICASA_ALBUM_TABLE_READER_H_
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/files/file_path.h"
|
| +#include "base/time.h"
|
| +#include "webkit/storage/webkit_storage_export.h"
|
| +
|
| +namespace picasaimport {
|
| +
|
| +const char* kPicasaAlbumTableName = "albumdata";
|
| +
|
| +const uint32 kAlbumCategoryUserAlbum = 0;
|
| +const uint32 kAlbumCategoryFolder = 2;
|
| +const uint32 kAlbumCategoryInvalid = 0xffff; // Sentinel value.
|
| +
|
| +const char* kAlbumTokenPrefix = "]album:";
|
| +
|
| +struct AlbumInfo {
|
| + AlbumInfo(const std::string& name, const base::Time& timestamp,
|
| + const std::string& uid);
|
| +
|
| + std::string name;
|
| + base::Time timestamp;
|
| + std::string uid;
|
| +};
|
| +
|
| +struct FolderInfo {
|
| + FolderInfo(const std::string& name, const base::Time& timestamp,
|
| + const std::string& uid, const base::FilePath& path);
|
| +
|
| + std::string name;
|
| + base::Time timestamp;
|
| + std::string uid;
|
| + base::FilePath path;
|
| +};
|
| +
|
| +class WEBKIT_STORAGE_EXPORT_PRIVATE PicasaAlbumTableReader {
|
| + public:
|
| + // |directory_path| is Picasa's db3 directory where the PMP table is stored.
|
| + PicasaAlbumTableReader(const base::FilePath& directory_path);
|
| + virtual ~PicasaAlbumTableReader();
|
| +
|
| + virtual bool Init();
|
| +
|
| + const std::vector<FolderInfo>& folders() const;
|
| +
|
| + const std::vector<AlbumInfo>& user_albums() const;
|
| +
|
| + private:
|
| + const base::FilePath directory_path_;
|
| + bool initialized_;
|
| +
|
| + std::vector<FolderInfo> folders_;
|
| + std::vector<AlbumInfo> user_albums_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN (PicasaAlbumTableReader);
|
| +};
|
| +
|
| +} // namespace picasaimport
|
| +
|
| +#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PICASA_ALBUM_TABLE_READER_H_
|
|
|