summaryrefslogtreecommitdiff
path: root/src/asset.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-02 09:14:15 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-02 09:14:15 +0100
commit51919d468831a876f31d5a6e2b25f8913314770d (patch)
treeb62e82991b9446498b7c6c71760aaec1bf09dbf3 /src/asset.h
parent8637a174f595f78070d88aadcc31a0216b58d857 (diff)
Use optional<> for _hash and make it private.
Diffstat (limited to 'src/asset.h')
-rw-r--r--src/asset.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/asset.h b/src/asset.h
index 17237306..7adf0090 100644
--- a/src/asset.h
+++ b/src/asset.h
@@ -29,6 +29,7 @@
#include <boost/filesystem.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
+#include <boost/optional.hpp>
namespace xmlpp {
class Node;
@@ -79,14 +80,17 @@ public:
std::string hash (boost::function<void (float)> progress = 0) const;
protected:
+
+ /** The most recent disk file used to read or write this asset; may be empty */
+ mutable boost::filesystem::path _file;
+
+private:
friend struct ::asset_test;
virtual std::string pkl_type (Standard standard) const = 0;
- /** The most recent disk file used to read or write this asset; may be empty */
- mutable boost::filesystem::path _file;
- /** Hash of _file, or empty if the hash has not yet been computed */
- mutable std::string _hash;
+ /** Hash of _file if it has been computed */
+ mutable boost::optional<std::string> _hash;
};
}