![]() |
MySQL 9.4.0
Source Code Documentation
|
Null-terminated string which is securely wiped on destruction. More...
#include <secure_string.h>
Classes | |
| struct | Alloc |
Public Types | |
| using | traits_type = Traits |
| using | value_type = Traits::char_type |
| using | allocator_type = Allocator |
| using | size_type = AllocatorTraits::size_type |
| using | difference_type = AllocatorTraits::difference_type |
| using | reference = value_type & |
| using | const_reference = const value_type & |
| using | pointer = AllocatorTraits::pointer |
| using | const_pointer = AllocatorTraits::const_pointer |
Public Member Functions | |
| SecureString () noexcept | |
| Default constructor. More... | |
| SecureString (const allocator_type &alloc) noexcept | |
| Constructor with an allocator. More... | |
| SecureString (pointer ptr, size_type length, const allocator_type &alloc=allocator_type()) | |
Copies the provided string, wiping the memory pointed by ptr. More... | |
| template<typename InputIt > | |
| SecureString (InputIt first, InputIt last, const allocator_type &alloc=allocator_type()) | |
Copies the provided string, wiping the memory between first and last. More... | |
| assign (s.data(), s.length()+1) | |
| wipe (s.data(), s.length()) | |
| s | clear () |
| SecureString (const SecureString &ss) | |
| Copy constructor. More... | |
| SecureString (SecureString &&ss) noexcept | |
| Move constructor. More... | |
| template<class StringTraits = std::char_traits<value_type>, class StringAllocator = std::allocator<value_type>> requires SameValueType<value_type, StringTraits, StringAllocator> | |
| SecureString & | operator= (std::basic_string< value_type, StringTraits, StringAllocator > &&s) |
| Copies the provided string, wiping its memory. More... | |
| SecureString & | operator= (const SecureString &ss) |
| Copy assignment operator. More... | |
| SecureString & | operator= (SecureString &&ss) noexcept |
| Move assignment operator. More... | |
| ~SecureString () | |
| Releases the string, securely wiping the data. More... | |
| const_pointer | c_str () const noexcept |
| Provides pointer to the stored string. More... | |
| size_type | length () const noexcept |
| Provides length to the stored string. More... | |
| size_type | size () const noexcept |
| bool | empty () const noexcept |
| Checks if the stored string is empty. More... | |
| void | swap (SecureString &ss) noexcept |
| Swaps the contents of this string with the provided one. More... | |
| void | clear () noexcept |
| Clears the string, securely wiping the data. More... | |
Public Attributes | |
| template<class StringTraits = std::char_traits<value_type>, class StringAllocator = std::allocator<value_type>> | |
| __pad0__: data_(alloc) { if (!s.empty()) { allocate(s.length()) | |
| Copies the provided string, wiping its memory. More... | |
| else | |
Private Types | |
| using | AllocatorTraits = std::allocator_traits< Allocator > |
Private Member Functions | |
| const allocator_type & | allocator () const noexcept |
| allocator_type & | allocator () noexcept |
| const_pointer | data () const noexcept |
| pointer | data () noexcept |
| void | set_data (pointer ptr) noexcept |
| void | set_length (size_type length) noexcept |
| void | allocate (size_type length) |
| void | assign (const_pointer ptr, size_type length) |
| void | set_empty () noexcept |
Static Private Member Functions | |
| static constexpr bool | propagate_on_copy () noexcept |
| static constexpr bool | propagate_on_move () noexcept |
| static constexpr bool | propagate_on_swap () noexcept |
| static void | wipe (pointer ptr, size_type length) noexcept |
Private Attributes | |
| Alloc | data_ |
| size_type | length_ |
Static Private Attributes | |
| static constexpr value_type | kNull {} |
Friends | |
| bool | operator== (const SecureString &l, const SecureString &r) noexcept |
| Comparison operators. More... | |
| bool | operator!= (const SecureString &l, const SecureString &r) noexcept |
Null-terminated string which is securely wiped on destruction.
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::allocator_type = Allocator |
|
private |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::const_pointer = AllocatorTraits::const_pointer |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::const_reference = const value_type & |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::difference_type = AllocatorTraits::difference_type |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::pointer = AllocatorTraits::pointer |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::reference = value_type & |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::size_type = AllocatorTraits::size_type |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::traits_type = Traits |
| using mysql_harness::detail::SecureString< CharT, Traits, Allocator >::value_type = Traits::char_type |
|
inlinenoexcept |
Default constructor.
|
inlineexplicitnoexcept |
Constructor with an allocator.
|
inline |
Copies the provided string, wiping the memory pointed by ptr.
| ptr | Pointer to an array of characters. |
| length | Number of characters in the array. |
| alloc | Allocator to use. |
|
inline |
Copies the provided string, wiping the memory between first and last.
| first | Beginning of a range. |
| last | End of a range. |
| alloc | Allocator to use. |
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
|
inline |
Releases the string, securely wiping the data.
|
inlineprivate |
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
inlineprivate |
| mysql_harness::detail::SecureString< CharT, Traits, Allocator >::assign | ( | s. | data(), |
| s.length()+ | 1 | ||
| ) |
|
inlinenoexcept |
Provides pointer to the stored string.
| s mysql_harness::detail::SecureString< CharT, Traits, Allocator >::clear | ( | ) |
|
inlinenoexcept |
Clears the string, securely wiping the data.
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
inlinenoexcept |
Checks if the stored string is empty.
|
inlinenoexcept |
Provides length to the stored string.
|
inline |
Copy assignment operator.
|
inlinenoexcept |
Move assignment operator.
|
inline |
Copies the provided string, wiping its memory.
| s | String to be copied. |
|
inlinestaticconstexprprivatenoexcept |
|
inlinestaticconstexprprivatenoexcept |
|
inlinestaticconstexprprivatenoexcept |
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Swaps the contents of this string with the provided one.
| ss | String to swap the contents with. |
|
inlinestaticprivatenoexcept |
| mysql_harness::detail::SecureString< CharT, Traits, Allocator >::wipe | ( | s. | data(), |
| s. | length() | ||
| ) |
|
friend |
|
friend |
Comparison operators.
| mysql_harness::detail::SecureString< CharT, Traits, Allocator >::__pad0__ |
Copies the provided string, wiping its memory.
| s | String to be copied. |
| alloc | Allocator to use. |
|
private |
| mysql_harness::detail::SecureString< CharT, Traits, Allocator >::else |
|
staticconstexprprivate |
|
private |