added getmeta() method to Rcl::Doc and use in misc places

This commit is contained in:
Jean-Francois Dockes
2012-01-20 14:48:50 +01:00
parent dc3aa5d564
commit 036937e8bf
5 changed files with 30 additions and 26 deletions
+13
View File
@@ -134,6 +134,19 @@ class Doc {
xdocid = 0;
}
/** Get value for named field. If value pointer is 0, just test existence */
bool getmeta(const string& nm, string *value = 0) const
{
map<string,string>::const_iterator it = meta.find(nm);
if (it != meta.end()) {
if (value)
*value = it->second;
return true;
} else {
return false;
}
}
void dump(bool dotext=false) const;
// The official names for recoll native fields when used in a text