summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorRanjay Krishna <rak248@cornell.edu>2013-12-18 15:24:59 -0500
committerMatt Kangas <matt.kangas@mongodb.com>2013-12-28 11:32:36 -0500
commit6c5777102a973d9b5e41619f2315b75da3be3084 (patch)
treeb48935c1c54fa147de9608bca0d8f266e94ed54f /src/mongo/bson
parente63ebb10569e05b65a34071f0a9360374b4d7139 (diff)
downloadmongo-6c5777102a973d9b5e41619f2315b75da3be3084.tar.gz
SERVER-3364 Label rest of client api with MONGO_CLIENT_API
build all the sharedclient programs using the new macro MONGO_CLIENT_API in mongo/client/export_macros.h Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/bsonelement.h9
-rw-r--r--src/mongo/bson/bsonmisc.h5
-rw-r--r--src/mongo/bson/bsonobj.h19
-rw-r--r--src/mongo/bson/bsonobjbuilder.h5
4 files changed, 21 insertions, 17 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index d68e5d16ebc..a3dd39ee56d 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -23,6 +23,7 @@
#include "mongo/bson/bsontypes.h"
#include "mongo/bson/oid.h"
+#include "mongo/client/export_macros.h"
#include "mongo/platform/cstdint.h"
#include "mongo/platform/float_utils.h"
@@ -58,7 +59,7 @@ namespace mongo {
value()
type()
*/
- class BSONElement {
+ class MONGO_CLIENT_API BSONElement {
public:
/** These functions, which start with a capital letter, throw a MsgAssertionException if the
element is not of the required type. Example:
@@ -78,8 +79,8 @@ namespace mongo {
void OK() const { chk(ok()); } // throw MsgAssertionException if element DNE
/** @return the embedded object associated with this field.
- Note the returned object is a reference to within the parent bson object. If that
- object is out of scope, this pointer will no longer be valid. Call getOwned() on the
+ Note the returned object is a reference to within the parent bson object. If that
+ object is out of scope, this pointer will no longer be valid. Call getOwned() on the
returned BSONObj if you need your own copy.
throws UserException if the element is not of type object.
*/
@@ -236,7 +237,7 @@ namespace mongo {
}
/** Size (length) of a string element.
- You must assure of type String first.
+ You must assure of type String first.
@return string size including terminating null
*/
int valuestrsize() const {
diff --git a/src/mongo/bson/bsonmisc.h b/src/mongo/bson/bsonmisc.h
index 9e403bfd63b..f0bf0403f12 100644
--- a/src/mongo/bson/bsonmisc.h
+++ b/src/mongo/bson/bsonmisc.h
@@ -20,6 +20,7 @@
#include <memory>
#include "mongo/bson/bsonelement.h"
+#include "mongo/client/export_macros.h"
namespace mongo {
@@ -94,7 +95,7 @@ namespace mongo {
Example:
std::cout << BSON( "a" << BSONNULL ); // { a : null }
*/
- extern struct NullLabeler { } BSONNULL;
+ extern MONGO_CLIENT_API struct MONGO_CLIENT_API NullLabeler { } BSONNULL;
/* Utility class to assign an Undefined value to a given attribute
Example:
@@ -191,7 +192,7 @@ namespace mongo {
// definitions in bsonobjbuilder.h b/c of incomplete types
// Utility class to implement BSON( key << val ) as described above.
- class BSONObjBuilderValueStream : public boost::noncopyable {
+ class MONGO_CLIENT_API BSONObjBuilderValueStream : public boost::noncopyable {
public:
friend class Labeler;
BSONObjBuilderValueStream( BSONObjBuilder * builder );
diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h
index ea8ac971a5d..ba2821b2be1 100644
--- a/src/mongo/bson/bsonobj.h
+++ b/src/mongo/bson/bsonobj.h
@@ -28,6 +28,7 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/util/atomic_int.h"
#include "mongo/bson/util/builder.h"
+#include "mongo/client/export_macros.h"
#include "mongo/util/bufreader.h"
namespace mongo {
@@ -73,9 +74,9 @@ namespace mongo {
Code With Scope: <total size><String><Object>
\endcode
*/
- class BSONObj {
+ class MONGO_CLIENT_API BSONObj {
public:
-
+
/** Construct a BSONObj from data in the proper format.
* Use this constructor when something else owns msgdata's buffer
*/
@@ -97,7 +98,7 @@ namespace mongo {
static BSONObj make( const Record* r );
- ~BSONObj() {
+ ~BSONObj() {
_objdata = 0; // defensive
}
@@ -131,7 +132,7 @@ namespace mongo {
*/
bool isOwned() const { return _holder.get() != 0; }
- /** assure the data buffer is under the control of this BSONObj and not a remote buffer
+ /** assure the data buffer is under the control of this BSONObj and not a remote buffer
@see isOwned()
*/
BSONObj getOwned() const;
@@ -191,7 +192,7 @@ namespace mongo {
*/
BSONElement getField(const StringData& name) const;
- /** Get several fields at once. This is faster than separate getField() calls as the size of
+ /** Get several fields at once. This is faster than separate getField() calls as the size of
elements iterated can then be calculated only once each.
@param n number of fieldNames, and number of elements in the fields array
@param fields if a field is found its element is stored in its corresponding position in this array.
@@ -227,7 +228,7 @@ namespace mongo {
/** @return INT_MIN if not present - does some type conversions */
int getIntField(const StringData& name) const;
- /** @return false if not present
+ /** @return false if not present
@see BSONElement::trueValue()
*/
bool getBoolField(const StringData& name) const;
@@ -383,15 +384,15 @@ namespace mongo {
/** @return first field of the object */
BSONElement firstElement() const { return BSONElement(objdata() + 4); }
- /** faster than firstElement().fieldName() - for the first element we can easily find the fieldname without
+ /** faster than firstElement().fieldName() - for the first element we can easily find the fieldname without
computing the element size.
*/
- const char * firstElementFieldName() const {
+ const char * firstElementFieldName() const {
const char *p = objdata() + 4;
return *p == EOO ? "" : p+1;
}
- BSONType firstElementType() const {
+ BSONType firstElementType() const {
const char *p = objdata() + 4;
return (BSONType) *p;
}
diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h
index 51616fa8c28..f5292caf17a 100644
--- a/src/mongo/bson/bsonobjbuilder.h
+++ b/src/mongo/bson/bsonobjbuilder.h
@@ -33,6 +33,7 @@
#include "mongo/bson/bsonmisc.h"
#include "mongo/bson/bson_builder_base.h"
#include "mongo/bson/bson_field.h"
+#include "mongo/client/export_macros.h"
#if defined(_DEBUG) && defined(MONGO_EXPOSE_MACROS)
#include "mongo/util/log.h"
@@ -48,7 +49,7 @@ namespace mongo {
/** Utility for creating a BSONObj.
See also the BSON() and BSON_ARRAY() macros.
*/
- class BSONObjBuilder : public BSONBuilderBase, private boost::noncopyable {
+ class MONGO_CLIENT_API BSONObjBuilder : public BSONBuilderBase, private boost::noncopyable {
public:
/** @param initsize this is just a hint as to the final size of the object */
BSONObjBuilder(int initsize=512) : _b(_buf), _buf(initsize + sizeof(unsigned)), _offset( sizeof(unsigned) ), _s( this ) , _tracker(0) , _doneCalled(false) {
@@ -362,7 +363,7 @@ namespace mongo {
return appendCode(fieldName, code.code);
}
- /** Append a string element.
+ /** Append a string element.
@param sz size includes terminating null character */
BSONObjBuilder& append(const StringData& fieldName, const char *str, int sz) {
_b.appendNum((char) String);