aboutsummaryrefslogtreecommitdiff
path: root/build/name
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-27 16:57:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-27 16:57:34 +0200
commit4372f041bb7401c3adc2d5710566b13f64722102 (patch)
tree5f37f6e69e5529d3628b7611bb642dba15d885c0 /build/name
parente1d2e3b63934c1e193429f1d6c4e04abc0e85d56 (diff)
Variable assignment, appending support
Diffstat (limited to 'build/name')
-rw-r--r--build/name43
1 files changed, 43 insertions, 0 deletions
diff --git a/build/name b/build/name
new file mode 100644
index 0000000..db7b61c
--- /dev/null
+++ b/build/name
@@ -0,0 +1,43 @@
+// file : build/name -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD_NAME
+#define BUILD_NAME
+
+#include <string>
+#include <vector>
+#include <iosfwd>
+#include <utility> // move()
+
+#include <build/path>
+
+namespace build
+{
+ // A name is what we operate on by default. Depending on the context,
+ // it can be interpreted as a target or prerequisite name. A name
+ // without a type and directory can be used to represent any text.
+ //
+ struct name
+ {
+ explicit
+ name (std::string v): value (std::move (v)) {}
+
+ name (std::string t, path d, std::string v)
+ : type (std::move (t)), dir (std::move (d)), value (std::move (v)) {}
+
+ std::string type;
+ path dir;
+ std::string value;
+ };
+
+ typedef std::vector<name> names;
+
+ std::ostream&
+ operator<< (std::ostream&, const name&);
+
+ std::ostream&
+ operator<< (std::ostream&, const names&);
+}
+
+#endif // BUILD_NAME