aboutsummaryrefslogtreecommitdiffstats
path: root/src/datastor.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-19 00:07:25 +0000
committerlloyd <[email protected]>2006-05-19 00:07:25 +0000
commitf090e030be53e574fecbe7cf50edfb5fdacb53e1 (patch)
tree0bff0c249a9dbcb674fcd2491ab17e3d123ef1f9 /src/datastor.cpp
parenta0af7b26591f8fb79d1f06fe42548e1eb0c35e90 (diff)
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.
Diffstat (limited to 'src/datastor.cpp')
-rw-r--r--src/datastor.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/datastor.cpp b/src/datastor.cpp
index 2b7255112..69afd3ce2 100644
--- a/src/datastor.cpp
+++ b/src/datastor.cpp
@@ -29,10 +29,18 @@ bool Data_Store::operator==(const Data_Store& other) const
}
/*************************************************
+* 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<std::string, std::string>
-Data_Store::get(const Matcher& matcher) const
+Data_Store::search_with(const Matcher& matcher) const
{
std::multimap<std::string, std::string> 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<std::string> Data_Store::get(const std::string& looking_for) const
{
std::vector<std::string> out;
+ // FIXME: use equal_range!!!!
std::multimap<std::string, std::string>::const_iterator i;
i = contents.begin();
while(i != contents.end())