From 0696355a7c8be95d096e1f1e3f8c8c3595ad0d39 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 8 Jun 2012 10:12:55 +0300 Subject: [PATCH] Add a method to query the existence of dependencies in cache --- source/dependencycache.cpp | 5 +++++ source/dependencycache.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/source/dependencycache.cpp b/source/dependencycache.cpp index 6e099ba..11b200d 100644 --- a/source/dependencycache.cpp +++ b/source/dependencycache.cpp @@ -21,6 +21,11 @@ void DependencyCache::set_deps(const string &tgt, const StringList &d) changed = true; } +bool DependencyCache::has_deps(const string &tgt) const +{ + return deps.count(tgt); +} + const StringList &DependencyCache::get_deps(const string &tgt) const { return get_item(deps, tgt); diff --git a/source/dependencycache.h b/source/dependencycache.h index 4143195..a4727aa 100644 --- a/source/dependencycache.h +++ b/source/dependencycache.h @@ -23,7 +23,9 @@ private: public: DependencyCache(SourcePackage &p); + void set_deps(const std::string &tgt, const StringList &d); + bool has_deps(const std::string &tgt) const; const StringList &get_deps(const std::string &tgt) const; const Msp::Time::TimeStamp &get_mtime() const { return mtime; } void load(); -- 2.45.2