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

Side by Side Diff: chrome/utility/media_galleries/pmp_column_reader.h

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_PMP_COLUMN_READER_H_ 5 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_PMP_COLUMN_READER_H_
6 #define CHROME_UTILITY_MEDIA_GALLERIES_PMP_COLUMN_READER_H_ 6 #define CHROME_UTILITY_MEDIA_GALLERIES_PMP_COLUMN_READER_H_
7 7
8 #include <stdint.h>
9
8 #include <string> 10 #include <string>
9 #include <vector> 11 #include <vector>
10 12
11 #include "base/basictypes.h" 13 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
13 #include "chrome/common/media_galleries/pmp_constants.h" 15 #include "chrome/common/media_galleries/pmp_constants.h"
14 16
15 namespace base { 17 namespace base {
16 class File; 18 class File;
17 class FilePath; 19 class FilePath;
18 } 20 }
19 21
20 namespace picasa { 22 namespace picasa {
21 23
22 // Reads a single PMP column from a file. 24 // Reads a single PMP column from a file.
23 class PmpColumnReader { 25 class PmpColumnReader {
24 public: 26 public:
25 PmpColumnReader(); 27 PmpColumnReader();
26 virtual ~PmpColumnReader(); 28 virtual ~PmpColumnReader();
27 29
28 // Returns true if read successfully. 30 // Returns true if read successfully.
29 // |rows_read| is undefined if returns false. 31 // |rows_read| is undefined if returns false.
30 bool ReadFile(base::File* file, const PmpFieldType expected_type); 32 bool ReadFile(base::File* file, const PmpFieldType expected_type);
31 33
32 // These functions read the value of that |row| into |result|. 34 // These functions read the value of that |row| into |result|.
33 // Functions return false if the column is of the wrong type or the row 35 // Functions return false if the column is of the wrong type or the row
34 // is out of range. May only be called after successful ReadColumn. 36 // is out of range. May only be called after successful ReadColumn.
35 bool ReadString(const uint32 row, std::string* result) const; 37 bool ReadString(const uint32_t row, std::string* result) const;
36 bool ReadUInt32(const uint32 row, uint32* result) const; 38 bool ReadUInt32(const uint32_t row, uint32_t* result) const;
37 bool ReadDouble64(const uint32 row, double* result) const; 39 bool ReadDouble64(const uint32_t row, double* result) const;
38 bool ReadUInt8(const uint32 row, uint8* result) const; 40 bool ReadUInt8(const uint32_t row, uint8_t* result) const;
39 bool ReadUInt64(const uint32 row, uint64* result) const; 41 bool ReadUInt64(const uint32_t row, uint64_t* result) const;
40 42
41 // May only be called after successful ReadColumn. 43 // May only be called after successful ReadColumn.
42 uint32 rows_read() const; 44 uint32_t rows_read() const;
43 45
44 private: 46 private:
45 bool ParseData(const PmpFieldType expected_type); 47 bool ParseData(const PmpFieldType expected_type);
46 // Returns the number of bytes parsed in the body, or, -1 on failure. 48 // Returns the number of bytes parsed in the body, or, -1 on failure.
47 int64 IndexStrings(); 49 int64_t IndexStrings();
48 50
49 // Source data 51 // Source data
50 scoped_ptr<uint8[]> data_; 52 scoped_ptr<uint8_t[]> data_;
51 int64 length_; 53 int64_t length_;
52 54
53 // Header data 55 // Header data
54 PmpFieldType field_type_; 56 PmpFieldType field_type_;
55 uint32 rows_read_; 57 uint32_t rows_read_;
56 58
57 // Index of string start locations if fields are strings. Empty otherwise. 59 // Index of string start locations if fields are strings. Empty otherwise.
58 std::vector<const char*> strings_; 60 std::vector<const char*> strings_;
59 61
60 DISALLOW_COPY_AND_ASSIGN(PmpColumnReader); 62 DISALLOW_COPY_AND_ASSIGN(PmpColumnReader);
61 }; 63 };
62 64
63 } // namespace picasa 65 } // namespace picasa
64 66
65 #endif // CHROME_UTILITY_MEDIA_GALLERIES_PMP_COLUMN_READER_H_ 67 #endif // CHROME_UTILITY_MEDIA_GALLERIES_PMP_COLUMN_READER_H_
OLDNEW
« no previous file with comments | « chrome/utility/media_galleries/picasa_albums_indexer.h ('k') | chrome/utility/media_galleries/pmp_column_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698