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

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

Issue 12704024: Simple PMP reader to parse Picasa's metadata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More formatting/ style changes. Created 7 years, 9 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_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..4dd374dfb66e251c0ada492d5e68455000afcc74
--- /dev/null
+++ b/webkit/fileapi/media/picasa/pmp_table_reader.h
@@ -0,0 +1,54 @@
+// 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 <vector>
+
+#include "base/basictypes.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace fileapi {
+
+class PmpColumnReader;
+
+class PmpTableReader {
+ public:
+ explicit PmpTableReader();
vandebo (ex-Chrome) 2013/03/27 00:06:19 explicit is only needed for exactly one arg.
tommycli 2013/03/27 19:34:30 Done.
+
+ 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().
+ bool ReadFromDisk(
vandebo (ex-Chrome) 2013/03/27 00:06:19 Why not put all these args in the constructor?
vandebo (ex-Chrome) 2013/03/27 00:06:19 If this interface reads from disk, it seems like t
tommycli 2013/03/27 19:34:30 Done.
tommycli 2013/03/27 19:34:30 Done.
+ const std::string& table_name,
+ const base::FilePath& directory_path,
+ const std::vector<std::string>& columns);
+
+ // 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 Count() const;
vandebo (ex-Chrome) 2013/03/27 00:06:19 ColumnCount?
tommycli 2013/03/27 19:34:30 Done.
+
+ private:
+ static void FreeAndClearContents(std::vector<PmpColumnReader*> readers);
+
+ // Contains the last 'good' read of the disk.
+ std::vector<PmpColumnReader*> column_readers_;
vandebo (ex-Chrome) 2013/03/27 00:06:19 probably want to use base/memory/scoped_vector.h h
tommycli 2013/03/27 19:34:30 Yep! That's what I want. Btw - awesome that it imp
+ // 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_

Powered by Google App Engine
This is Rietveld 408576698