From: Mikko Rasa Date: Fri, 8 Jun 2012 07:12:55 +0000 (+0300) Subject: Add a method to query the existence of dependencies in cache X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0696355a7c8be95d096e1f1e3f8c8c3595ad0d39;p=builder.git Add a method to query the existence of dependencies in cache --- 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();