Version: 3.3.1
Loading...
Searching...
No Matches
wxSecretString Class Reference

#include <wx/secretstore.h>

Inheritance diagram for wxSecretString:

Detailed Description

Temporary string whose contents will be overwritten when it is destroyed.

Objects of this class must not be used polymorphically as it derives from wxString which doesn't have a virtual destructor. Typically, they are used as local variables, e.g.

void TryToAuthenticate(const wxString& secretValue)
{
wxSecretString password(secretValue);
... use password as any wxString ...
// Here password memory is overwritten to prevent the password from
// remaining in memory.
}
wxSecretString()
Default constructor creates an empty string.
wxString()
Default constructor.
Since
3.1.5

Public Member Functions

 wxSecretString ()
 Default constructor creates an empty string.
 wxSecretString (const wxString &value)
 Constructor from a plain string.
 wxSecretString (const wxSecretValue &value)
 Constructor from a secret value.
 ~wxSecretString ()
 Destructor calls wxSecretValue::WipeString().
Public Member Functions inherited from wxString
 wxString ()
 Default constructor.
 wxString (const wxString &stringSrc)
 Creates a string from another string.
 wxString (wxUniChar ch, size_t nRepeat=1)
 Construct a string consisting of nRepeat copies of ch.
 wxString (wxUniCharRef ch, size_t nRepeat=1)
 Construct a string consisting of nRepeat copies of ch.
 wxString (char ch, size_t nRepeat=1)
 Construct a string consisting of nRepeat copies of ch converted to Unicode using the current locale encoding.
 wxString (wchar_t ch, size_t nRepeat=1)
 Construct a string consisting of nRepeat copies of ch.
 wxString (const char *psz)
 Constructs a string from the string literal psz using the current locale encoding to convert it to Unicode (wxConvLibc).
 wxString (const char *psz, const wxMBConv &conv)
 Constructs a string from the string literal psz using conv to convert it Unicode.
 wxString (const char *psz, size_t nLength)
 Constructs a string from the first nLength bytes of the string literal psz using the current locale encoding to convert it to Unicode (wxConvLibc).
 wxString (const char *psz, const wxMBConv &conv, size_t nLength)
 Constructs a string from the first nLength bytes of the string literal psz using conv to convert it Unicode.
 wxString (const wchar_t *pwz)
 Constructs a string from the string literal pwz.
 wxString (const wchar_t *pwz, size_t nLength)
 Constructs a string from the first nLength characters of the string literal pwz.
 wxString (const wxCharBuffer &buf)
 Constructs a string from buf using the using the current locale encoding to convert it to Unicode.
 wxString (const wxWCharBuffer &buf)
 Constructs a string from buf.
 wxString (const std::string &str)
 Constructs a string from str using the using the current locale encoding to convert it to Unicode (wxConvLibc).
 wxString (std::string_view str)
 Constructs a string from str using the using the current locale encoding to convert it to Unicode (wxConvLibc).
 wxString (const std::wstring &str)
 Constructs a string from str.
 wxString (std::wstring_view str)
 Constructs a string from str.
 ~wxString ()
 String destructor.
wxString operator= (const wxString &str)
 Assignment: see the relative wxString constructor.
wxString operator= (wxUniChar c)
 Assignment: see the relative wxString constructor.
void AssignFromUTF8Unchecked (const char *utf8, size_t len=npos)
 Assignment from UTF-8 string.

Additional Inherited Members

Public Types inherited from wxString
typedef wxUniChar value_type
typedef wxUniChar char_type
typedef wxUniCharRef reference
typedef wxCharpointer
typedef const wxCharconst_pointer
typedef size_t size_type
typedef wxUniChar const_reference

Constructor & Destructor Documentation

◆ wxSecretString() [1/3]

wxSecretString::wxSecretString ( )

Default constructor creates an empty string.

◆ wxSecretString() [2/3]

wxSecretString::wxSecretString ( const wxString & value)

Constructor from a plain string.

◆ wxSecretString() [3/3]

wxSecretString::wxSecretString ( const wxSecretValue & value)
explicit

Constructor from a secret value.

◆ ~wxSecretString()

wxSecretString::~wxSecretString ( )

Destructor calls wxSecretValue::WipeString().