diff options
Diffstat (limited to 'libbuild2/target-key.hxx')
-rw-r--r-- | libbuild2/target-key.hxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libbuild2/target-key.hxx b/libbuild2/target-key.hxx index f5351b8..9ac87dc 100644 --- a/libbuild2/target-key.hxx +++ b/libbuild2/target-key.hxx @@ -31,8 +31,16 @@ namespace build2 bool is_a () const {return type->is_a<T> ();} bool is_a (const target_type& tt) const {return type->is_a (tt);} + // Return an "effective" name, for example, for pattern matching, that + // includes the extension where appropriate. + // + const string& + effective_name (string& storage, bool force_ext = false) const; + // Append/return the target name or a pair of names if out-qualified. // + // See also target::as_name() for the returned name stability guarantees. + // void as_name (names&) const; @@ -86,8 +94,21 @@ namespace build2 LIBBUILD2_SYMEXPORT ostream& operator<< (ostream&, const target_key&); - LIBBUILD2_SYMEXPORT ostream& - to_stream (ostream&, const target_key&, optional<stream_verbosity> = nullopt); + // If name_only is true, then only print the target name (and extension, if + // necessary), without the directory or type. + // + // Return true if the result is regular, that is, in the + // <dir>/<type>{<name>}@<out>/ form with the individual components + // corresponding directly to the target_key members (that is, without moving + // parts around as would be the case for directories). This information is + // used when trying to print several targets in a combined form (for + // example, {hxx cxx}{foo}) in print_diag(). + // + LIBBUILD2_SYMEXPORT bool + to_stream (ostream&, + const target_key&, + optional<stream_verbosity> = nullopt, + bool name_only = false); } namespace std |