From f090e030be53e574fecbe7cf50edfb5fdacb53e1 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 19 May 2006 00:07:25 +0000 Subject: Syntax changes to the BER and DER APIs to improve readability of code that uses them. These changes are not backwards compatible, this commit updates all uses of the APIs within the library. --- src/datastor.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/datastor.cpp') diff --git a/src/datastor.cpp b/src/datastor.cpp index 2b7255112..69afd3ce2 100644 --- a/src/datastor.cpp +++ b/src/datastor.cpp @@ -28,11 +28,19 @@ bool Data_Store::operator==(const Data_Store& other) const return (contents == other.contents); } +/************************************************* +* Check if this key has at least one value * +*************************************************/ +bool Data_Store::has_value(const std::string& key) const + { + return (contents.lower_bound(key) != contents.end()); + } + /************************************************* * Search based on an arbitrary predicate * *************************************************/ std::multimap -Data_Store::get(const Matcher& matcher) const +Data_Store::search_with(const Matcher& matcher) const { std::multimap out; @@ -49,12 +57,13 @@ Data_Store::get(const Matcher& matcher) const } /************************************************* -* Search based on an key equality * +* Search based on key equality * *************************************************/ std::vector Data_Store::get(const std::string& looking_for) const { std::vector out; + // FIXME: use equal_range!!!! std::multimap::const_iterator i; i = contents.begin(); while(i != contents.end()) -- cgit v1.2.3