Chromium Code Reviews| Index: webkit/fileapi/media/picasa/pmp_table_reader.h |
| diff --git a/webkit/fileapi/media/picasa/pmp_table_reader.h b/webkit/fileapi/media/picasa/pmp_table_reader.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2d5550597401b54abc7d9f143339a399f0c77f1c |
| --- /dev/null |
| +++ b/webkit/fileapi/media/picasa/pmp_table_reader.h |
| @@ -0,0 +1,55 @@ |
| +// 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_PMP_TABLE_READER_H_ |
| +#define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/scoped_vector.h" |
| + |
| +namespace base { |
| +class FilePath; |
| +} |
| + |
| +namespace fileapi { |
| + |
| +class PmpColumnReader; |
| + |
| +class PmpTableReader { |
| + public: |
| + PmpTableReader(const std::string& table_name, |
| + const base::FilePath& directory_path, |
| + const std::vector<std::string>& columns); |
| + |
| + virtual ~PmpTableReader(); |
| + |
| + // |columns| parameter will define, in-order, the columns returned by |
| + // subsequent columns to GetColumns() if ReadFromDisk() succeeds. |
| + // Warning: Invalidates previously obtained pointers from GetColumns(). |
|
vandebo (ex-Chrome)
2013/03/28 00:56:04
It seems that this class doesn't need to be reusea
tommycli
2013/03/29 00:16:01
Done.
|
| + bool ReadFromDisk(); |
| + |
| + // Returns a const "view" of the current contents of |column_readers_|. |
| + // Warning: Calling ReadFromDisk() will invalidate pointers returned here. |
| + std::vector<const PmpColumnReader*> GetColumns() const; |
| + |
| + uint32 RowCount() const; |
| + |
| + private: |
| + const std::string& table_name_; |
| + const base::FilePath& directory_path_; |
| + const std::vector<std::string>& columns_; |
| + |
| + // Contains the last 'good' read of the disk. |
| + ScopedVector<PmpColumnReader> column_readers_; |
| + // Contains the number of rows obtained during the last 'good' read of disk. |
| + uint32 max_row_count_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PmpTableReader); |
| +}; |
| + |
| +} // namespace fileapi |
| + |
| +#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ |