Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 NET_DER_INPUT_H_ | 5 #ifndef NET_DER_INPUT_H_ |
| 6 #define NET_DER_INPUT_H_ | 6 #define NET_DER_INPUT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 Input(); | 42 Input(); |
| 43 | 43 |
| 44 // Creates an Input from a constant array |data|. | 44 // Creates an Input from a constant array |data|. |
| 45 template <size_t N> | 45 template <size_t N> |
| 46 explicit Input(const uint8_t(&data)[N]) | 46 explicit Input(const uint8_t(&data)[N]) |
| 47 : data_(data), len_(N) {} | 47 : data_(data), len_(N) {} |
| 48 | 48 |
| 49 // Creates an Input from the given |data| and |len|. | 49 // Creates an Input from the given |data| and |len|. |
| 50 Input(const uint8_t* data, size_t len); | 50 Input(const uint8_t* data, size_t len); |
| 51 | 51 |
| 52 // Creates an Input from the given string |s|. | |
| 53 explicit Input(const std::string& s); | |
|
Ryan Sleevi
2015/07/07 14:07:31
Intentionally removed this API. I'm not keen to re
eroman
2015/07/07 18:07:00
Done.
Didn't realize it had been added and removed
| |
| 54 | |
| 52 // Returns the length in bytes of an Input's data. | 55 // Returns the length in bytes of an Input's data. |
| 53 size_t Length() const { return len_; } | 56 size_t Length() const { return len_; } |
| 54 | 57 |
| 55 // Return true if the Input's data and |other|'s data are byte-wise equal. | 58 // Return true if the Input's data and |other|'s data are byte-wise equal. |
| 56 bool Equals(const Input& other) const; | 59 bool Equals(const Input& other) const; |
| 57 | 60 |
| 58 // Returns a pointer to the Input's data. This method is marked as "unsafe" | 61 // Returns a pointer to the Input's data. This method is marked as "unsafe" |
| 59 // because access to the Input's data should be done through ByteReader | 62 // because access to the Input's data should be done through ByteReader |
| 60 // instead. This method should only be used where using a ByteReader truly | 63 // instead. This method should only be used where using a ByteReader truly |
| 61 // is not an option. | 64 // is not an option. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 explicit Mark(const uint8_t* ptr); | 151 explicit Mark(const uint8_t* ptr); |
| 149 Mark(); | 152 Mark(); |
| 150 const uint8_t* ptr_; | 153 const uint8_t* ptr_; |
| 151 }; | 154 }; |
| 152 | 155 |
| 153 } // namespace der | 156 } // namespace der |
| 154 | 157 |
| 155 } // namespace net | 158 } // namespace net |
| 156 | 159 |
| 157 #endif // NET_DER_INPUT_H_ | 160 #endif // NET_DER_INPUT_H_ |
| OLD | NEW |