summaryrefslogtreecommitdiff
path: root/key_value_store.h
diff options
context:
space:
mode:
authorPeter Qiu <zqiu@chromium.org>2015-07-21 15:34:59 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-22 18:04:36 +0000
commit937fafcf14cd73a0b194a9f143ae2a043b8f09ed (patch)
tree88dce7303546edf1d7ac334dab2d60d59cffb487 /key_value_store.h
parent60173848f6898f03e92add2c91880294946b0da4 (diff)
downloadshill-937fafcf14cd73a0b194a9f143ae2a043b8f09ed.tar.gz
shill: add uint8_t type support to KeyValueStore
This is needed for using KeyValueStore to store IP configurations received through DBus. BUG=chromium:512510 TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill Change-Id: I6b9e1fc8200ac3a4fd67549df7c055b684990bfb Reviewed-on: https://chromium-review.googlesource.com/287420 Reviewed-by: Zeping Qiu <zqiu@chromium.org> Tested-by: Zeping Qiu <zqiu@chromium.org> Commit-Queue: Zeping Qiu <zqiu@chromium.org>
Diffstat (limited to 'key_value_store.h')
-rw-r--r--key_value_store.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/key_value_store.h b/key_value_store.h
index eecfee04..c1e2fd93 100644
--- a/key_value_store.h
+++ b/key_value_store.h
@@ -50,6 +50,7 @@ class KeyValueStore {
bool ContainsStrings(const std::string& name) const;
bool ContainsUint(const std::string& name) const;
bool ContainsUint16(const std::string& name) const;
+ bool ContainsUint8(const std::string& name) const;
bool ContainsUint8s(const std::string& name) const;
bool ContainsUint32s(const std::string& name) const;
@@ -66,9 +67,13 @@ class KeyValueStore {
const std::vector<std::string>& GetStrings(const std::string& name) const;
uint32_t GetUint(const std::string& name) const;
uint16_t GetUint16(const std::string& name) const;
+ uint8_t GetUint8(const std::string& name) const;
const std::vector<uint8_t>& GetUint8s(const std::string& name) const;
const std::vector<uint32_t>& GetUint32s(const std::string& name) const;
+ // TODO(zqiu): remove type specific set functions and add a generic set
+ // function instead. This way, we don't need to add new functions every
+ // time we need to support a new type.
void SetBool(const std::string& name, bool value);
void SetByteArrays(const std::string& name,
const std::vector<std::vector<uint8_t>>& value);
@@ -83,9 +88,12 @@ class KeyValueStore {
const std::vector<std::string>& value);
void SetUint(const std::string& name, uint32_t value);
void SetUint16(const std::string& name, uint16_t value);
+ void SetUint8(const std::string& name, uint8_t value);
void SetUint8s(const std::string& name, const std::vector<uint8_t>& value);
void SetUint32s(const std::string& name, const std::vector<uint32_t>& value);
+ // TODO(zqiu): remove type specific remove functions and add a generic remove
+ // function instead.
void RemoveString(const std::string& name);
void RemoveStringmap(const std::string& name);
void RemoveStrings(const std::string& name);
@@ -95,6 +103,7 @@ class KeyValueStore {
void RemoveRpcIdentifier(const std::string& name);
void RemoveByteArrays(const std::string& name);
void RemoveUint16(const std::string& name);
+ void RemoveUint8(const std::string& name);
void RemoveUint8s(const std::string& name);
void RemoveUint32s(const std::string& name);