diff options
27 files changed, 168 insertions, 159 deletions
diff --git a/src/mongo/bson/bson.h b/src/mongo/bson/bson.h index 19024c26308..a26ba09f784 100644 --- a/src/mongo/bson/bson.h +++ b/src/mongo/bson/bson.h @@ -103,11 +103,11 @@ namespace mongo { #endif } -#include "util/builder.h" -#include "bsontypes.h" -#include "oid.h" -#include "bsonelement.h" -#include "bsonobj.h" -#include "bsonobjbuilder.h" -#include "bsonobjiterator.h" -#include "bson-inl.h" +#include "mongo/bson/bsonelement.h" +#include "mongo/bson/bsonobj.h" +#include "mongo/bson/bsonobjbuilder.h" +#include "mongo/bson/bsonobjiterator.h" +#include "mongo/bson/bsontypes.h" +#include "mongo/bson/bson-inl.h" +#include "mongo/bson/oid.h" +#include "mongo/bson/util/builder.h" diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h index 49fbe5d7513..497b2677379 100644 --- a/src/mongo/bson/bsonelement.h +++ b/src/mongo/bson/bsonelement.h @@ -1,4 +1,4 @@ -// BSONElement +// bsonelement.h /* Copyright 2009 10gen Inc. * @@ -18,11 +18,11 @@ #pragma once #include <string.h> // strlen +#include <string> #include <vector> #include "mongo/bson/bsontypes.h" #include "mongo/bson/oid.h" -#include "mongo/bson/util/builder.h" #include "mongo/platform/float_utils.h" namespace mongo { @@ -76,12 +76,12 @@ namespace mongo { void Null() const { chk(isNull()); } // throw UserException if not null void OK() const { chk(ok()); } // throw UserException if element DNE - /** @return the embedded object associated with this field. + /** @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 - returned BSONObj if you need your own copy. - throws UserException if the element is not of type object. - */ + 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. + */ BSONObj Obj() const; /** populate v with the value of the element. If type does not match, throw exception. @@ -479,7 +479,6 @@ namespace mongo { } }; - inline int BSONElement::canonicalType() const { BSONType t = type(); switch ( t ) { diff --git a/src/mongo/bson/bsonmisc.h b/src/mongo/bson/bsonmisc.h index 5f6b725251c..b215bf21bdd 100644 --- a/src/mongo/bson/bsonmisc.h +++ b/src/mongo/bson/bsonmisc.h @@ -17,6 +17,8 @@ #pragma once +#include "mongo/bson/bsonelement.h" + namespace mongo { int getGtLtOp(const BSONElement& e); diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h index 3ced0e3c499..37c7bb98e4f 100644 --- a/src/mongo/bson/bsonobj.h +++ b/src/mongo/bson/bsonobj.h @@ -17,14 +17,17 @@ #pragma once -#include <boost/noncopyable.hpp> #include <boost/intrusive_ptr.hpp> +#include <boost/noncopyable.hpp> #include <set> #include <list> +#include <string> #include <vector> -#include "util/atomic_int.h" -#include "util/builder.h" -#include "stringdata.h" + +#include "mongo/bson/bsonelement.h" +#include "mongo/bson/stringdata.h" +#include "mongo/bson/util/atomic_int.h" +#include "mongo/bson/util/builder.h" namespace mongo { diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h index 55834ca4e99..e117325254b 100644 --- a/src/mongo/bson/bsonobjbuilder.h +++ b/src/mongo/bson/bsonobjbuilder.h @@ -22,13 +22,9 @@ #pragma once -#include <limits> -#include <cmath> #include <boost/static_assert.hpp> - -//#if defined(MONGO_EXPOSE_MACROS) -//#define verify MONGO_verify -//#endif +#include <cmath> +#include <limits> #include "mongo/bson/bsonelement.h" #include "mongo/bson/bsonobj.h" diff --git a/src/mongo/bson/bsonobjiterator.h b/src/mongo/bson/bsonobjiterator.h index 8bcf62cbafa..6644c7fd7e1 100644 --- a/src/mongo/bson/bsonobjiterator.h +++ b/src/mongo/bson/bsonobjiterator.h @@ -19,6 +19,8 @@ #include <boost/preprocessor/cat.hpp> // like the ## operator but works with __LINE__ +#include "mongo/bson/bsonobj.h" + namespace mongo { /** iterator for a BSONObj diff --git a/src/mongo/bson/bsontypes.h b/src/mongo/bson/bsontypes.h index 1a176d18e60..1192cf1b88e 100644 --- a/src/mongo/bson/bsontypes.h +++ b/src/mongo/bson/bsontypes.h @@ -17,8 +17,6 @@ #pragma once -#include "util/misc.h" - namespace bson { } namespace mongo { @@ -97,10 +95,9 @@ namespace mongo { Function=1, ByteArrayDeprecated=2, /* use BinGeneral instead */ bdtUUID = 3, /* deprecated */ - newUUID=4, /* language-independent UUID format across all drivers */ + newUUID=4, /* language-independent UUID format across all drivers */ MD5Type=5, bdtCustom=128 }; } - diff --git a/src/mongo/bson/oid.h b/src/mongo/bson/oid.h index 7be75e47188..e803a290481 100644 --- a/src/mongo/bson/oid.h +++ b/src/mongo/bson/oid.h @@ -17,7 +17,10 @@ #pragma once -#include "../util/hex.h" +#include <string> + +#include "mongo/bson/util/misc.h" +#include "mongo/util/hex.h" namespace mongo { diff --git a/src/mongo/bson/stringdata.h b/src/mongo/bson/stringdata.h index f8a56c1ba2f..8b92656701e 100644 --- a/src/mongo/bson/stringdata.h +++ b/src/mongo/bson/stringdata.h @@ -17,8 +17,8 @@ #pragma once -#include <string> #include <cstring> +#include <string> namespace mongo { diff --git a/src/mongo/bson/util/atomic_int.h b/src/mongo/bson/util/atomic_int.h index d8becb890a7..0b853635795 100644 --- a/src/mongo/bson/util/atomic_int.h +++ b/src/mongo/bson/util/atomic_int.h @@ -19,7 +19,7 @@ #pragma once #if defined(_WIN32) -# include <windows.h> +#include "mongo/platform/windows_basic.h" #endif #include "mongo/platform/compiler.h" diff --git a/src/mongo/bson/util/builder.h b/src/mongo/bson/util/builder.h index b9d3fcac384..b8027e561a2 100644 --- a/src/mongo/bson/util/builder.h +++ b/src/mongo/bson/util/builder.h @@ -18,13 +18,14 @@ #pragma once #include <cfloat> -#include <string> -#include <sstream> #include <iostream> -#include <string.h> +#include <sstream> #include <stdio.h> -#include "../inline_decls.h" -#include "../stringdata.h" +#include <string> +#include <string.h> + +#include "mongo/bson/inline_decls.h" +#include "mongo/bson/stringdata.h" namespace mongo { /* Accessing unaligned doubles on ARM generates an alignment trap and aborts with SIGBUS on Linux. diff --git a/src/mongo/bson/util/misc.h b/src/mongo/bson/util/misc.h index 8c422afe1db..02d68745c99 100644 --- a/src/mongo/bson/util/misc.h +++ b/src/mongo/bson/util/misc.h @@ -1,4 +1,4 @@ -/* @file misc.h +/* @file misc.h */ /* @@ -21,6 +21,7 @@ #include <ctime> #include <limits> +#include <string> #include "mongo/util/assert_util.h" diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 105eddbb8d9..7c87b6ae332 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -16,53 +16,52 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "pch.h" +#include "mongo/pch.h" #include <boost/thread/thread.hpp> +#include <boost/filesystem/operations.hpp> +#include <fstream> -#include "db.h" - -#include "introspect.h" -#include "repl.h" -#include "../util/startup_test.h" -#include "../util/file_allocator.h" -#include "../util/background.h" -#include "../util/text.h" -#include "dbmessage.h" -#include "instance.h" -#include "clientcursor.h" -#include "pdfile.h" -#include "stats/counters.h" -#include "repl/rs.h" -#include "../scripting/engine.h" -#include "module.h" -#include "cmdline.h" -#include "stats/snapshots.h" -#include "../util/concurrency/task.h" -#include "../util/version.h" -#include "../util/ramlog.h" -#include "../util/net/message_server.h" -#include "client.h" -#include "restapi.h" -#include "dbwebserver.h" -#include "dur.h" -#include "d_concurrency.h" -#include "../s/d_writeback.h" -#include "d_globals.h" -#include "ttl.h" +#include "mongo/db/client.h" +#include "mongo/db/clientcursor.h" +#include "mongo/db/cmdline.h" +#include "mongo/db/d_concurrency.h" +#include "mongo/db/d_globals.h" +#include "mongo/db/db.h" +#include "mongo/db/dbmessage.h" +#include "mongo/db/dbwebserver.h" +#include "mongo/db/dur.h" +#include "mongo/db/instance.h" +#include "mongo/db/introspect.h" +#include "mongo/db/json.h" +#include "mongo/db/module.h" +#include "mongo/db/pdfile.h" +#include "mongo/db/repl.h" +#include "mongo/db/repl/rs.h" +#include "mongo/db/restapi.h" +#include "mongo/db/stats/counters.h" +#include "mongo/db/stats/snapshots.h" +#include "mongo/db/ttl.h" +#include "mongo/s/d_writeback.h" +#include "mongo/scripting/engine.h" +#include "mongo/util/background.h" +#include "mongo/util/concurrency/task.h" +#include "mongo/util/file_allocator.h" +#include "mongo/util/net/message_server.h" +#include "mongo/util/ramlog.h" #include "mongo/util/stacktrace.h" +#include "mongo/util/startup_test.h" +#include "mongo/util/text.h" +#include "mongo/util/version.h" #if defined(_WIN32) -# include "mongo/util/ntservice.h" # include "mongo/util/hook_windows_memory.h" +# include "mongo/util/ntservice.h" # include <DbgHelp.h> #else # include <sys/file.h> #endif -#include <fstream> -#include <boost/filesystem/operations.hpp> - namespace mongo { namespace dur { @@ -308,7 +307,7 @@ namespace mongo { if( h->version <= 0 ) { uasserted(14026, str::stream() << "db " << dbName << " appears corrupt pdfile version: " << h->version - << " info: " << h->versionMinor << ' ' << h->fileLength); + << " info: " << h->versionMinor << ' ' << h->fileLength); } log() << "****" << endl; diff --git a/src/mongo/db/json.cpp b/src/mongo/db/json.cpp index 265f53e161a..3ab03016f7d 100644 --- a/src/mongo/db/json.cpp +++ b/src/mongo/db/json.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "pch.h" +#include "mongo/pch.h" #define BOOST_SPIRIT_THREADSAFE #if BOOST_VERSION >= 103800 @@ -30,11 +30,13 @@ #include <boost/spirit/utility/lists.hpp> #endif -#include "json.h" -#include "../bson/util/builder.h" -#include "../util/base64.h" -#include "../util/hex.h" - +#include "mongo/bson/bsonobjbuilder.h" +#include "mongo/bson/util/builder.h" +#include "mongo/db/jsobj.h" +#include "mongo/db/json.h" +#include "mongo/util/base64.h" +#include "mongo/util/hex.h" +#include "mongo/util/optime.h" using namespace boost::spirit; diff --git a/src/mongo/db/json.h b/src/mongo/db/json.h index 68dae042574..19502f0d7b6 100644 --- a/src/mongo/db/json.h +++ b/src/mongo/db/json.h @@ -18,8 +18,9 @@ #pragma once -#include "../pch.h" -#include "jsobj.h" +#include <string> + +#include "mongo/bson/bsonobj.h" namespace mongo { @@ -33,7 +34,7 @@ namespace mongo { \throws MsgAssertionException if parsing fails. The message included with this assertion includes a rough indication of where parsing failed. */ - BSONObj fromjson(const string &str); + BSONObj fromjson(const std::string &str); /** len will be size of JSON object in text chars. */ BSONObj fromjson(const char *str, int* len=NULL); diff --git a/src/mongo/dbtests/cursortests.cpp b/src/mongo/dbtests/cursortests.cpp index 48931cf460c..38d1197d198 100644 --- a/src/mongo/dbtests/cursortests.cpp +++ b/src/mongo/dbtests/cursortests.cpp @@ -17,12 +17,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "pch.h" -#include "../db/clientcursor.h" -#include "../db/instance.h" -#include "../db/btree.h" -#include "../db/queryutil.h" -#include "dbtests.h" +#include "mongo/pch.h" + +#include "mongo/db/btree.h" +#include "mongo/db/clientcursor.h" +#include "mongo/db/instance.h" +#include "mongo/db/json.h" +#include "mongo/db/queryutil.h" +#include "mongo/dbtests/dbtests.h" namespace CursorTests { diff --git a/src/mongo/dbtests/jsobjhashingtests.cpp b/src/mongo/dbtests/jsobjhashingtests.cpp index 8481965f42c..9ed92ae70e0 100644 --- a/src/mongo/dbtests/jsobjhashingtests.cpp +++ b/src/mongo/dbtests/jsobjhashingtests.cpp @@ -18,8 +18,9 @@ */ -#include "mongo/dbtests/dbtests.h" #include "mongo/db/hasher.h" +#include "mongo/db/json.h" +#include "mongo/dbtests/dbtests.h" namespace JsobjHashingTests { diff --git a/src/mongo/platform/windows_basic.h b/src/mongo/platform/windows_basic.h index 3a728981d33..07776d8b46d 100644 --- a/src/mongo/platform/windows_basic.h +++ b/src/mongo/platform/windows_basic.h @@ -8,10 +8,9 @@ # ifndef NOMINMAX # define NOMINMAX # endif -// tell windows.h not to include a bunch of headers -// we don't need: +// tell windows.h not to include a bunch of headers we don't need: # define WIN32_LEAN_AND_MEAN -# include "targetver.h" +# include "mongo/targetver.h" # include <winsock2.h> //this must be included before the first windows.h include # include <ws2tcpip.h> # include <wspiapi.h> diff --git a/src/mongo/scripting/engine.h b/src/mongo/scripting/engine.h index 3132c6299da..6b0064d28e6 100644 --- a/src/mongo/scripting/engine.h +++ b/src/mongo/scripting/engine.h @@ -17,8 +17,7 @@ #pragma once -#include "../pch.h" -#include "../db/jsobj.h" +#include "mongo/db/jsobj.h" namespace mongo { diff --git a/src/mongo/scripting/engine_spidermonkey.cpp b/src/mongo/scripting/engine_spidermonkey.cpp index a01bbbebfee..dda7a8ce1cf 100644 --- a/src/mongo/scripting/engine_spidermonkey.cpp +++ b/src/mongo/scripting/engine_spidermonkey.cpp @@ -20,13 +20,14 @@ #include "mongo/scripting/engine_spidermonkey.h" #include <boost/thread/recursive_mutex.hpp> - -#include "mongo/util/mongoutils/str.h" - #ifndef _WIN32 #include <boost/date_time/posix_time/posix_time.hpp> #endif +#include <third_party/js-1.7/jsdate.h> + +#include "mongo/util/mongoutils/str.h" + #define smuassert( cx , msg , val ) \ if ( ! ( val ) ){ \ JS_ReportError( cx , msg ); \ @@ -1770,5 +1771,4 @@ namespace mongo { } } -#include "mongo/client/dbclientcursor.h" #include "sm_db.cpp" diff --git a/src/mongo/scripting/engine_spidermonkey.h b/src/mongo/scripting/engine_spidermonkey.h index 9fd430d853d..37dcda30975 100644 --- a/src/mongo/scripting/engine_spidermonkey.h +++ b/src/mongo/scripting/engine_spidermonkey.h @@ -17,22 +17,19 @@ #pragma once -#include "engine.h" +#include "mongo/scripting/engine.h" // START inc hacking #ifdef WIN32 -#include "jstypes.h" +#include <third_party/js-1.7/jstypes.h> #undef JS_PUBLIC_API #undef JS_PUBLIC_DATA #define JS_PUBLIC_API(t) t __cdecl #define JS_PUBLIC_DATA(t) t #endif -#include "jsapi.h" -#include "jsobj.h" -#include "jsdate.h" -#include "jsregexp.h" +#include <third_party/js-1.7/jsapi.h> // END inc hacking @@ -76,7 +73,6 @@ namespace mongo { // bson JSBool resolveBSONField( JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **objp ); - // mongo void initMongoJS( SMScope * scope , JSContext * cx , JSObject * global , bool local ); bool appendSpecialDBObject( Convertor * c , BSONObjBuilder& b , const string& name , jsval val , JSObject * o ); diff --git a/src/mongo/scripting/sm_db.cpp b/src/mongo/scripting/sm_db.cpp index 1578b4b375f..2c12767c682 100644 --- a/src/mongo/scripting/sm_db.cpp +++ b/src/mongo/scripting/sm_db.cpp @@ -17,17 +17,13 @@ // hacked in right now from engine_spidermonkey.cpp -#include "../client/syncclusterconnection.h" -#include "../util/base64.h" -#include "../util/text.h" -#include "../util/hex.h" -#include "../db/namespacestring.h" +#include "mongo/client/dbclientcursor.h" +#include "mongo/db/namespacestring.h" +#include "mongo/util/base64.h" +#include "mongo/util/text.h" #if( BOOST_VERSION >= 104200 ) -//#include <boost/uuid/uuid.hpp> #define HAVE_UUID 1 -#else -; #endif namespace mongo { @@ -194,13 +190,13 @@ namespace mongo { } try{ - ScriptEngine::runConnectCallback( *conn ); + ScriptEngine::runConnectCallback( *conn ); } catch( std::exception& e ){ - // Can happen if connection goes down while we're starting up here - // Catch so that we don't get a hard-to-trace segfault from SM - JS_ReportError( cx, ((string)( str::stream() << "Error during mongo startup." << causedBy( e ) )).c_str() ); - return JS_FALSE; + // Can happen if connection goes down while we're starting up here + // Catch so that we don't get a hard-to-trace segfault from SM + JS_ReportError( cx, ((string)( str::stream() << "Error during mongo startup." << causedBy( e ) )).c_str() ); + return JS_FALSE; } verify( JS_SetPrivate( cx , obj , (void*)( new shared_ptr< DBClientWithCommands >( conn ) ) ) ); diff --git a/src/mongo/scripting/utils.cpp b/src/mongo/scripting/utils.cpp index 01990210a91..2f412f32bb3 100644 --- a/src/mongo/scripting/utils.cpp +++ b/src/mongo/scripting/utils.cpp @@ -15,11 +15,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#include "pch.h" -#include "engine.h" -#include "../util/md5.hpp" -#include "../util/version.h" +#include "mongo/scripting/engine.h" +#include "mongo/util/md5.hpp" +#include "mongo/util/version.h" namespace mongo { @@ -45,7 +43,6 @@ namespace mongo { return BSONObj(); } - BSONObj JSSleep(const mongo::BSONObj &args, void* data) { verify( args.nFields() == 1 ); verify( args.firstElement().isNumber() ); @@ -70,5 +67,3 @@ namespace mongo { } } - - diff --git a/src/mongo/shell/dbshell.cpp b/src/mongo/shell/dbshell.cpp index 98f5e4afa81..20a59f17d0d 100644 --- a/src/mongo/shell/dbshell.cpp +++ b/src/mongo/shell/dbshell.cpp @@ -15,25 +15,28 @@ * limitations under the License. */ -#include "pch.h" -#include <fstream> -#include <pcrecpp.h> -#include <stdio.h> -#include <string.h> -#include <boost/filesystem/operations.hpp> -#include "linenoise.h" -#include "mongo/client/dbclientinterface.h" -#include "mongo/db/cmdline.h" -#include "mongo/db/repl/rs_member.h" -#include "mongo/scripting/engine.h" -#include "mongo/shell/shell_utils.h" -#include "mongo/shell/shell_utils_launcher.h" -#include "mongo/util/file.h" -#include "mongo/util/password.h" -#include "mongo/util/stacktrace.h" -#include "mongo/util/startup_test.h" -#include "mongo/util/util.h" -#include "mongo/util/version.h" +#include "mongo/pch.h" + +#include <boost/filesystem/operations.hpp>
+#include <fstream>
+#include <pcrecpp.h>
+#include <stdio.h>
+#include <string.h>
+ +#include "mongo/client/dbclientinterface.h"
+#include "mongo/db/cmdline.h"
+#include "mongo/db/repl/rs_member.h"
+#include "mongo/scripting/engine.h"
+#include "mongo/shell/linenoise.h"
+#include "mongo/shell/shell_utils.h"
+#include "mongo/shell/shell_utils_launcher.h"
+#include "mongo/util/file.h"
+#include "mongo/util/password.h"
+#include "mongo/util/stacktrace.h"
+#include "mongo/util/startup_test.h"
+#include "mongo/util/util.h"
+#include "mongo/util/version.h"
+ #ifdef _WIN32 #define isatty _isatty #else diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp index c6fbd91d194..0a7580e3203 100644 --- a/src/mongo/shell/shell_utils_launcher.cpp +++ b/src/mongo/shell/shell_utils_launcher.cpp @@ -15,7 +15,9 @@ * limitations under the License. */ -#include "pch.h" +#include "mongo/pch.h" + +#include "mongo/shell/shell_utils_launcher.h" #include <boost/thread/thread.hpp> #include <iostream> @@ -34,11 +36,10 @@ # include <sys/wait.h> #endif -#include "mongo/shell/shell_utils.h" -#include "mongo/shell/shell_utils_launcher.h" #include "mongo/client/clientOnly-private.h" #include "mongo/client/dbclientinterface.h" #include "mongo/scripting/engine.h" +#include "mongo/shell/shell_utils.h" namespace mongo { diff --git a/src/mongo/shell/shell_utils_launcher.h b/src/mongo/shell/shell_utils_launcher.h index 25ac40ddea7..908ca9f0f04 100644 --- a/src/mongo/shell/shell_utils_launcher.h +++ b/src/mongo/shell/shell_utils_launcher.h @@ -20,6 +20,13 @@ #include <boost/filesystem/convenience.hpp> #include <boost/thread/recursive_mutex.hpp> +#include <map> +#include <sstream> +#include <string> +#include <vector> +#include <utility> + +#include "mongo/bson/bsonobj.h" #ifdef _WIN32 typedef int pid_t; @@ -47,10 +54,10 @@ namespace mongo { public: void appendLine( int port, int pid, const char *line ); /** @return up to 100000 characters of the most recent log output. */ - string str() const; + std::string str() const; void clear(); private: - stringstream _buffer; + std::stringstream _buffer; }; /** @@ -66,7 +73,7 @@ namespace mongo { /** Register an unregistered port. */ void registerPort( int port, pid_t pid, int output ); void deletePort( int port ); - void getRegisteredPorts( vector<int> &ports ); + void getRegisteredPorts( std::vector<int> &ports ); bool isPidRegistered( pid_t pid ) const; /** Register an unregistered pid. */ @@ -75,13 +82,13 @@ namespace mongo { void getRegisteredPids( vector<pid_t> &pids ); private: - map<int,pair<pid_t,int> > _ports; - map<pid_t,int> _pids; + std::map<int,std::pair<pid_t,int> > _ports; + std::map<pid_t,int> _pids; mutable boost::recursive_mutex _mutex; #ifdef _WIN32 public: - map<pid_t,HANDLE> _handles; + std::map<pid_t,HANDLE> _handles; #endif }; @@ -101,7 +108,7 @@ namespace mongo { boost::filesystem::path findProgram( const string &prog ); void launchProcess( int child_stdout ); - vector<string> _argv; + std::vector<std::string> _argv; int _port; int _pipe; pid_t _pid; diff --git a/src/mongo/util/hex.h b/src/mongo/util/hex.h index 54eb8de8102..bebe411d944 100644 --- a/src/mongo/util/hex.h +++ b/src/mongo/util/hex.h @@ -17,6 +17,10 @@ #pragma once +#include <string> + +#include "mongo/bson/util/builder.h" + namespace mongo { //can't use hex namespace because it conflicts with hex iostream function inline int fromHex( char c ) { @@ -33,7 +37,7 @@ namespace mongo { return (char)(( fromHex( c[ 0 ] ) << 4 ) | fromHex( c[ 1 ] )); } - inline string toHex(const void* inRaw, int len) { + inline std::string toHex(const void* inRaw, int len) { static const char hexchars[] = "0123456789ABCDEF"; StringBuilder out; @@ -49,7 +53,7 @@ namespace mongo { return out.str(); } - inline string toHexLower(const void* inRaw, int len) { + inline std::string toHexLower(const void* inRaw, int len) { static const char hexchars[] = "0123456789abcdef"; StringBuilder out; |