summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse-api/service/utils/ebuildCacheParser.cpp10
-rw-r--r--gentoobrowse-api/service/utils/ebuildCacheParser.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/gentoobrowse-api/service/utils/ebuildCacheParser.cpp b/gentoobrowse-api/service/utils/ebuildCacheParser.cpp
index ad894db..068d10b 100644
--- a/gentoobrowse-api/service/utils/ebuildCacheParser.cpp
+++ b/gentoobrowse-api/service/utils/ebuildCacheParser.cpp
@@ -29,6 +29,16 @@ namespace Gentoo {
}
return Glib::ustring(kvi->second.first, kvi->second.second);
}
+
+ boost::optional<EbuildCacheParser::Range>
+ EbuildCacheParser::getRange(const std::string & key) const
+ {
+ auto kvi = kvs.find(key);
+ if (kvi == kvs.end()) {
+ return boost::optional<Range>();
+ }
+ return kvi->second;
+ }
}
}
diff --git a/gentoobrowse-api/service/utils/ebuildCacheParser.h b/gentoobrowse-api/service/utils/ebuildCacheParser.h
index e9f1dfc..c7449c7 100644
--- a/gentoobrowse-api/service/utils/ebuildCacheParser.h
+++ b/gentoobrowse-api/service/utils/ebuildCacheParser.h
@@ -17,6 +17,7 @@ namespace Gentoo {
EbuildCacheParser(const boost::filesystem::path & p);
boost::optional<Glib::ustring> get(const std::string & key) const;
+ boost::optional<Range> getRange(const std::string & key) const;
private:
KVs kvs;