diff options
author | Jack Lloyd <[email protected]> | 2019-03-01 09:00:47 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-03-01 09:00:47 -0500 |
commit | 89b1838943e37b8f11b77f336691c9c6d250587b (patch) | |
tree | c113ee182197f7f54b58a6af00df3640a120ba04 /src/lib/base | |
parent | ff9174588a7ab7c1f7c2c88f24cb9a01dc6381f8 (diff) |
s/as_string/to_string/
A few older APIs use as_string where everywhere else uses to_string.
Add to_string's where missing, and deprecate X::as_string.
Diffstat (limited to 'src/lib/base')
-rw-r--r-- | src/lib/base/scan_name.cpp | 2 | ||||
-rw-r--r-- | src/lib/base/scan_name.h | 7 | ||||
-rw-r--r-- | src/lib/base/symkey.cpp | 2 | ||||
-rw-r--r-- | src/lib/base/symkey.h | 7 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/lib/base/scan_name.cpp b/src/lib/base/scan_name.cpp index 70c6e7f25..8a20caddb 100644 --- a/src/lib/base/scan_name.cpp +++ b/src/lib/base/scan_name.cpp @@ -123,7 +123,7 @@ std::string SCAN_Name::arg(size_t i) const { if(i >= arg_count()) throw Invalid_Argument("SCAN_Name::arg " + std::to_string(i) + - " out of range for '" + as_string() + "'"); + " out of range for '" + to_string() + "'"); return m_args[i]; } diff --git a/src/lib/base/scan_name.h b/src/lib/base/scan_name.h index 8aa45f50f..6194392f3 100644 --- a/src/lib/base/scan_name.h +++ b/src/lib/base/scan_name.h @@ -36,7 +36,12 @@ class BOTAN_PUBLIC_API(2,0) SCAN_Name final /** * @return original input string */ - const std::string& as_string() const { return m_orig_algo_spec; } + const std::string& to_string() const { return m_orig_algo_spec; } + + const std::string& BOTAN_DEPRECATED("Use SCAN_Name::to_string") as_string() const + { + return this->to_string(); + } /** * @return algorithm name diff --git a/src/lib/base/symkey.cpp b/src/lib/base/symkey.cpp index a012773ff..115c3ea67 100644 --- a/src/lib/base/symkey.cpp +++ b/src/lib/base/symkey.cpp @@ -74,7 +74,7 @@ void OctetString::set_odd_parity() /* * Hex encode an OctetString */ -std::string OctetString::as_string() const +std::string OctetString::to_string() const { return hex_encode(m_data.data(), m_data.size()); } diff --git a/src/lib/base/symkey.h b/src/lib/base/symkey.h index a010cc466..69becdd4e 100644 --- a/src/lib/base/symkey.h +++ b/src/lib/base/symkey.h @@ -43,7 +43,12 @@ class BOTAN_PUBLIC_API(2,0) OctetString final /** * @return this encoded as hex */ - std::string as_string() const; + std::string to_string() const; + + std::string BOTAN_DEPRECATED("Use OctetString::to_string") as_string() const + { + return this->to_string(); + } /** * XOR the contents of another octet string into this one |