| Index: chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h
|
| diff --git a/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h
|
| index 19ec1d5b5832d4db6800911930f487792eebdec6..98212dfe1bdcea14190496bd0f60bd110eb1dd35 100644
|
| --- a/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h
|
| +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/platform_file.h"
|
| #include "chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h"
|
|
|
| namespace base {
|
| @@ -26,20 +27,22 @@ class PmpColumnReader {
|
|
|
| // Returns true if read successfully.
|
| // |rows_read| is undefined if returns false.
|
| - bool Init(const base::FilePath& filepath, const PmpFieldType expected_type,
|
| - uint32* rows_read);
|
| + bool ReadFile(base::PlatformFile file, const PmpFieldType expected_type);
|
|
|
| // These functions read the value of that |row| into |result|.
|
| // Functions return false if the column is of the wrong type or the row
|
| - // is out of range.
|
| + // is out of range. May only be called after successful ReadColumn.
|
| bool ReadString(const uint32 row, std::string* result) const;
|
| bool ReadUInt32(const uint32 row, uint32* result) const;
|
| bool ReadDouble64(const uint32 row, double* result) const;
|
| bool ReadUInt8(const uint32 row, uint8* result) const;
|
| bool ReadUInt64(const uint32 row, uint64* result) const;
|
|
|
| + // May only be called after successful ReadColumn.
|
| + uint32 rows_read() const;
|
| +
|
| private:
|
| - bool ParseData(const PmpFieldType expected_type, uint32* rows_read);
|
| + bool ParseData(const PmpFieldType expected_type);
|
| // Returns the number of bytes parsed in the body, or, -1 on failure.
|
| int64 IndexStrings();
|
|
|
| @@ -49,7 +52,7 @@ class PmpColumnReader {
|
|
|
| // Header data
|
| PmpFieldType field_type_;
|
| - uint32 rows_;
|
| + uint32 rows_read_;
|
|
|
| // Index of string start locations if fields are strings. Empty otherwise.
|
| std::vector<const char*> strings_;
|
|
|