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

Side by Side Diff: webkit/fileapi/media/picasa/pmp_column_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: Remove unused constant. 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 unified diff | Download patch
OLDNEW
(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_COLUMN_READER_H_
6 #define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_COLUMN_READER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "webkit/storage/webkit_storage_export.h"
14
15 namespace base {
16 class FilePath;
17 }
18
19 namespace fileapi {
20
21 // Reads a single PMP column from a file.
22 class WEBKIT_STORAGE_EXPORT_PRIVATE PmpColumnReader {
23 public:
24 PmpColumnReader();
25 virtual ~PmpColumnReader();
26
27 // Returns true if read successfully. |rows_read| undefined if returns false.
vandebo (ex-Chrome) 2013/03/29 21:35:07 nit: ...is undefined...
tommycli 2013/04/01 22:19:18 Done.
28 bool InitFromFile(const base::FilePath& filepath, uint32* rows_read);
vandebo (ex-Chrome) 2013/03/29 21:35:07 nit: Since there's only one Init method and it's c
tommycli 2013/04/01 22:19:18 Done.
29
30 // These functions read the value of that row into the |result| variable.
vandebo (ex-Chrome) 2013/03/29 21:35:07 nit: ..the value of |row| into |result|.
tommycli 2013/04/01 22:19:18 Done.
31 // Function returns false if the column is of the wrong type or the row
vandebo (ex-Chrome) 2013/03/29 21:35:07 nit: Functions return
tommycli 2013/04/01 22:19:18 Done.
32 // is out of range.
33 bool ReadString(const uint32 row, std::string* result) const;
34 bool ReadUInt32(const uint32 row, uint32* result) const;
35 bool ReadDouble64(const uint32 row, double* result) const;
36 bool ReadUInt8(const uint32 row, uint8* result) const;
37 bool ReadUInt64(const uint32 row, uint64* result) const;
38
39 const uint16 field_type() const {
vandebo (ex-Chrome) 2013/03/29 21:35:07 The native encoding of field_type is returned? Say
tommycli 2013/04/01 22:19:18 Done.
40 return field_type_;
41 }
42
43 private:
44 bool ParseData(uint32* rows_read);
45 bool IndexStrings();
46 template<class T> bool ValidatePrimitiveArrayLength();
47
48 scoped_array<uint8> data_;
vandebo (ex-Chrome) 2013/03/29 21:35:07 This is really nit picky, but is there any organiz
tommycli 2013/04/01 22:19:18 Done.
49 size_t length_;
50 uint32 rows_;
51
52 // Index of string start locations if fields are strings. Empty otherwise.
53 std::vector<const char*> strings_;
54
55 // Store type of field
56 uint16 field_type_;
57
58 DISALLOW_COPY_AND_ASSIGN(PmpColumnReader);
59 };
60
61 } // namespace fileapi
62
63 #endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_COLUMN_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698