aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target-state.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/target-state.hxx')
-rw-r--r--libbuild2/target-state.hxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/libbuild2/target-state.hxx b/libbuild2/target-state.hxx
index 3457b13..a6106f7 100644
--- a/libbuild2/target-state.hxx
+++ b/libbuild2/target-state.hxx
@@ -18,9 +18,14 @@ namespace build2
// Note that postponed is "greater" than unchanged since it may result in
// the changed state.
//
+ // Note also that value 0 is available to indicate absent/invalid state.
+ //
+ // NOTE: don't forget to also update operator<<(ostream,target_state) if
+ // changing anything here.
+ //
enum class target_state: uint8_t
{
- unknown,
+ unknown = 1,
unchanged,
postponed,
busy,
@@ -38,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