1*d9f75844SAndroid Build Coastguard Worker /* 2*d9f75844SAndroid Build Coastguard Worker * Copyright 2015 The WebRTC Project Authors. All rights reserved. 3*d9f75844SAndroid Build Coastguard Worker * 4*d9f75844SAndroid Build Coastguard Worker * Use of this source code is governed by a BSD-style license 5*d9f75844SAndroid Build Coastguard Worker * that can be found in the LICENSE file in the root of the source 6*d9f75844SAndroid Build Coastguard Worker * tree. An additional intellectual property rights grant can be found 7*d9f75844SAndroid Build Coastguard Worker * in the file PATENTS. All contributing project authors may 8*d9f75844SAndroid Build Coastguard Worker * be found in the AUTHORS file in the root of the source tree. 9*d9f75844SAndroid Build Coastguard Worker */ 10*d9f75844SAndroid Build Coastguard Worker 11*d9f75844SAndroid Build Coastguard Worker #include "rtc_base/crypt_string.h" 12*d9f75844SAndroid Build Coastguard Worker 13*d9f75844SAndroid Build Coastguard Worker namespace rtc { 14*d9f75844SAndroid Build Coastguard Worker GetLength() const15*d9f75844SAndroid Build Coastguard Workersize_t EmptyCryptStringImpl::GetLength() const { 16*d9f75844SAndroid Build Coastguard Worker return 0; 17*d9f75844SAndroid Build Coastguard Worker } 18*d9f75844SAndroid Build Coastguard Worker CopyTo(char * dest,bool nullterminate) const19*d9f75844SAndroid Build Coastguard Workervoid EmptyCryptStringImpl::CopyTo(char* dest, bool nullterminate) const { 20*d9f75844SAndroid Build Coastguard Worker if (nullterminate) { 21*d9f75844SAndroid Build Coastguard Worker *dest = '\0'; 22*d9f75844SAndroid Build Coastguard Worker } 23*d9f75844SAndroid Build Coastguard Worker } 24*d9f75844SAndroid Build Coastguard Worker UrlEncode() const25*d9f75844SAndroid Build Coastguard Workerstd::string EmptyCryptStringImpl::UrlEncode() const { 26*d9f75844SAndroid Build Coastguard Worker return ""; 27*d9f75844SAndroid Build Coastguard Worker } 28*d9f75844SAndroid Build Coastguard Worker Copy() const29*d9f75844SAndroid Build Coastguard WorkerCryptStringImpl* EmptyCryptStringImpl::Copy() const { 30*d9f75844SAndroid Build Coastguard Worker return new EmptyCryptStringImpl(); 31*d9f75844SAndroid Build Coastguard Worker } 32*d9f75844SAndroid Build Coastguard Worker CopyRawTo(std::vector<unsigned char> * dest) const33*d9f75844SAndroid Build Coastguard Workervoid EmptyCryptStringImpl::CopyRawTo(std::vector<unsigned char>* dest) const { 34*d9f75844SAndroid Build Coastguard Worker dest->clear(); 35*d9f75844SAndroid Build Coastguard Worker } 36*d9f75844SAndroid Build Coastguard Worker CryptString()37*d9f75844SAndroid Build Coastguard WorkerCryptString::CryptString() : impl_(new EmptyCryptStringImpl()) {} 38*d9f75844SAndroid Build Coastguard Worker CryptString(const CryptString & other)39*d9f75844SAndroid Build Coastguard WorkerCryptString::CryptString(const CryptString& other) 40*d9f75844SAndroid Build Coastguard Worker : impl_(other.impl_->Copy()) {} 41*d9f75844SAndroid Build Coastguard Worker CryptString(const CryptStringImpl & impl)42*d9f75844SAndroid Build Coastguard WorkerCryptString::CryptString(const CryptStringImpl& impl) : impl_(impl.Copy()) {} 43*d9f75844SAndroid Build Coastguard Worker 44*d9f75844SAndroid Build Coastguard Worker CryptString::~CryptString() = default; 45*d9f75844SAndroid Build Coastguard Worker 46*d9f75844SAndroid Build Coastguard Worker } // namespace rtc 47