X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdependencycache.h;h=a4727aa92160d00e8d1f256bb9b6d4fb8d04b276;hb=f1027d55894e624df4888f9545f1e690a2adf5ae;hp=f182f31c1a017e6e1f6fe58fcd6ba6929cc0eff1;hpb=654de39b62a9a58fd8e1b5a557361d628345788b;p=builder.git diff --git a/source/dependencycache.h b/source/dependencycache.h index f182f31..a4727aa 100644 --- a/source/dependencycache.h +++ b/source/dependencycache.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef DEPENDENCYCACHE_H_ #define DEPENDENCYCACHE_H_ @@ -20,13 +13,6 @@ strings as value. The targets are free to store whatever they want here. */ class DependencyCache { -public: - DependencyCache(SourcePackage &p); - void set_deps(const std::string &tgt, const StringList &d); - const StringList &get_deps(const std::string &tgt) const; - const Msp::Time::TimeStamp &get_mtime() const { return mtime; } - void load(); - void save() const; private: typedef std::map DepsMap; @@ -34,6 +20,20 @@ private: DepsMap deps; Msp::Time::TimeStamp mtime; bool changed; + +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(); + + /** + Saves the depencency cache. Does nothing if the cache is empty or nothing + has changed. */ + void save() const; }; #endif