ledger-core
Public Member Functions | List of all members
ledger::core::PreferencesEditor Class Reference
+ Inheritance diagram for ledger::core::PreferencesEditor:
+ Collaboration diagram for ledger::core::PreferencesEditor:

Public Member Functions

 PreferencesEditor (Preferences &preferences)
 
std::shared_ptr< api::PreferencesEditorputString (const std::string &key, const std::string &value) override
 
std::shared_ptr< api::PreferencesEditorputInt (const std::string &key, int32_t value) override
 
std::shared_ptr< api::PreferencesEditorputLong (const std::string &key, int64_t value) override
 
std::shared_ptr< api::PreferencesEditorputBoolean (const std::string &key, bool value) override
 
std::shared_ptr< api::PreferencesEditorputStringArray (const std::string &key, const std::vector< std::string > &value) override
 
std::shared_ptr< api::PreferencesEditorremove (const std::string &key) override
 
template<typename T >
std::shared_ptr< PreferencesEditorputObject (const std::string &key, T &object)
 
std::shared_ptr< api::PreferencesEditorputData (const std::string &key, const std::vector< uint8_t > &value) override
 
void commit () override
 
void clear () override
 Clear all preferences.
 

Member Function Documentation

◆ commit()

void ledger::core::PreferencesEditor::commit ( )
overridevirtual

Persists the changes to the Preferences.

Implements ledger::core::api::PreferencesEditor.

◆ putBoolean()

std::shared_ptr< api::PreferencesEditor > ledger::core::PreferencesEditor::putBoolean ( const std::string &  key,
bool  value 
)
overridevirtual

Sets the value to the given key in the Preferences.

Parameters
keyThe data key.
valueThe value to store
Returns
The reference of self in order to chain the call to the editor.

Implements ledger::core::api::PreferencesEditor.

◆ putData()

std::shared_ptr< api::PreferencesEditor > ledger::core::PreferencesEditor::putData ( const std::string &  key,
const std::vector< uint8_t > &  value 
)
overridevirtual

Sets the value to the given key in the Preferences.

Parameters
keyThe data key.
valueThe value to store
Returns
The reference of self in order to chain the call to the editor.

Implements ledger::core::api::PreferencesEditor.

◆ putInt()

std::shared_ptr< api::PreferencesEditor > ledger::core::PreferencesEditor::putInt ( const std::string &  key,
int32_t  value 
)
overridevirtual

Sets the value to the given key in the Preferences.

Parameters
keyThe data key.
valueThe value to store
Returns
The reference of self in order to chain the call to the editor.

Implements ledger::core::api::PreferencesEditor.

◆ putLong()

std::shared_ptr< api::PreferencesEditor > ledger::core::PreferencesEditor::putLong ( const std::string &  key,
int64_t  value 
)
overridevirtual

Sets the value to the given key in the Preferences.

Parameters
keyThe data key.
valueThe value to store
Returns
The reference of self in order to chain the call to the editor.

Implements ledger::core::api::PreferencesEditor.

◆ putString()

std::shared_ptr< api::PreferencesEditor > ledger::core::PreferencesEditor::putString ( const std::string &  key,
const std::string &  value 
)
overridevirtual

Sets the value to the given key in the Preferences.

Parameters
keyThe data key.
valueThe value to store
Returns
The reference of self in order to chain the call to the editor.

Implements ledger::core::api::PreferencesEditor.

◆ putStringArray()

std::shared_ptr< api::PreferencesEditor > ledger::core::PreferencesEditor::putStringArray ( const std::string &  key,
const std::vector< std::string > &  value 
)
overridevirtual

Sets the value to the given key in the Preferences.

Parameters
keyThe data key.
valueThe value to store
Returns
The reference of self in order to chain the call to the editor.

Implements ledger::core::api::PreferencesEditor.

◆ remove()

std::shared_ptr< api::PreferencesEditor > ledger::core::PreferencesEditor::remove ( const std::string &  key)
overridevirtual

Removes the data associated with the given key.

Parameters
keyThe key to remove from the Preferences
Returns
The reference of self in order to chain the call to the editor.

Implements ledger::core::api::PreferencesEditor.


The documentation for this class was generated from the following files: