#include <wipeable_string.h>
Definition at line 40 of file wipeable_string.h.
◆ value_type
◆ wipeable_string() [1/7]
| epee::wipeable_string::wipeable_string |
( |
| ) |
|
|
inline |
◆ wipeable_string() [2/7]
◆ wipeable_string() [3/7]
◆ wipeable_string() [4/7]
| epee::wipeable_string::wipeable_string |
( |
const std::string & |
other | ) |
|
Definition at line 63 of file wipeable_string.cpp.
size_t size() const noexcept
void * memcpy(void *a, const void *b, size_t c)
◆ wipeable_string() [5/7]
| epee::wipeable_string::wipeable_string |
( |
std::string && |
other | ) |
|
Definition at line 70 of file wipeable_string.cpp.
77 memwipe(&other[0], other.size());
size_t size() const noexcept
void * memcpy(void *a, const void *b, size_t c)
void * memwipe(void *src, size_t n)
◆ wipeable_string() [6/7]
| epee::wipeable_string::wipeable_string |
( |
const char * |
s | ) |
|
Definition at line 82 of file wipeable_string.cpp.
size_t size() const noexcept
void * memcpy(void *a, const void *b, size_t c)
◆ wipeable_string() [7/7]
| epee::wipeable_string::wipeable_string |
( |
const char * |
s, |
|
|
size_t |
len |
|
) |
| |
◆ ~wipeable_string()
| epee::wipeable_string::~wipeable_string |
( |
| ) |
|
◆ append()
| void epee::wipeable_string::append |
( |
const char * |
ptr, |
|
|
size_t |
len |
|
) |
| |
Definition at line 144 of file wipeable_string.cpp.
146 const size_t orgsz =
size();
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
size_t size() const noexcept
void * memcpy(void *a, const void *b, size_t c)
const char * data() const noexcept
◆ clear()
| void epee::wipeable_string::clear |
( |
| ) |
|
◆ data() [1/2]
| const char* epee::wipeable_string::data |
( |
| ) |
const |
|
inlinenoexcept |
◆ data() [2/2]
| char* epee::wipeable_string::data |
( |
| ) |
|
|
inlinenoexcept |
◆ empty()
| bool epee::wipeable_string::empty |
( |
| ) |
const |
|
inlinenoexcept |
◆ hex_to_pod() [1/2]
template<typename T >
| bool epee::wipeable_string::hex_to_pod |
( |
T & |
pod | ) |
const |
|
inline |
Definition at line 86 of file wipeable_string.h.
89 if (
size() !=
sizeof(
T) * 2)
91 boost::optional<epee::wipeable_string> blob =
parse_hexstr();
94 if (blob->size() !=
sizeof(
T))
96 pod = *(
const T*)blob->data();
boost::optional< wipeable_string > parse_hexstr() const
size_t size() const noexcept
const GenericPointer< typename T::ValueType > T2 value
◆ hex_to_pod() [2/2]
template<typename T >
| bool epee::wipeable_string::hex_to_pod |
( |
tools::scrubbed< T > & |
pod | ) |
const |
|
inline |
Definition at line 70 of file wipeable_string.h.
bool hex_to_pod(T &pod) const
T & unwrap(mlocked< T > &src)
◆ length()
| size_t epee::wipeable_string::length |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator!=()
◆ operator+=() [1/4]
| void epee::wipeable_string::operator+= |
( |
char |
c | ) |
|
◆ operator+=() [2/4]
| void epee::wipeable_string::operator+= |
( |
const std::string & |
s | ) |
|
◆ operator+=() [3/4]
Definition at line 158 of file wipeable_string.cpp.
size_t size() const noexcept
void append(const char *ptr, size_t len)
const char * data() const noexcept
◆ operator+=() [4/4]
| void epee::wipeable_string::operator+= |
( |
const char * |
s | ) |
|
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
◆ parse_hexstr()
Definition at line 202 of file wipeable_string.cpp.
207 const size_t len =
size();
208 const char *d =
data();
209 res->grow(0, len / 2);
210 for (
size_t i = 0; i < len; i += 2)
212 char c = atolower(d[i]);
213 const char *ptr0 = strchr(hex, c);
216 c = atolower(d[i+1]);
217 const char *ptr1 = strchr(hex, c);
220 res->push_back(((ptr0-hex)<<4) | (ptr1-hex));
size_t size() const noexcept
const char * data() const noexcept
◆ pop_back()
| char epee::wipeable_string::pop_back |
( |
| ) |
|
Definition at line 225 of file wipeable_string.cpp.
227 const size_t sz =
size();
229 const char c = buffer.back();
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
size_t size() const noexcept
◆ push_back()
| void epee::wipeable_string::push_back |
( |
char |
c | ) |
|
◆ reserve()
| void epee::wipeable_string::reserve |
( |
size_t |
sz | ) |
|
◆ resize()
| void epee::wipeable_string::resize |
( |
size_t |
sz | ) |
|
◆ size()
| size_t epee::wipeable_string::size |
( |
| ) |
const |
|
inlinenoexcept |
◆ split()
| void epee::wipeable_string::split |
( |
std::vector< wipeable_string > & |
fields | ) |
const |
Definition at line 183 of file wipeable_string.cpp.
187 const char *ptr =
data();
191 const char c = *ptr++;
195 fields.push_back({});
196 fields.back().push_back(c);
size_t size() const noexcept
const char * data() const noexcept
◆ trim()
| void epee::wipeable_string::trim |
( |
| ) |
|
Definition at line 168 of file wipeable_string.cpp.
171 while (prefix <
size() &&
data()[prefix] ==
' ')
174 memmove(buffer.data(), buffer.data() + prefix,
size() - prefix);
177 while (suffix <
size()-prefix &&
data()[
size() - 1 - prefix - suffix] ==
' ')
size_t size() const noexcept
const char * data() const noexcept
void * memmove(void *a, const void *b, size_t c)
◆ wipe()
| void epee::wipeable_string::wipe |
( |
| ) |
|
The documentation for this class was generated from the following files: