summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-02-27 10:19:37 -0500
committerBilly Donahue <billy.donahue@mongodb.com>2019-02-28 12:26:44 -0500
commit812890b7952f65241c4ae9076d698cbcc9cd5bbd (patch)
treedd870c196db0712f48ed5ba92c0be212c9187055 /src/mongo/bson
parent34cf12d1ea67a7f11266452e44f5c2241f453f23 (diff)
downloadmongo-812890b7952f65241c4ae9076d698cbcc9cd5bbd.tar.gz
SERVER-39863 remove std using namespace directives
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/bsonobj.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/bson/bsonobj.cpp b/src/mongo/bson/bsonobj.cpp
index 71efba1a385..29d07a5965b 100644
--- a/src/mongo/bson/bsonobj.cpp
+++ b/src/mongo/bson/bsonobj.cpp
@@ -83,8 +83,6 @@ int compareObjects(const BSONObj& firstObj,
} // namespace
-using namespace std;
-
/* BSONObj ------------------------------------------------------------*/
void BSONObj::_assertInvalid(int maxSize) const {
@@ -113,7 +111,7 @@ BSONObj BSONObj::getOwned() const {
return copy();
}
-string BSONObj::jsonString(JsonStringFormat format, int pretty, bool isArray) const {
+std::string BSONObj::jsonString(JsonStringFormat format, int pretty, bool isArray) const {
std::stringstream s;
BSONObj::jsonStringStream(format, pretty, isArray, s);
return s.str();
@@ -282,7 +280,7 @@ BSONElement BSONObj::getFieldUsingIndexNames(StringData fieldName, const BSONObj
/* note: addFields always adds _id even if not specified
returns n added not counting _id unless requested.
*/
-int BSONObj::addFields(BSONObj& from, set<string>& fields) {
+int BSONObj::addFields(BSONObj& from, std::set<std::string>& fields) {
verify(isEmpty() && !isOwned()); /* partial implementation for now... */
BSONObjBuilder b;
@@ -324,7 +322,7 @@ bool BSONObj::couldBeArray() const {
break;
// TODO: If actually important, may be able to do int->char* much faster
- if (strcmp(e.fieldName(), ((string)(str::stream() << index)).c_str()) != 0)
+ if (strcmp(e.fieldName(), static_cast<std::string>(str::stream() << index).c_str()) != 0)
return false;
index++;
}
@@ -442,7 +440,7 @@ Status BSONObj::storageValidEmbedded() const {
void BSONObj::dump() const {
LogstreamBuilder builder = log();
- builder << hex;
+ builder << std::hex;
const char* p = objdata();
for (int i = 0; i < objsize(); i++) {
builder << i << '\t' << (0xff & ((unsigned)*p));