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

Unified Diff: webkit/fileapi/media/picasa/pmp_column_reader.h

Issue 13529028: PicasaAlbumTableReader for Media Galleries API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0005-picasa-import-pmp-reader
Patch Set: Remove PmpTableReader::Init, fix up some tests Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: webkit/fileapi/media/picasa/pmp_column_reader.h
diff --git a/webkit/fileapi/media/picasa/pmp_column_reader.h b/webkit/fileapi/media/picasa/pmp_column_reader.h
index 126657421df75c498d7bc654e75380d7d2e9a6c1..663c897673ea19cbd5e0ff90168265788d9133ae 100644
--- a/webkit/fileapi/media/picasa/pmp_column_reader.h
+++ b/webkit/fileapi/media/picasa/pmp_column_reader.h
@@ -22,12 +22,13 @@ namespace picasaimport {
// Reads a single PMP column from a file.
class WEBKIT_STORAGE_EXPORT_PRIVATE PmpColumnReader {
public:
- PmpColumnReader();
+ PmpColumnReader(const std::string& column_name);
virtual ~PmpColumnReader();
// Returns true if read successfully.
// |rows_read| is undefined if returns false.
- bool Init(const base::FilePath& filepath, uint32* rows_read);
+ bool Init(const base::FilePath& filepath, const PmpFieldType expected_type,
+ uint32* rows_read);
// These functions read the value of that |row| into |result|.
// Functions return false if the column is of the wrong type or the row
@@ -38,16 +39,17 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE PmpColumnReader {
bool ReadUInt8(const uint32 row, uint8* result) const;
bool ReadUInt64(const uint32 row, uint64* result) const;
- // Returns the native encoding of field_type.
- PmpFieldType field_type() const {
- return field_type_;
+ const std::string& column_name() {
+ return column_name_;
}
private:
- bool ParseData(uint32* rows_read);
+ bool ParseData(const PmpFieldType expected_type, uint32* rows_read);
// Returns the number of bytes parsed in the body, or, -1 on failure.
long IndexStrings();
+ std::string column_name_;
+
// Source data
scoped_array<uint8> data_;
size_t length_;

Powered by Google App Engine
This is Rietveld 408576698