diff options
author | Adam Chelminski <adam.chelminski@mongodb.com> | 2016-08-08 10:42:10 -0400 |
---|---|---|
committer | Adam Chelminski <adam.chelminski@mongodb.com> | 2016-08-15 10:45:12 -0400 |
commit | 0b2645558c9715128dceb524660b603e9d8532d6 (patch) | |
tree | 898fc0191b977c0e69b7a2c731f9986ad4b1ef5d /src/mongo/bson/util | |
parent | 4951ce3fdd59db21c65d6147c59408cd9a918812 (diff) | |
download | mongo-0b2645558c9715128dceb524660b603e9d8532d6.tar.gz |
SERVER-13517 Specialize operator<< for BSONType for std::ostream, LogstreamBuilder, and StringBuilder
Diffstat (limited to 'src/mongo/bson/util')
-rw-r--r-- | src/mongo/bson/util/builder.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/bson/util/builder.h b/src/mongo/bson/util/builder.h index 2cce0d93ad5..e6d29ceb175 100644 --- a/src/mongo/bson/util/builder.h +++ b/src/mongo/bson/util/builder.h @@ -41,6 +41,7 @@ #include "mongo/base/data_view.h" #include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" +#include "mongo/bson/bsontypes.h" #include "mongo/bson/inline_decls.h" #include "mongo/platform/decimal128.h" #include "mongo/stdx/type_traits.h" @@ -411,6 +412,10 @@ public: append(str); return *this; } + StringBuilderImpl& operator<<(BSONType type) { + append(typeName(type)); + return *this; + } void appendDoubleNice(double x) { const int prev = _buf.l; |