aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target-state.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-03-08 21:12:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-03-11 12:57:10 +0300
commit8c257da85cde2df8f459f0c7610445971fffb2a8 (patch)
tree5ff670a42257ac6e1374da3ec0055a9ea348d871 /libbuild2/target-state.hxx
parenta061301ab789d00027f29f389627792dccbe1748 (diff)
Add JSON format support for --structured-result option and info meta operation
Diffstat (limited to 'libbuild2/target-state.hxx')
-rw-r--r--libbuild2/target-state.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/libbuild2/target-state.hxx b/libbuild2/target-state.hxx
index ea7015c..a6106f7 100644
--- a/libbuild2/target-state.hxx
+++ b/libbuild2/target-state.hxx
@@ -43,8 +43,14 @@ namespace build2
return l;
}
- LIBBUILD2_SYMEXPORT ostream&
- operator<< (ostream&, target_state); // target.cxx
+ LIBBUILD2_SYMEXPORT string
+ to_string (target_state); // target.cxx
+
+ inline ostream&
+ operator<< (ostream& o, target_state ts)
+ {
+ return o << to_string (ts);
+ }
}
#endif // LIBBUILD2_TARGET_STATE_HXX