projects
/
mussa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add getdefault to Annotations
[mussa.git]
/
alg
/
annotations.hpp
diff --git
a/alg/annotations.hpp
b/alg/annotations.hpp
index 203456b19da3b3f49465b80a3d211736e5872cc5..607d6cb46d9ad81417f350fe9c950f11a21e8c24 100644
(file)
--- a/
alg/annotations.hpp
+++ b/
alg/annotations.hpp
@@
-26,7
+26,7
@@
public:
typedef metadata_map::size_type size_type;
Annotations();
typedef metadata_map::size_type size_type;
Annotations();
- Annotations(const std::string
&
n);
+ Annotations(const std::string n);
Annotations(const Annotations&);
Annotations(const AnnotationsRef);
Annotations(const Annotations&);
Annotations(const AnnotationsRef);
@@
-43,11
+43,13
@@
public:
//! remove some key from our "dictionary"
void erase(const std::string& key);
//! set a metadata element
//! remove some key from our "dictionary"
void erase(const std::string& key);
//! set a metadata element
- void set(const std::string
& key, const std::string &
value );
+ void set(const std::string
key, const std::string
value );
//! look for a key, \throws annotation_key_error if it doesn't find it
//! look for a key, \throws annotation_key_error if it doesn't find it
- std::string get(const std::string& key) const;
+ std::string get(const std::string key) const;
+ //! look for a key, if not found return default
+ std::string getdefault(const std::string key, std::string default_value) const;
//! check for a key
//! check for a key
- bool has_key(const std::string
&
key) const;
+ bool has_key(const std::string key) const;
//! return all the keys of our metadata map
//std::list<std::string> keys() const;
size_type size() const { return metadata.size(); }
//! return all the keys of our metadata map
//std::list<std::string> keys() const;
size_type size() const { return metadata.size(); }