Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ | |
| 6 #define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/memory/scoped_vector.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class FilePath; | |
| 15 } | |
| 16 | |
| 17 namespace fileapi { | |
| 18 | |
| 19 class PmpColumnReader; | |
| 20 | |
| 21 class PmpTableReader { | |
| 22 public: | |
| 23 PmpTableReader(const std::string& table_name, | |
| 24 const base::FilePath& directory_path, | |
| 25 const std::vector<std::string>& columns); | |
| 26 | |
| 27 virtual ~PmpTableReader(); | |
| 28 | |
| 29 // |columns| parameter will define, in-order, the columns returned by | |
| 30 // subsequent columns to GetColumns() if ReadFromDisk() succeeds. | |
| 31 // 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.
| |
| 32 bool ReadFromDisk(); | |
| 33 | |
| 34 // Returns a const "view" of the current contents of |column_readers_|. | |
| 35 // Warning: Calling ReadFromDisk() will invalidate pointers returned here. | |
| 36 std::vector<const PmpColumnReader*> GetColumns() const; | |
| 37 | |
| 38 uint32 RowCount() const; | |
| 39 | |
| 40 private: | |
| 41 const std::string& table_name_; | |
| 42 const base::FilePath& directory_path_; | |
| 43 const std::vector<std::string>& columns_; | |
| 44 | |
| 45 // Contains the last 'good' read of the disk. | |
| 46 ScopedVector<PmpColumnReader> column_readers_; | |
| 47 // Contains the number of rows obtained during the last 'good' read of disk. | |
| 48 uint32 max_row_count_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(PmpTableReader); | |
| 51 }; | |
| 52 | |
| 53 } // namespace fileapi | |
| 54 | |
| 55 #endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ | |
| OLD | NEW |