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

Side by Side Diff: base/big_endian.cc

Issue 427153002: Add unsigned 64-bit integer support to BigEndianReader and BigEndianWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « base/big_endian.h ('k') | base/big_endian_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "base/big_endian.h" 5 #include "base/big_endian.h"
6 6
7 #include "base/strings/string_piece.h" 7 #include "base/strings/string_piece.h"
8 8
9 namespace base { 9 namespace base {
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 bool BigEndianReader::ReadU16(uint16* value) { 50 bool BigEndianReader::ReadU16(uint16* value) {
51 return Read(value); 51 return Read(value);
52 } 52 }
53 53
54 bool BigEndianReader::ReadU32(uint32* value) { 54 bool BigEndianReader::ReadU32(uint32* value) {
55 return Read(value); 55 return Read(value);
56 } 56 }
57 57
58 bool BigEndianReader::ReadU64(uint64* value) {
59 return Read(value);
60 }
61
58 BigEndianWriter::BigEndianWriter(char* buf, size_t len) 62 BigEndianWriter::BigEndianWriter(char* buf, size_t len)
59 : ptr_(buf), end_(ptr_ + len) {} 63 : ptr_(buf), end_(ptr_ + len) {}
60 64
61 bool BigEndianWriter::Skip(size_t len) { 65 bool BigEndianWriter::Skip(size_t len) {
62 if (ptr_ + len > end_) 66 if (ptr_ + len > end_)
63 return false; 67 return false;
64 ptr_ += len; 68 ptr_ += len;
65 return true; 69 return true;
66 } 70 }
67 71
(...skipping 19 matching lines...) Expand all
87 } 91 }
88 92
89 bool BigEndianWriter::WriteU16(uint16 value) { 93 bool BigEndianWriter::WriteU16(uint16 value) {
90 return Write(value); 94 return Write(value);
91 } 95 }
92 96
93 bool BigEndianWriter::WriteU32(uint32 value) { 97 bool BigEndianWriter::WriteU32(uint32 value) {
94 return Write(value); 98 return Write(value);
95 } 99 }
96 100
101 bool BigEndianWriter::WriteU64(uint64 value) {
102 return Write(value);
103 }
104
97 } // namespace base 105 } // namespace base
OLDNEW
« no previous file with comments | « base/big_endian.h ('k') | base/big_endian_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698