diff options
author | lloyd <[email protected]> | 2008-04-07 05:18:57 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-04-07 05:18:57 +0000 |
commit | 29885981670e06413738458c11f632c5b87bb031 (patch) | |
tree | c6ab16b32b9673b5dc9c9709e73c09e50d12b3aa /src | |
parent | 4191064d79916508e531c4f28ddb244527f64d5c (diff) |
Remove Extensions::copy_this(). Define the Extensions copy constructor in
terms of Extensions::operator=
Diffstat (limited to 'src')
-rw-r--r-- | src/x509_ext.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/x509_ext.cpp b/src/x509_ext.cpp index 65ea2872c..197a86004 100644 --- a/src/x509_ext.cpp +++ b/src/x509_ext.cpp @@ -18,6 +18,29 @@ namespace Botan { /************************************************* +* Extensions Copy Constructor * +*************************************************/ +Extensions::Extensions(const Extensions& extensions) : ASN1_Object() + { + *this = extensions; + } + +/************************************************* +* Extensions Assignment Operator * +*************************************************/ +Extensions& Extensions::operator=(const Extensions& other) + { + for(u32bit j = 0; j != extensions.size(); ++j) + delete extensions[j]; + extensions.clear(); + + for(u32bit j = 0; j != other.extensions.size(); ++j) + extensions.push_back(other.extensions[j]->copy()); + + return (*this); + } + +/************************************************* * Return the OID of this extension * *************************************************/ OID Certificate_Extension::oid_of() const @@ -114,21 +137,6 @@ void Extensions::contents_to(Data_Store& subject_info, } /************************************************* -* Copy another extensions list * -*************************************************/ -Extensions& Extensions::copy_this(const Extensions& other) - { - for(u32bit j = 0; j != extensions.size(); ++j) - delete extensions[j]; - extensions.clear(); - - for(u32bit j = 0; j != other.extensions.size(); ++j) - extensions.push_back(other.extensions[j]->copy()); - - return (*this); - } - -/************************************************* * Delete an Extensions list * *************************************************/ Extensions::~Extensions() |