Wanzyee Studio
CryptoString

Wrapper to encrypt and store a string. More...

Inherits CryptoValue< string, string >.

Public Member Functions

 CryptoString (string value=null)
 Initialize with the specified value. More...
 
override string ToString ()
 Return the plain text. More...
 
virtual void OnBeforeSerialize ()
 OnBeforeSerialize, check if saving to obfuscate the plain data, otherwise prepare the editee value. More...
 
virtual void OnAfterDeserialize ()
 OnAfterDeserialize, check if to store and clean the editee value. More...
 

Protected Member Functions

ReadValue ()
 Read the stored real value. More...
 
void WriteValue (T value)
 Write the real value to store. More...
 
string ReadText ()
 Read the decrypted plain text. More...
 
void WriteText (string text, bool force=false)
 Encrypt the plain text and write with a new key. More...
 
virtual T ToValue (string text)
 Convert the decrypted text to the real value. More...
 
virtual string ToText (T value)
 Convert the real value to the text to encrypt. More...
 
virtual U ReadEditee ()
 Read the stored value to the editee value. More...
 
virtual void WriteEditee (U editee)
 Write the editee value to the stored value. More...
 
virtual string ValidateEditee ()
 Validate the editee value, return null if correct, otherwise the warning message. More...
 

Properties

virtual T value [get, set]
 The stored value. More...
 

Detailed Description

Wrapper to encrypt and store a string.

Constructor & Destructor Documentation

CryptoString ( string  value = null)

Initialize with the specified value.

Parameters
valueValue.

Member Function Documentation

override string ToString ( )
inherited

Return the plain text.

Returns
A string represents this.
T ReadValue ( )
protectedinherited

Read the stored real value.

Returns
Value.
void WriteValue ( value)
protectedinherited

Write the real value to store.

Parameters
valueValue.
string ReadText ( )
protectedinherited

Read the decrypted plain text.

Returns
Plain text.
void WriteText ( string  text,
bool  force = false 
)
protectedinherited

Encrypt the plain text and write with a new key.

Parameters
textPlain text.
forceIf to force update, otherwise check changed in editor.
virtual T ToValue ( string  text)
protectedvirtualinherited

Convert the decrypted text to the real value.

Parameters
textText.
Returns
Value.
virtual string ToText ( value)
protectedvirtualinherited

Convert the real value to the text to encrypt.

Parameters
valueValue.
Returns
Text.
virtual void OnBeforeSerialize ( )
virtualinherited

OnBeforeSerialize, check if saving to obfuscate the plain data, otherwise prepare the editee value.

virtual void OnAfterDeserialize ( )
virtualinherited

OnAfterDeserialize, check if to store and clean the editee value.

virtual U ReadEditee ( )
protectedvirtualinherited

Read the stored value to the editee value.

Returns
Editee.
virtual void WriteEditee ( editee)
protectedvirtualinherited

Write the editee value to the stored value.

Parameters
editeeEditee.
virtual string ValidateEditee ( )
protectedvirtualinherited

Validate the editee value, return null if correct, otherwise the warning message.

Returns
Message.

Property Documentation

virtual T value
getsetinherited

The stored value.