aboutsummaryrefslogtreecommitdiff
path: root/build/variable.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build/variable.ixx')
-rw-r--r--build/variable.ixx48
1 files changed, 39 insertions, 9 deletions
diff --git a/build/variable.ixx b/build/variable.ixx
index 2cbe519..52272cc 100644
--- a/build/variable.ixx
+++ b/build/variable.ixx
@@ -37,27 +37,57 @@ namespace build
}
inline const value_proxy& value_proxy::
- operator+= (std::string v) const
+ operator= (dir_path v) const
{
- if (*p == nullptr)
- *this = v;
- else
- as<list_value&> ().emplace_back (std::move (v));
+ p->reset (new list_value (std::move (v)));
+ return *this;
+ }
+ inline const value_proxy& value_proxy::
+ operator= (nullptr_t) const
+ {
+ p->reset ();
return *this;
}
inline const value_proxy& value_proxy::
- operator= (dir_path v) const
+ operator+= (const value_proxy& v) const
{
- p->reset (new list_value (std::move (v)));
+ if (v && this != &v)
+ {
+ if (*p == nullptr)
+ *this = v;
+ else
+ //@@ Assuming it is a list_value.
+ //
+ *this += v.as<const list_value&> ();
+ }
+
return *this;
}
inline const value_proxy& value_proxy::
- operator= (nullptr_t) const
+ operator+= (const list_value& v) const
{
- p->reset ();
+ if (*p == nullptr)
+ *this = value_ptr (new list_value (v));
+ else
+ {
+ list_value& lv (as<list_value&> ());
+ lv.insert (lv.end (), v.begin (), v.end ());
+ }
+
+ return *this;
+ }
+
+ inline const value_proxy& value_proxy::
+ operator+= (std::string v) const
+ {
+ if (*p == nullptr)
+ *this = v;
+ else
+ as<list_value&> ().emplace_back (std::move (v));
+
return *this;
}
}