OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (input_ != NULL) { | 76 if (input_ != NULL) { |
77 BackUpInputToCurrentPosition(); | 77 BackUpInputToCurrentPosition(); |
78 } | 78 } |
79 | 79 |
80 if (total_bytes_warning_threshold_ == -2) { | 80 if (total_bytes_warning_threshold_ == -2) { |
81 GOOGLE_LOG(WARNING) << "The total number of bytes read was " << total_bytes_
read_; | 81 GOOGLE_LOG(WARNING) << "The total number of bytes read was " << total_bytes_
read_; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 // Static. | 85 // Static. |
86 int const CodedInputStream::default_recursion_limit_ = 100; | 86 int CodedInputStream::default_recursion_limit_ = 100; |
87 | 87 |
88 | 88 |
89 void CodedOutputStream::EnableAliasing(bool enabled) { | 89 void CodedOutputStream::EnableAliasing(bool enabled) { |
90 aliasing_enabled_ = enabled && output_->AllowsAliasing(); | 90 aliasing_enabled_ = enabled && output_->AllowsAliasing(); |
91 } | 91 } |
92 | 92 |
93 void CodedInputStream::BackUpInputToCurrentPosition() { | 93 void CodedInputStream::BackUpInputToCurrentPosition() { |
94 int backup_bytes = BufferSize() + buffer_size_after_limit_ + overflow_bytes_; | 94 int backup_bytes = BufferSize() + buffer_size_after_limit_ + overflow_bytes_; |
95 if (backup_bytes > 0) { | 95 if (backup_bytes > 0) { |
96 input_->BackUp(backup_bytes); | 96 input_->BackUp(backup_bytes); |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 uint8* CodedOutputStream::WriteStringWithSizeToArray(const string& str, | 908 uint8* CodedOutputStream::WriteStringWithSizeToArray(const string& str, |
909 uint8* target) { | 909 uint8* target) { |
910 GOOGLE_DCHECK_LE(str.size(), kuint32max); | 910 GOOGLE_DCHECK_LE(str.size(), kuint32max); |
911 target = WriteVarint32ToArray(str.size(), target); | 911 target = WriteVarint32ToArray(str.size(), target); |
912 return WriteStringToArray(str, target); | 912 return WriteStringToArray(str, target); |
913 } | 913 } |
914 | 914 |
915 } // namespace io | 915 } // namespace io |
916 } // namespace protobuf | 916 } // namespace protobuf |
917 } // namespace google | 917 } // namespace google |
OLD | NEW |