temporal: add operator<<(ostream&) for BBT_Argument

This commit is contained in:
Paul Davis 2023-05-05 18:55:27 -06:00
parent fafc891ca6
commit 7c07a9964a
2 changed files with 17 additions and 0 deletions

View file

@ -20,6 +20,7 @@
#include <cassert>
#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;
}

View file

@ -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__ */