summaryrefslogtreecommitdiff
path: root/bson
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-11-13 17:42:41 -0500
committerdwight <dwight@10gen.com>2010-11-13 17:42:41 -0500
commiteaec449b9e2e7a93a84baed86cf8a509c3066a3a (patch)
treed3a54944920297955e70f09141fbe5b01a08329a /bson
parentae26b3329ed8fdd4afe74e37679a76ba9639c570 (diff)
downloadmongo-eaec449b9e2e7a93a84baed86cf8a509c3066a3a.tar.gz
dur
Diffstat (limited to 'bson')
-rw-r--r--bson/util/builder.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/bson/util/builder.h b/bson/util/builder.h
index 41bc3c798d9..4c04210bf3c 100644
--- a/bson/util/builder.h
+++ b/bson/util/builder.h
@@ -123,6 +123,11 @@ namespace mongo {
memcpy(grow((int) len), src, len);
}
+ template<class T>
+ void appendStruct(const T& s) {
+ appendBuf(&s, sizeof(T));
+ }
+
void appendStr(const StringData &str , bool includeEOO = true ) {
const int len = str.size() + ( includeEOO ? 1 : 0 );
memcpy(grow(len), str.data(), len);