aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-12-12 02:22:58 +0100
committerSilvan Mosberger <contact@infinisil.com>2020-12-12 03:31:52 +0100
commit730b152b190135adef2f53c7a80cfd1111d37ead (patch)
tree1ad977d618642e65345dc94efd919fe4b0d14f71 /src
parentbf9890396731a2bbe4f04a49684dee463d818906 (diff)
Make Value::type private
This is an implementation detail and shouldn't be used. Use normalType() and the various is<Type> functions instead
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/eval.cc2
-rw-r--r--src/libexpr/value.hh6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 5f9d19b8d..1d11039ad 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -68,7 +68,7 @@ RootValue allocRootValue(Value * v)
}
-static void printValue(std::ostream & str, std::set<const Value *> & active, const Value & v)
+void printValue(std::ostream & str, std::set<const Value *> & active, const Value & v)
{
checkInterrupt();
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh
index e743da9c3..4050d7e4b 100644
--- a/src/libexpr/value.hh
+++ b/src/libexpr/value.hh
@@ -106,8 +106,14 @@ std::ostream & operator << (std::ostream & str, const ExternalValueBase & v);
struct Value
{
+private:
ValueType type;
+friend std::string showType(const Value & v);
+friend void printValue(std::ostream & str, std::set<const Value *> & active, const Value & v);
+
+public:
+
inline void setInt() { type = tInt; };
inline void setBool() { type = tBool; };
inline void setString() { type = tString; };