From 7c07a9964a3791bfec5adab62ca16a1d9c98f86a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 5 May 2023 18:55:27 -0600 Subject: [PATCH] temporal: add operator<<(ostream&) for BBT_Argument --- libs/temporal/bbt_time.cc | 11 +++++++++++ libs/temporal/temporal/bbt_argument.h | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/libs/temporal/bbt_time.cc b/libs/temporal/bbt_time.cc index c03b9301a1..03b7bf3726 100644 --- a/libs/temporal/bbt_time.cc +++ b/libs/temporal/bbt_time.cc @@ -20,6 +20,7 @@ #include #include "temporal/bbt_time.h" +#include "temporal/bbt_argument.h" using namespace Temporal; @@ -116,3 +117,13 @@ std::operator>>(std::istream& i, Temporal::BBT_Time& bbt) return i; } + +/* define this here to avoid adding another .cc file for just this operator */ + +std::ostream& +std::operator<< (std::ostream& o, Temporal::BBT_Argument const & bbt) +{ + o << '@' << bbt.reference() << ':' << bbt.bars << '|' << bbt.beats << '|' << bbt.ticks; + return o; +} + diff --git a/libs/temporal/temporal/bbt_argument.h b/libs/temporal/temporal/bbt_argument.h index f6adeb4af9..76a1a2e65f 100644 --- a/libs/temporal/temporal/bbt_argument.h +++ b/libs/temporal/temporal/bbt_argument.h @@ -45,4 +45,10 @@ struct LIBTEMPORAL_API BBT_Argument : public BBT_Time } // end namespace +namespace std { + +LIBTEMPORAL_API std::ostream& operator<< (std::ostream& o, Temporal::BBT_Argument const & bbt); + +} + #endif /* __libtemporal_bbt_argument_h__ */