diff options
author | Paul McLean <pmclean@google.com> | 2013-12-19 15:47:29 -0800 |
---|---|---|
committer | Rom Lemarchand <romlem@google.com> | 2014-03-25 19:08:13 +0000 |
commit | 55c640704152694dca1f19bf2a0b86fa2efa99d1 (patch) | |
tree | 5be0f556d4030ef352cfa5afc378e2e526846745 /libcutils | |
parent | 65ea3cc9077befd29e6a677d833a271ecfeafe62 (diff) | |
download | system_core-55c640704152694dca1f19bf2a0b86fa2efa99d1.zip system_core-55c640704152694dca1f19bf2a0b86fa2efa99d1.tar.gz system_core-55c640704152694dca1f19bf2a0b86fa2efa99d1.tar.bz2 |
Adding a handy predicate function (str_parms_has_key()
Change-Id: I1af5c260a1a820b65f0850ea9adb38b01fcb183c
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/str_parms.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcutils/str_parms.c b/libcutils/str_parms.c index 7cfbcb3..1edef11 100644 --- a/libcutils/str_parms.c +++ b/libcutils/str_parms.c @@ -240,6 +240,10 @@ int str_parms_add_float(struct str_parms *str_parms, const char *key, return ret; } +int str_parms_has_key(struct str_parms *str_parms, const char *key) { + return hashmapGet(str_parms->map, (void *)key) != NULL; +} + int str_parms_get_str(struct str_parms *str_parms, const char *key, char *val, int len) { |