| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 |
| 11 | #include "rtc_base/crypt_string.h" |
| 12 |
| 13 | namespace rtc { |
| 14 |
| 15 | size_t EmptyCryptStringImpl::GetLength() const { |
| 16 | return 0; |
| 17 | } |
| 18 |
| 19 | void EmptyCryptStringImpl::CopyTo(char* dest, bool nullterminate) const { |
| 20 | if (nullterminate) { |
| 21 | *dest = '\0'; |
| 22 | } |
| 23 | } |
| 24 |
| 25 | std::string EmptyCryptStringImpl::UrlEncode() const { |
| 26 | return ""; |
| 27 | } |
| 28 |
| 29 | CryptStringImpl* EmptyCryptStringImpl::Copy() const { |
| 30 | return new EmptyCryptStringImpl(); |
| 31 | } |
| 32 |
| 33 | void EmptyCryptStringImpl::CopyRawTo(std::vector<unsigned char>* dest) const { |
| 34 | dest->clear(); |
| 35 | } |
| 36 |
| 37 | CryptString::CryptString() : impl_(new EmptyCryptStringImpl()) {} |
| 38 |
| 39 | CryptString::CryptString(const CryptString& other) |
| 40 | : impl_(other.impl_->Copy()) {} |
| 41 |
| 42 | CryptString::CryptString(const CryptStringImpl& impl) : impl_(impl.Copy()) {} |
| 43 |
| 44 | CryptString::~CryptString() = default; |
| 45 |
| 46 | } // namespace rtc |
| 47 |