class SettingStore

Defined at line 29 of file ../../src/developer/debug/zxdb/client/setting_store.h

SettingStore is an interface for setting and querying values by a string-based key. It has a

schema that describes the names and types of values it supports.

This is an interface that does not store any actual data. Objects with settings can implement

it, or use MapSettingStore which is a simple map-based implementation.

This class does not implement observers. There are setting observers on the MapSettingStore which

most implementations use. The lack of observers here is to make implementing SettingStores easier

so they don't have to worry about notifying every time anything changes. And some SettingStore

implementations might have different semantics that makes having a per-setting observer list

undesirable.

Public Methods

void SettingStore (fxl::RefPtr<SettingSchema> schema)

Defined at line 14 of file ../../src/developer/debug/zxdb/client/setting_store.cc

fxl::RefPtr<SettingSchema> schema ()

Defined at line 33 of file ../../src/developer/debug/zxdb/client/setting_store.h

Err SetBool (const std::string & key, bool )

Defined at line 65 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Err SetInt (const std::string & key, int64_t )

Defined at line 69 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Err SetString (const std::string & key, std::string )

Defined at line 73 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Err SetExecutionScope (const std::string & key, const ExecutionScope & )

Defined at line 77 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Err SetInputLocations (const std::string & key, std::vector<InputLocation> )

Defined at line 81 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Err SetList (const std::string & key, std::vector<std::string> list)

Defined at line 85 of file ../../src/developer/debug/zxdb/client/setting_store.cc

bool GetBool (const std::string & key)

Defined at line 16 of file ../../src/developer/debug/zxdb/client/setting_store.cc

int64_t GetInt (const std::string & key)

Defined at line 22 of file ../../src/developer/debug/zxdb/client/setting_store.cc

std::string GetString (const std::string & key)

Defined at line 28 of file ../../src/developer/debug/zxdb/client/setting_store.cc

const ExecutionScope & GetExecutionScope (const std::string & key)

Defined at line 34 of file ../../src/developer/debug/zxdb/client/setting_store.cc

const std::vector<InputLocation> & GetInputLocations (const std::string & key)

Defined at line 40 of file ../../src/developer/debug/zxdb/client/setting_store.cc

std::vector<std::string> GetList (const std::string & key)

Defined at line 46 of file ../../src/developer/debug/zxdb/client/setting_store.cc

SettingValue GetValue (const std::string & key)

General get/set for settings.

Defined at line 52 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Err SetValue (const std::string & key, SettingValue value)

Defined at line 89 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Err ClearValue (const std::string & key)

Resets the value back the default value. For hierarchical stores this should put it in a state

to fall back to the parent store's value. Not all stores support this since there might not be

an obvious default value.

Defined at line 95 of file ../../src/developer/debug/zxdb/client/setting_store.cc

Protected Methods

SettingValue GetStorageValue (const std::string & key)

Implemented by the override of the SettingStore to actually get/set values to/from the backend.

The key (and new value for the setter) will have been validated against the schema prior to

these calls.

The implementation for GetStorageValue() can return a null SettingValue to indicate not found,

in which case GetValue() will return the default value from the schema.

The setter should erase or reset back to the default the setting if it's null.

Err SetStorageValue (const std::string & key, SettingValue value)
Err ClearStorageValue (const std::string & key)

Resets the value back the default value. For hierarchical stores this should put it in a state

to fall back to the parent store's value.

Not all store implementations might have the ability to reset a value (values might not have an

obvious default value) and these implementations can leave this function unimplemented. This

default implementation will return an error about clear not being supported.

Defined at line 101 of file ../../src/developer/debug/zxdb/client/setting_store.cc