X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcache.h;h=cf7253f717586982f98699d15485dd54d4272766;hb=5ccb12706ac217a7f0b07e4c73ca870bb70fabdf;hp=95ae4fbfda4f1b3137d5d6ada72ede398a294591;hpb=65ba6a595dd4a1d74675abcfdf96307062dc43eb;p=builder.git diff --git a/source/cache.h b/source/cache.h index 95ae4fb..cf7253f 100644 --- a/source/cache.h +++ b/source/cache.h @@ -20,16 +20,15 @@ unprintable characters or nuls. class Cache { public: - typedef std::list ValueList; + using Values = std::list; private: - typedef std::pair Key; - typedef std::map DataMap; + using Key = std::pair; SourcePackage &package; Msp::FS::Path filename; - DataMap data; + std::map data; Msp::Time::TimeStamp mtime; - bool changed; + mutable bool changed; public: Cache(SourcePackage &p); @@ -41,14 +40,14 @@ public: void append_value(const Target *, const std::string &, const std::string &); /// Sets a key to a list of values, replacing any existing values. - void set_values(const Target *, const std::string &, const ValueList &); + void set_values(const Target *, const std::string &, const Values &); /** Returns the first value from a key. The key must exist and be non-empty. */ const std::string &get_value(const Target *, const std::string &); /// Returns the values from a key. The key must exist. - const ValueList &get_values(const Target *, const std::string &); + const Values &get_values(const Target *, const std::string &); /// Indicates whether a key exists. bool has_key(const Target *, const std::string &);