MongoDB C++ Driver legacy-1.1.2
Loading...
Searching...
No Matches
bson.h
Go to the documentation of this file.
1
9/*
10 * Copyright 2009 10gen Inc.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 */
24
35#pragma once
36
37#ifdef MONGO_EXPOSE_MACROS
38#error bson.h is for C++ driver consumer use only
39#endif
40
41// Consumers of the MongoDB C++ client library must define STATIC_LIBMONGOCLIENT when including
42// this header if they intend to link against the static version of the library. This is best
43// handled by adding STATIC_LIBMONGOCLIENT to the list of definitions passed on each compile
44// invocation.
45#ifndef STATIC_LIBMONGOCLIENT
46#if defined(_WIN32) && !defined(_DLL)
47#error "The DLL build of libmongoclient requires consuming code to be built with /MD or /MDd"
48#endif
49#endif
50
51#if defined(_MSC_VER)
52#pragma warning(push)
53// Don't emit deprecation warnings
54#pragma warning(disable : 4996)
55#if defined(_DLL)
56// Don't spam DLL consumers with warnings about STL symbol exports
57#pragma warning(disable : 4251)
58#pragma warning(disable : 4275)
59#endif
60#endif
61
62#if defined(_WIN32) && !defined(_WINSOCK2API_)
63#error "You must include the windows and windows sockets headers before bson.h"
64#endif
65
66#include "mongo/config.h"
67
69
70#include "mongo/client/autolib.h"
71
72#include "mongo/bson/bson_validate.h"
73#include "mongo/bson/bsonelement.h"
74#include "mongo/bson/bsonobj.h"
75#include "mongo/bson/bsonobjbuilder.h"
76#include "mongo/bson/bsonobjiterator.h"
77#include "mongo/bson/bsontypes.h"
78#include "mongo/bson/bson-inl.h"
79#include "mongo/bson/oid.h"
80#include "mongo/bson/util/builder.h"
81
83
84#if defined(_MSC_VER) && defined(_DLL)
85#pragma warning(pop)
86#endif
macros for mongo internals
remove mongo implementation macros after using