diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2019-04-08 16:27:50 -0400 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2019-04-09 15:38:40 -0400 |
commit | 1041dd848e25e879260d1015d8da4f72ee7993fe (patch) | |
tree | f8ddb4ee7c841e4ef790ea7bd53e75c0a09c4cc2 /src/mongo/db | |
parent | 8cdc51e7810f7fd8898a4c60b935e389f04659ee (diff) | |
download | mongo-1041dd848e25e879260d1015d8da4f72ee7993fe.tar.gz |
SERVER-40476 remove mongoutils::str
Rename utils/mongoutils/str.h => utils/str.h
Rename namespace mongoutils::str => str
Rename mongo::strcasecmp => str::caseInsensitiveCompare.
Diffstat (limited to 'src/mongo/db')
264 files changed, 609 insertions, 708 deletions
diff --git a/src/mongo/db/auth/action_set.cpp b/src/mongo/db/auth/action_set.cpp index 5e1d490bf8a..247a5dfac2c 100644 --- a/src/mongo/db/auth/action_set.cpp +++ b/src/mongo/db/auth/action_set.cpp @@ -39,7 +39,7 @@ #include "mongo/base/status.h" #include "mongo/bson/util/builder.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { diff --git a/src/mongo/db/auth/authorization_manager.cpp b/src/mongo/db/auth/authorization_manager.cpp index 9d9575c1a08..0e4851d2b72 100644 --- a/src/mongo/db/auth/authorization_manager.cpp +++ b/src/mongo/db/auth/authorization_manager.cpp @@ -62,7 +62,7 @@ #include "mongo/stdx/unordered_map.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" mongo::AuthInfo mongo::internalSecurity; diff --git a/src/mongo/db/auth/authorization_manager_impl.cpp b/src/mongo/db/auth/authorization_manager_impl.cpp index adf16c787d8..10b4fd6bdc6 100644 --- a/src/mongo/db/auth/authorization_manager_impl.cpp +++ b/src/mongo/db/auth/authorization_manager_impl.cpp @@ -67,7 +67,7 @@ #include "mongo/stdx/unordered_map.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { @@ -447,11 +447,10 @@ Status AuthorizationManagerImpl::_initializeUserFromPrivilegeDocument(User* user std::string userName = parser.extractUserNameFromUserDocument(privDoc); if (userName != user->getName().getUser()) { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "User name from privilege document \"" - << userName - << "\" doesn't match name of provided User \"" - << user->getName().getUser() - << "\""); + str::stream() << "User name from privilege document \"" << userName + << "\" doesn't match name of provided User \"" + << user->getName().getUser() + << "\""); } user->setID(parser.extractUserIDFromUserDocument(privDoc)); @@ -612,10 +611,10 @@ StatusWith<UserHandle> AuthorizationManagerImpl::_acquireUserSlowPath(CacheGuard switch (authzVersion) { default: - status = Status(ErrorCodes::BadValue, - mongoutils::str::stream() - << "Illegal value for authorization data schema version, " - << authzVersion); + status = + Status(ErrorCodes::BadValue, + str::stream() << "Illegal value for authorization data schema version, " + << authzVersion); break; case schemaVersion28SCRAM: case schemaVersion26Final: @@ -623,11 +622,10 @@ StatusWith<UserHandle> AuthorizationManagerImpl::_acquireUserSlowPath(CacheGuard status = _fetchUserV2(opCtx, userName, &user); break; case schemaVersion24: - status = Status(ErrorCodes::AuthSchemaIncompatible, - mongoutils::str::stream() - << "Authorization data schema version " - << schemaVersion24 - << " not supported after MongoDB version 2.6."); + status = + Status(ErrorCodes::AuthSchemaIncompatible, + str::stream() << "Authorization data schema version " << schemaVersion24 + << " not supported after MongoDB version 2.6."); break; } if (status.isOK()) diff --git a/src/mongo/db/auth/authorization_manager_test.cpp b/src/mongo/db/auth/authorization_manager_test.cpp index 7c8c1520e83..cddb514048c 100644 --- a/src/mongo/db/auth/authorization_manager_test.cpp +++ b/src/mongo/db/auth/authorization_manager_test.cpp @@ -254,12 +254,11 @@ private: << userName.getDB()), userDoc); if (status == ErrorCodes::NoMatchingDocument) { - status = - Status(ErrorCodes::UserNotFound, - mongoutils::str::stream() << "Could not find user \"" << userName.getUser() - << "\" for db \"" - << userName.getDB() - << "\""); + status = Status(ErrorCodes::UserNotFound, + str::stream() << "Could not find user \"" << userName.getUser() + << "\" for db \"" + << userName.getDB() + << "\""); } return status; } diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp index eb135417167..065049da621 100644 --- a/src/mongo/db/auth/authorization_session.cpp +++ b/src/mongo/db/auth/authorization_session.cpp @@ -53,7 +53,7 @@ #include "mongo/db/pipeline/lite_parsed_pipeline.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/auth/authorization_session_impl.cpp b/src/mongo/db/auth/authorization_session_impl.cpp index f73e8a46b6d..ed69d130ecf 100644 --- a/src/mongo/db/auth/authorization_session_impl.cpp +++ b/src/mongo/db/auth/authorization_session_impl.cpp @@ -54,7 +54,7 @@ #include "mongo/db/pipeline/lite_parsed_pipeline.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -256,7 +256,7 @@ StatusWith<PrivilegeVector> AuthorizationSessionImpl::getPrivilegesForAggregate( const NamespaceString& nss, const BSONObj& cmdObj, bool isMongos) { if (!nss.isValid()) { return Status(ErrorCodes::InvalidNamespace, - mongoutils::str::stream() << "Invalid input namespace, " << nss.ns()); + str::stream() << "Invalid input namespace, " << nss.ns()); } PrivilegeVector privileges; diff --git a/src/mongo/db/auth/authz_manager_external_state_d.cpp b/src/mongo/db/auth/authz_manager_external_state_d.cpp index 8a05514a45f..751ce2e2d57 100644 --- a/src/mongo/db/auth/authz_manager_external_state_d.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_d.cpp @@ -47,7 +47,7 @@ #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -115,9 +115,8 @@ Status AuthzManagerExternalStateMongod::findOne(OperationContext* opCtx, return Status::OK(); } return Status(ErrorCodes::NoMatchingDocument, - mongoutils::str::stream() << "No document in " << collectionName.ns() - << " matches " - << query); + str::stream() << "No document in " << collectionName.ns() << " matches " + << query); } MONGO_REGISTER_SHIM(AuthzManagerExternalState::create) diff --git a/src/mongo/db/auth/authz_manager_external_state_local.cpp b/src/mongo/db/auth/authz_manager_external_state_local.cpp index 48bb3c2c5b0..386a82e9f1e 100644 --- a/src/mongo/db/auth/authz_manager_external_state_local.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_local.cpp @@ -44,8 +44,8 @@ #include "mongo/db/operation_context.h" #include "mongo/db/server_options.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/ssl_types.h" +#include "mongo/util/str.h" namespace mongo { @@ -87,12 +87,11 @@ Status AuthzManagerExternalStateLocal::getStoredAuthorizationVersion(OperationCo return Status::OK(); } else if (versionElement.eoo()) { return Status(ErrorCodes::NoSuchKey, - mongoutils::str::stream() << "No " - << AuthorizationManager::schemaVersionFieldName - << " field in version document."); + str::stream() << "No " << AuthorizationManager::schemaVersionFieldName + << " field in version document."); } else { return Status(ErrorCodes::TypeMismatch, - mongoutils::str::stream() + str::stream() << "Could not determine schema version of authorization data. " "Bad (non-numeric) type " << typeName(versionElement.type()) @@ -136,11 +135,10 @@ void addPrivilegeObjectsOrWarningsToArrayElement(mutablebson::Element privileges fassert(17157, warningsElement.appendString( "", - std::string(mongoutils::str::stream() - << "Skipped privileges on resource " - << privileges[i].getResourcePattern().toString() - << ". Reason: " - << errmsg))); + std::string(str::stream() << "Skipped privileges on resource " + << privileges[i].getResourcePattern().toString() + << ". Reason: " + << errmsg))); } } } @@ -298,11 +296,11 @@ Status AuthzManagerExternalStateLocal::_getUserDocument(OperationContext* opCtx, userDoc); if (status == ErrorCodes::NoMatchingDocument) { - status = Status(ErrorCodes::UserNotFound, - mongoutils::str::stream() << "Could not find user \"" << userName.getUser() - << "\" for db \"" - << userName.getDB() - << "\""); + status = + Status(ErrorCodes::UserNotFound, + str::stream() << "Could not find user \"" << userName.getUser() << "\" for db \"" + << userName.getDB() + << "\""); } return status; } @@ -570,7 +568,7 @@ private: size_t splitPoint = idstr.find('.'); if (splitPoint == std::string::npos) { return StatusWith<UserName>(ErrorCodes::FailedToParse, - mongoutils::str::stream() + str::stream() << "_id entries for user documents must be of " "the form <dbname>.<username>. Found: " << idstr); diff --git a/src/mongo/db/auth/authz_manager_external_state_mock.cpp b/src/mongo/db/auth/authz_manager_external_state_mock.cpp index a86fe9f9af3..acaf8389712 100644 --- a/src/mongo/db/auth/authz_manager_external_state_mock.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_mock.cpp @@ -46,7 +46,7 @@ #include "mongo/db/update/update_driver.h" #include "mongo/stdx/memory.h" #include "mongo/util/map_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -81,11 +81,10 @@ void addPrivilegeObjectsOrWarningsToArrayElement(mutablebson::Element privileges fassert(17179, warningsElement.appendString( "", - std::string(mongoutils::str::stream() - << "Skipped privileges on resource " - << privileges[i].getResourcePattern().toString() - << ". Reason: " - << errmsg))); + std::string(str::stream() << "Skipped privileges on resource " + << privileges[i].getResourcePattern().toString() + << ". Reason: " + << errmsg))); } } } diff --git a/src/mongo/db/auth/authz_manager_external_state_s.cpp b/src/mongo/db/auth/authz_manager_external_state_s.cpp index 5e5814fefce..fe73ae30754 100644 --- a/src/mongo/db/auth/authz_manager_external_state_s.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_s.cpp @@ -45,8 +45,8 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/s/grid.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/ssl_types.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { diff --git a/src/mongo/db/auth/generate_action_types.py b/src/mongo/db/auth/generate_action_types.py index 618669fdfee..c5f94cfe140 100755 --- a/src/mongo/db/auth/generate_action_types.py +++ b/src/mongo/db/auth/generate_action_types.py @@ -156,7 +156,7 @@ sourceFileTemplate = """// AUTO-GENERATED FILE DO NOT EDIT #include <string> #include "mongo/base/status.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -177,8 +177,8 @@ namespace mongo { Status ActionType::parseActionFromString(const std::string& action, ActionType* result) { %(fromStringIfStatements)s return Status(ErrorCodes::FailedToParse, - mongoutils::str::stream() << "Unrecognized action privilege string: " - << action); + str::stream() << "Unrecognized action privilege string: " + << action); } // Takes an ActionType and returns the string representation diff --git a/src/mongo/db/auth/privilege_parser.cpp b/src/mongo/db/auth/privilege_parser.cpp index b53605d873a..2cae5290649 100644 --- a/src/mongo/db/auth/privilege_parser.cpp +++ b/src/mongo/db/auth/privilege_parser.cpp @@ -34,14 +34,14 @@ #include "mongo/db/auth/privilege.h" #include "mongo/db/field_parser.h" #include "mongo/db/namespace_string.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { using std::string; using std::vector; -using mongoutils::str::stream; +using str::stream; const BSONField<bool> ParsedResource::anyResource("anyResource"); const BSONField<bool> ParsedResource::cluster("cluster"); diff --git a/src/mongo/db/auth/role_graph.cpp b/src/mongo/db/auth/role_graph.cpp index fbe341cb130..8093864dfe3 100644 --- a/src/mongo/db/auth/role_graph.cpp +++ b/src/mongo/db/auth/role_graph.cpp @@ -38,7 +38,7 @@ #include "mongo/db/auth/privilege.h" #include "mongo/db/auth/role_name.h" #include "mongo/stdx/unordered_set.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -81,8 +81,7 @@ bool RoleGraph::_roleExistsDontCreateBuiltin(const RoleName& role) { Status RoleGraph::createRole(const RoleName& role) { if (roleExists(role)) { return Status(ErrorCodes::Error(51007), - mongoutils::str::stream() << "Role: " << role.getFullName() - << " already exists"); + str::stream() << "Role: " << role.getFullName() << " already exists"); } _createRoleDontCheckIfRoleExists(role); @@ -103,13 +102,11 @@ void RoleGraph::_createRoleDontCheckIfRoleExists(const RoleName& role) { Status RoleGraph::deleteRole(const RoleName& role) { if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } if (isBuiltinRole(role)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot delete built-in role: " - << role.getFullName()); + str::stream() << "Cannot delete built-in role: " << role.getFullName()); } for (std::vector<RoleName>::iterator it = _roleToSubordinates[role].begin(); @@ -166,18 +163,16 @@ const PrivilegeVector& RoleGraph::getAllPrivileges(const RoleName& role) { Status RoleGraph::addRoleToRole(const RoleName& recipient, const RoleName& role) { if (!roleExists(recipient)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << recipient.getFullName() - << " does not exist"); + str::stream() << "Role: " << recipient.getFullName() << " does not exist"); } if (isBuiltinRole(recipient)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot grant roles to built-in role: " - << role.getFullName()); + str::stream() << "Cannot grant roles to built-in role: " + << role.getFullName()); } if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } if (std::find(_roleToSubordinates[recipient].begin(), @@ -194,18 +189,16 @@ Status RoleGraph::addRoleToRole(const RoleName& recipient, const RoleName& role) Status RoleGraph::removeRoleFromRole(const RoleName& recipient, const RoleName& role) { if (!roleExists(recipient)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << recipient.getFullName() - << " does not exist"); + str::stream() << "Role: " << recipient.getFullName() << " does not exist"); } if (isBuiltinRole(recipient)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot remove roles from built-in role: " - << role.getFullName()); + str::stream() << "Cannot remove roles from built-in role: " + << role.getFullName()); } if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } std::vector<RoleName>::iterator itToRm = @@ -214,9 +207,9 @@ Status RoleGraph::removeRoleFromRole(const RoleName& recipient, const RoleName& _roleToMembers[role].erase(itToRm); } else { return Status(ErrorCodes::RolesNotRelated, - mongoutils::str::stream() << recipient.getFullName() << " is not a member" - " of " - << role.getFullName()); + str::stream() << recipient.getFullName() << " is not a member" + " of " + << role.getFullName()); } itToRm = std::find( @@ -230,13 +223,12 @@ Status RoleGraph::removeAllRolesFromRole(const RoleName& victim) { typedef std::vector<RoleName> RoleNameVector; if (!roleExists(victim)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << victim.getFullName() - << " does not exist"); + str::stream() << "Role: " << victim.getFullName() << " does not exist"); } if (isBuiltinRole(victim)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot remove roles from built-in role: " - << victim.getFullName()); + str::stream() << "Cannot remove roles from built-in role: " + << victim.getFullName()); } RoleNameVector& subordinatesOfVictim = _roleToSubordinates[victim]; @@ -257,13 +249,12 @@ Status RoleGraph::removeAllRolesFromRole(const RoleName& victim) { Status RoleGraph::addPrivilegeToRole(const RoleName& role, const Privilege& privilegeToAdd) { if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } if (isBuiltinRole(role)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot grant privileges to built-in role: " - << role.getFullName()); + str::stream() << "Cannot grant privileges to built-in role: " + << role.getFullName()); } _addPrivilegeToRoleNoChecks(role, privilegeToAdd); @@ -282,13 +273,12 @@ Status RoleGraph::addPrivilegesToRole(const RoleName& role, const PrivilegeVector& privilegesToAdd) { if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } if (isBuiltinRole(role)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot grant privileges to built-in role: " - << role.getFullName()); + str::stream() << "Cannot grant privileges to built-in role: " + << role.getFullName()); } for (PrivilegeVector::const_iterator it = privilegesToAdd.begin(); it != privilegesToAdd.end(); @@ -302,13 +292,12 @@ Status RoleGraph::removePrivilegeFromRole(const RoleName& role, const Privilege& privilegeToRemove) { if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } if (isBuiltinRole(role)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot remove privileges from built-in role: " - << role.getFullName()); + str::stream() << "Cannot remove privileges from built-in role: " + << role.getFullName()); } PrivilegeVector& currentPrivileges = _directPrivilegesForRole[role]; @@ -320,13 +309,12 @@ Status RoleGraph::removePrivilegeFromRole(const RoleName& role, if (!curActions.isSupersetOf(privilegeToRemove.getActions())) { // Didn't possess all the actions being removed. - return Status( - ErrorCodes::PrivilegeNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not contain a privilege on " - << privilegeToRemove.getResourcePattern().toString() - << " with actions: " - << privilegeToRemove.getActions().toString()); + return Status(ErrorCodes::PrivilegeNotFound, + str::stream() << "Role: " << role.getFullName() + << " does not contain a privilege on " + << privilegeToRemove.getResourcePattern().toString() + << " with actions: " + << privilegeToRemove.getActions().toString()); } curPrivilege.removeActions(privilegeToRemove.getActions()); @@ -337,10 +325,9 @@ Status RoleGraph::removePrivilegeFromRole(const RoleName& role, } } return Status(ErrorCodes::PrivilegeNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not " - "contain any privileges on " - << privilegeToRemove.getResourcePattern().toString()); + str::stream() << "Role: " << role.getFullName() << " does not " + "contain any privileges on " + << privilegeToRemove.getResourcePattern().toString()); } Status RoleGraph::removePrivilegesFromRole(const RoleName& role, @@ -359,13 +346,12 @@ Status RoleGraph::removePrivilegesFromRole(const RoleName& role, Status RoleGraph::removeAllPrivilegesFromRole(const RoleName& role) { if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } if (isBuiltinRole(role)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot remove privileges from built-in role: " - << role.getFullName()); + str::stream() << "Cannot remove privileges from built-in role: " + << role.getFullName()); } _directPrivilegesForRole[role].clear(); return Status::OK(); @@ -375,13 +361,12 @@ Status RoleGraph::replaceRestrictionsForRole(const RoleName& role, SharedRestrictionDocument restrictions) { if (!roleExists(role)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << role.getFullName() - << " does not exist"); + str::stream() << "Role: " << role.getFullName() << " does not exist"); } if (isBuiltinRole(role)) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot remove restrictions from built-in role: " - << role.getFullName()); + str::stream() << "Cannot remove restrictions from built-in role: " + << role.getFullName()); } _directRestrictionsForRole[role] = std::move(restrictions); return Status::OK(); @@ -449,8 +434,8 @@ Status RoleGraph::_recomputePrivilegeDataHelper(const RoleName& startingRole, if (!roleExists(currentRole)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << "Role: " << currentRole.getFullName() - << " does not exist"); + str::stream() << "Role: " << currentRole.getFullName() + << " does not exist"); } // Check for cycles @@ -558,10 +543,9 @@ Status RoleGraph::getBSONForRole(RoleGraph* graph, mutablebson::Element result) try { if (!graph->roleExists(roleName)) { return Status(ErrorCodes::RoleNotFound, - mongoutils::str::stream() << roleName.getFullName() - << "does not name an existing role"); + str::stream() << roleName.getFullName() << "does not name an existing role"); } - std::string id = mongoutils::str::stream() << roleName.getDB() << "." << roleName.getRole(); + std::string id = str::stream() << roleName.getDB() << "." << roleName.getRole(); uassertStatusOK(result.appendString("_id", id)); uassertStatusOK( result.appendString(AuthorizationManager::ROLE_NAME_FIELD_NAME, roleName.getRole())); diff --git a/src/mongo/db/auth/role_graph_test.cpp b/src/mongo/db/auth/role_graph_test.cpp index 6935ad1623e..a2ed3dece7f 100644 --- a/src/mongo/db/auth/role_graph_test.cpp +++ b/src/mongo/db/auth/role_graph_test.cpp @@ -36,8 +36,8 @@ #include "mongo/bson/mutable/document.h" #include "mongo/db/auth/role_graph.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/sequence_util.h" +#include "mongo/util/str.h" namespace mongo { namespace { @@ -206,7 +206,7 @@ TEST(RoleGraphTest, AddRemoveRoles) { } else if (cur == roleC) { ASSERT_EQUALS(it.next().getFullName(), roleB.getFullName()); } else { - FAIL(mongoutils::str::stream() << "unexpected role returned: " << cur.getFullName()); + FAIL(str::stream() << "unexpected role returned: " << cur.getFullName()); } ASSERT_FALSE(it.more()); @@ -226,7 +226,7 @@ TEST(RoleGraphTest, AddRemoveRoles) { } else if (cur == roleD) { hasD = true; } else { - FAIL(mongoutils::str::stream() << "unexpected role returned: " << cur.getFullName()); + FAIL(str::stream() << "unexpected role returned: " << cur.getFullName()); } } ASSERT_EQUALS(3, num); @@ -241,7 +241,7 @@ TEST(RoleGraphTest, AddRemoveRoles) { } else if (cur == roleD) { ASSERT_EQUALS(it.next().getFullName(), roleC.getFullName()); } else { - FAIL(mongoutils::str::stream() << "unexpected role returned: " << cur.getFullName()); + FAIL(str::stream() << "unexpected role returned: " << cur.getFullName()); } ASSERT_FALSE(it.more()); @@ -262,7 +262,7 @@ TEST(RoleGraphTest, AddRemoveRoles) { } else if (cur == roleB) { ASSERT_EQUALS(it.next().getFullName(), roleA.getFullName()); } else { - FAIL(mongoutils::str::stream() << "unexpected role returned: " << cur.getFullName()); + FAIL(str::stream() << "unexpected role returned: " << cur.getFullName()); } ASSERT_FALSE(it.more()); diff --git a/src/mongo/db/auth/role_graph_update.cpp b/src/mongo/db/auth/role_graph_update.cpp index 5ae2f6119a9..33820f41233 100644 --- a/src/mongo/db/auth/role_graph_update.cpp +++ b/src/mongo/db/auth/role_graph_update.cpp @@ -40,7 +40,7 @@ #include "mongo/db/auth/role_graph.h" #include "mongo/db/auth/user_management_commands_parser.h" #include "mongo/db/update/update_driver.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -90,12 +90,11 @@ Status checkIdMatchesRoleName(const BSONElement& idElement, const RoleName& role if (firstDot == std::string::npos || idField.substr(0, firstDot) != roleName.getDB() || idField.substr(firstDot + 1) != roleName.getRole()) { return Status(ErrorCodes::FailedToParse, - mongoutils::str::stream() - << "Role document _id fields must be encoded as the string " - "dbname.rolename. Found " - << idField - << " for " - << roleName.getFullName()); + str::stream() << "Role document _id fields must be encoded as the string " + "dbname.rolename. Found " + << idField + << " for " + << roleName.getFullName()); } return Status::OK(); } @@ -369,8 +368,7 @@ Status RoleGraph::handleLogOp(OperationContext* opCtx, return Status::OK(); if (op[0] == '\0' || op[1] != '\0') { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "Unrecognized \"op\" field value \"" << op - << '"'); + str::stream() << "Unrecognized \"op\" field value \"" << op << '"'); } if (ns.db() != AuthorizationManager::rolesCollectionNamespace.db()) @@ -405,8 +403,7 @@ Status RoleGraph::handleLogOp(OperationContext* opCtx, "Namespace admin.system.roles is not a valid target for commands"); default: return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "Unrecognized \"op\" field value \"" << op - << '"'); + str::stream() << "Unrecognized \"op\" field value \"" << op << '"'); } } diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp index 1218f37f4b8..b9886aaa4f0 100644 --- a/src/mongo/db/auth/sasl_commands.cpp +++ b/src/mongo/db/auth/sasl_commands.cpp @@ -53,8 +53,8 @@ #include "mongo/db/server_options.h" #include "mongo/util/base64.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/sequence_util.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { diff --git a/src/mongo/db/auth/sasl_mechanism_registry.cpp b/src/mongo/db/auth/sasl_mechanism_registry.cpp index 7a88a8ec15c..9626718d79e 100644 --- a/src/mongo/db/auth/sasl_mechanism_registry.cpp +++ b/src/mongo/db/auth/sasl_mechanism_registry.cpp @@ -78,10 +78,10 @@ StatusWith<std::unique_ptr<ServerMechanismBase>> SASLServerMechanismRegistry::ge } return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "Unsupported mechanism '" << mechanismName - << "' on authentication database '" - << authenticationDatabase - << "'"); + str::stream() << "Unsupported mechanism '" << mechanismName + << "' on authentication database '" + << authenticationDatabase + << "'"); } void SASLServerMechanismRegistry::advertiseMechanismNamesForUser(OperationContext* opCtx, diff --git a/src/mongo/db/auth/sasl_options_init.cpp b/src/mongo/db/auth/sasl_options_init.cpp index 7f95efd89a9..ea8f5f7a65a 100644 --- a/src/mongo/db/auth/sasl_options_init.cpp +++ b/src/mongo/db/auth/sasl_options_init.cpp @@ -34,10 +34,10 @@ #include "mongo/base/status.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/options_parser/startup_option_init.h" #include "mongo/util/options_parser/startup_options.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/auth/sasl_plain_server_conversation.cpp b/src/mongo/db/auth/sasl_plain_server_conversation.cpp index f6579a36c7f..5ef2cf6ac9e 100644 --- a/src/mongo/db/auth/sasl_plain_server_conversation.cpp +++ b/src/mongo/db/auth/sasl_plain_server_conversation.cpp @@ -120,7 +120,7 @@ StatusWith<std::tuple<bool, std::string>> SASLPlainServerMechanism::stepImpl( } } catch (std::out_of_range&) { return Status(ErrorCodes::AuthenticationFailed, - mongoutils::str::stream() << "Incorrectly formatted PLAIN client message"); + str::stream() << "Incorrectly formatted PLAIN client message"); } // The authentication database is also the source database for the user. diff --git a/src/mongo/db/auth/sasl_scram_server_conversation.cpp b/src/mongo/db/auth/sasl_scram_server_conversation.cpp index 9415376afe5..04a8e53798a 100644 --- a/src/mongo/db/auth/sasl_scram_server_conversation.cpp +++ b/src/mongo/db/auth/sasl_scram_server_conversation.cpp @@ -47,8 +47,8 @@ #include "mongo/platform/random.h" #include "mongo/util/base64.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/sequence_util.h" +#include "mongo/util/str.h" #include "mongo/util/text.h" namespace mongo { diff --git a/src/mongo/db/auth/security_file.cpp b/src/mongo/db/auth/security_file.cpp index 825e7592d0b..04efa479fbc 100644 --- a/src/mongo/db/auth/security_file.cpp +++ b/src/mongo/db/auth/security_file.cpp @@ -40,7 +40,7 @@ #include <vector> #include "mongo/base/status_with.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "yaml-cpp/yaml.h" diff --git a/src/mongo/db/auth/user_document_parser.cpp b/src/mongo/db/auth/user_document_parser.cpp index 552898b8552..20387c19892 100644 --- a/src/mongo/db/auth/user_document_parser.cpp +++ b/src/mongo/db/auth/user_document_parser.cpp @@ -42,7 +42,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { @@ -153,8 +153,8 @@ Status V2UserDocumentParser::checkValidUserDocument(const BSONObj& doc) const { StringData userDBStr = userDBElement.valueStringData(); if (!NamespaceString::validDBName(userDBStr, NamespaceString::DollarInDbNameBehavior::Allow) && userDBStr != "$external") { - return _badValue(mongoutils::str::stream() << "'" << userDBStr - << "' is not a valid value for the db field."); + return _badValue(str::stream() << "'" << userDBStr + << "' is not a valid value for the db field."); } // Validate the "credentials" element diff --git a/src/mongo/db/auth/user_management_commands_parser.cpp b/src/mongo/db/auth/user_management_commands_parser.cpp index 5af50b73aa9..8a03d8a4b7d 100644 --- a/src/mongo/db/auth/user_management_commands_parser.cpp +++ b/src/mongo/db/auth/user_management_commands_parser.cpp @@ -48,7 +48,7 @@ #include "mongo/db/commands.h" #include "mongo/db/jsobj.h" #include "mongo/stdx/unordered_set.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { @@ -65,9 +65,9 @@ Status _checkNoExtraFields(const BSONObj& cmdObj, StringData fieldName = (*iter).fieldNameStringData(); if (!isGenericArgument(fieldName) && !validFieldNames.count(fieldName.toString())) { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "\"" << fieldName << "\" is not " - "a valid argument to " - << cmdName); + str::stream() << "\"" << fieldName << "\" is not " + "a valid argument to " + << cmdName); } } return Status::OK(); @@ -176,8 +176,8 @@ Status parseRolePossessionManipulationCommands(const BSONObj& cmdObj, if (!parsedRoleNames->size()) { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << cmdName << " command requires a non-empty " - "\"roles\" array"); + str::stream() << cmdName << " command requires a non-empty " + "\"roles\" array"); } return Status::OK(); } @@ -635,8 +635,8 @@ Status parseAndValidateRolePrivilegeManipulationCommands(const BSONObj& cmdObj, } if (!parsedPrivileges->size()) { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << cmdName << " command requires a non-empty " - "\"privileges\" array"); + str::stream() << cmdName << " command requires a non-empty " + "\"privileges\" array"); } return Status::OK(); diff --git a/src/mongo/db/background.cpp b/src/mongo/db/background.cpp index 156955134ce..78d10eda93e 100644 --- a/src/mongo/db/background.cpp +++ b/src/mongo/db/background.cpp @@ -39,7 +39,7 @@ #include "mongo/stdx/thread.h" #include "mongo/util/assert_util.h" #include "mongo/util/map_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/string_map.h" namespace mongo { @@ -139,7 +139,7 @@ bool BackgroundOperation::inProgForNs(StringData ns) { void BackgroundOperation::assertNoBgOpInProg() { for (auto& db : dbsInProg) { uassert(ErrorCodes::BackgroundOperationInProgressForDatabase, - mongoutils::str::stream() + str::stream() << "cannot perform operation: a background operation is currently running for " "database " << db.first, @@ -149,7 +149,7 @@ void BackgroundOperation::assertNoBgOpInProg() { void BackgroundOperation::assertNoBgOpInProgForDb(StringData db) { uassert(ErrorCodes::BackgroundOperationInProgressForDatabase, - mongoutils::str::stream() + str::stream() << "cannot perform operation: a background operation is currently running for " "database " << db, @@ -158,7 +158,7 @@ void BackgroundOperation::assertNoBgOpInProgForDb(StringData db) { void BackgroundOperation::assertNoBgOpInProgForNs(StringData ns) { uassert(ErrorCodes::BackgroundOperationInProgressForNamespace, - mongoutils::str::stream() + str::stream() << "cannot perform operation: a background operation is currently running for " "collection " << ns, diff --git a/src/mongo/db/catalog/collection_options.cpp b/src/mongo/db/catalog/collection_options.cpp index 9ab9ffeb91b..941c3adf36e 100644 --- a/src/mongo/db/catalog/collection_options.cpp +++ b/src/mongo/db/catalog/collection_options.cpp @@ -38,7 +38,7 @@ #include "mongo/db/commands.h" #include "mongo/db/query/collation/collator_factory_interface.h" #include "mongo/db/query/collation/collator_interface.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/catalog/commit_quorum_options.cpp b/src/mongo/db/catalog/commit_quorum_options.cpp index ffdb47ac6af..254682e9eea 100644 --- a/src/mongo/db/catalog/commit_quorum_options.cpp +++ b/src/mongo/db/catalog/commit_quorum_options.cpp @@ -35,7 +35,7 @@ #include "mongo/base/string_data.h" #include "mongo/bson/util/bson_extract.h" #include "mongo/db/field_parser.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/catalog/database_impl.cpp b/src/mongo/db/catalog/database_impl.cpp index cad05f316fb..5ac4bdf197b 100644 --- a/src/mongo/db/catalog/database_impl.cpp +++ b/src/mongo/db/catalog/database_impl.cpp @@ -557,18 +557,17 @@ Status DatabaseImpl::renameCollection(OperationContext* opCtx, return Status(ErrorCodes::NamespaceNotFound, "collection not found to rename"); } invariant(!collToRename->getIndexCatalog()->haveAnyIndexesInProgress(), - mongoutils::str::stream() - << "cannot perform operation: an index build is currently running for " - "collection " - << fromNSS); + str::stream() << "cannot perform operation: an index build is currently running for " + "collection " + << fromNSS); Collection* toColl = getCollection(opCtx, toNSS); if (toColl) { - invariant(!toColl->getIndexCatalog()->haveAnyIndexesInProgress(), - mongoutils::str::stream() - << "cannot perform operation: an index build is currently running for " - "collection " - << toNSS); + invariant( + !toColl->getIndexCatalog()->haveAnyIndexesInProgress(), + str::stream() << "cannot perform operation: an index build is currently running for " + "collection " + << toNSS); } log() << "renameCollection: renaming collection " << collToRename->uuid()->toString() diff --git a/src/mongo/db/catalog/drop_database_test.cpp b/src/mongo/db/catalog/drop_database_test.cpp index bd9aaa25505..26ada8ef871 100644 --- a/src/mongo/db/catalog/drop_database_test.cpp +++ b/src/mongo/db/catalog/drop_database_test.cpp @@ -53,7 +53,7 @@ #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/catalog/index_builds_manager.cpp b/src/mongo/db/catalog/index_builds_manager.cpp index ebf96a0eb71..17597efd695 100644 --- a/src/mongo/db/catalog/index_builds_manager.cpp +++ b/src/mongo/db/catalog/index_builds_manager.cpp @@ -43,7 +43,7 @@ #include "mongo/db/storage/write_unit_of_work.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/catalog/index_catalog_impl.cpp b/src/mongo/db/catalog/index_catalog_impl.cpp index d9895b5aba1..e56face0b9b 100644 --- a/src/mongo/db/catalog/index_catalog_impl.cpp +++ b/src/mongo/db/catalog/index_catalog_impl.cpp @@ -68,8 +68,8 @@ #include "mongo/db/storage/storage_engine_init.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/represent_as.h" +#include "mongo/util/str.h" namespace mongo { @@ -742,8 +742,7 @@ void IndexCatalogImpl::dropAllIndexes(OperationContext* opCtx, invariant(opCtx->lockState()->isCollectionLockedForMode(_collection->ns(), MODE_X)); uassert(ErrorCodes::BackgroundOperationInProgressForNamespace, - mongoutils::str::stream() - << "cannot perform operation: an index build is currently running", + str::stream() << "cannot perform operation: an index build is currently running", !haveAnyIndexesInProgress()); // make sure nothing in progress diff --git a/src/mongo/db/catalog/index_key_validate.cpp b/src/mongo/db/catalog/index_key_validate.cpp index c63f2530d20..01d822f6a29 100644 --- a/src/mongo/db/catalog/index_key_validate.cpp +++ b/src/mongo/db/catalog/index_key_validate.cpp @@ -52,8 +52,8 @@ #include "mongo/db/service_context.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/represent_as.h" +#include "mongo/util/str.h" namespace mongo { namespace index_key_validate { @@ -121,8 +121,7 @@ Status validateKeyPattern(const BSONObj& key, IndexDescriptor::IndexVersion inde string pluginName = IndexNames::findPluginName(key); if (pluginName.size()) { if (!IndexNames::isKnownName(pluginName)) - return Status( - code, mongoutils::str::stream() << "Unknown index plugin '" << pluginName << '\''); + return Status(code, str::stream() << "Unknown index plugin '" << pluginName << '\''); } BSONObjIterator it(key); @@ -306,9 +305,7 @@ StatusWith<BSONObj> validateIndexSpec( (IndexNames::findPluginName(indexSpec.getObjectField( IndexDescriptor::kKeyPatternFieldName)) == IndexNames::WILDCARD)) { return {ErrorCodes::CannotCreateIndex, - mongoutils::str::stream() << "Unknown index plugin '" - << IndexNames::WILDCARD - << "'"}; + str::stream() << "Unknown index plugin '" << IndexNames::WILDCARD << "'"}; } hasKeyPatternField = true; } else if (IndexDescriptor::kIndexNameFieldName == indexSpecElemFieldName) { diff --git a/src/mongo/db/catalog/rename_collection_test.cpp b/src/mongo/db/catalog/rename_collection_test.cpp index 439b660eaa7..3756072fcae 100644 --- a/src/mongo/db/catalog/rename_collection_test.cpp +++ b/src/mongo/db/catalog/rename_collection_test.cpp @@ -60,7 +60,7 @@ #include "mongo/unittest/death_test.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace { diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp index a8afd9458cd..fc77a51ebc6 100644 --- a/src/mongo/db/client.cpp +++ b/src/mongo/db/client.cpp @@ -45,7 +45,7 @@ #include "mongo/stdx/thread.h" #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/exit.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index ddceac82399..3f49093f124 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -64,7 +64,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index 0623517666b..ea2641218d7 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -61,7 +61,7 @@ #include "mongo/util/fail_point_service.h" #include "mongo/util/invariant.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp index e745945a7fe..6a8c49f3e20 100644 --- a/src/mongo/db/commands/explain_cmd.cpp +++ b/src/mongo/db/commands/explain_cmd.cpp @@ -32,7 +32,7 @@ #include "mongo/db/command_can_run_here.h" #include "mongo/db/commands.h" #include "mongo/db/query/explain.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/commands/kill_op.cpp b/src/mongo/db/commands/kill_op.cpp index ab2fad42af5..5a9b639427e 100644 --- a/src/mongo/db/commands/kill_op.cpp +++ b/src/mongo/db/commands/kill_op.cpp @@ -44,7 +44,7 @@ #include "mongo/db/operation_context.h" #include "mongo/db/service_context.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/commands/kill_op_cmd_base.cpp b/src/mongo/db/commands/kill_op_cmd_base.cpp index f6394998de4..71b23d52424 100644 --- a/src/mongo/db/commands/kill_op_cmd_base.cpp +++ b/src/mongo/db/commands/kill_op_cmd_base.cpp @@ -36,7 +36,7 @@ #include "mongo/db/auth/authorization_session.h" #include "mongo/db/client.h" #include "mongo/db/operation_context.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 99dacfecbfa..1327d5fe560 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -75,8 +75,8 @@ #include "mongo/scripting/engine.h" #include "mongo/stdx/mutex.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/commands/mr_common.cpp b/src/mongo/db/commands/mr_common.cpp index 6e739a8ea2d..252f81379ac 100644 --- a/src/mongo/db/commands/mr_common.cpp +++ b/src/mongo/db/commands/mr_common.cpp @@ -38,7 +38,7 @@ #include "mongo/db/catalog/document_validation.h" #include "mongo/db/commands.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -108,7 +108,7 @@ void addPrivilegesRequiredForMapReduce(const BasicCommand* commandTemplate, ResourcePattern inputResource(commandTemplate->parseResourcePattern(dbname, cmdObj)); uassert(ErrorCodes::InvalidNamespace, - mongoutils::str::stream() << "Invalid input resource " << inputResource.toString(), + str::stream() << "Invalid input resource " << inputResource.toString(), inputResource.isExactNamespacePattern()); out->push_back(Privilege(inputResource, ActionType::find)); @@ -128,8 +128,7 @@ void addPrivilegesRequiredForMapReduce(const BasicCommand* commandTemplate, ResourcePattern outputResource( ResourcePattern::forExactNamespace(NamespaceString(outputOptions.finalNamespace))); uassert(ErrorCodes::InvalidNamespace, - mongoutils::str::stream() << "Invalid target namespace " - << outputResource.ns().ns(), + str::stream() << "Invalid target namespace " << outputResource.ns().ns(), outputResource.ns().isValid()); // TODO: check if outputNs exists and add createCollection privilege if not diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp index 3d765eb8838..b68630938dc 100644 --- a/src/mongo/db/commands/parameters.cpp +++ b/src/mongo/db/commands/parameters.cpp @@ -45,7 +45,7 @@ #include "mongo/logger/logger.h" #include "mongo/logger/parse_log_component_settings.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" using std::string; using std::stringstream; @@ -392,8 +392,7 @@ Status LogLevelServerParameter::set(const BSONElement& newValueElement) { int newValue; if (!newValueElement.coerce(&newValue) || newValue < 0) return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "Invalid value for logLevel: " - << newValueElement); + str::stream() << "Invalid value for logLevel: " << newValueElement); LogSeverity newSeverity = (newValue > 0) ? LogSeverity::Debug(newValue) : LogSeverity::Log(); globalLogDomain()->setMinimumLoggedSeverity(newSeverity); return Status::OK(); @@ -406,7 +405,7 @@ Status LogLevelServerParameter::setFromString(const std::string& strLevel) { return status; if (newValue < 0) return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "Invalid value for logLevel: " << newValue); + str::stream() << "Invalid value for logLevel: " << newValue); LogSeverity newSeverity = (newValue > 0) ? LogSeverity::Debug(newValue) : LogSeverity::Log(); globalLogDomain()->setMinimumLoggedSeverity(newSeverity); return Status::OK(); @@ -423,8 +422,8 @@ void LogComponentVerbosityServerParameter::append(OperationContext*, Status LogComponentVerbosityServerParameter::set(const BSONElement& newValueElement) { if (!newValueElement.isABSONObj()) { return Status(ErrorCodes::TypeMismatch, - mongoutils::str::stream() << "log component verbosity is not a BSON object: " - << newValueElement); + str::stream() << "log component verbosity is not a BSON object: " + << newValueElement); } return setLogComponentVerbosity(newValueElement.Obj()); } @@ -456,10 +455,10 @@ Status AutomationServiceDescriptorServerParameter::setFromString(const std::stri auto kMaxSize = 64U; if (str.size() > kMaxSize) return {ErrorCodes::Overflow, - mongoutils::str::stream() << "Value for parameter automationServiceDescriptor" - << " must be no more than " - << kMaxSize - << " bytes"}; + str::stream() << "Value for parameter automationServiceDescriptor" + << " must be no more than " + << kMaxSize + << " bytes"}; { const stdx::lock_guard<stdx::mutex> lock(autoServiceDescriptorMutex); diff --git a/src/mongo/db/commands/plan_cache_commands_test.cpp b/src/mongo/db/commands/plan_cache_commands_test.cpp index c079100491a..08cd42ae9af 100644 --- a/src/mongo/db/commands/plan_cache_commands_test.cpp +++ b/src/mongo/db/commands/plan_cache_commands_test.cpp @@ -42,7 +42,7 @@ #include "mongo/db/query/query_test_service_context.h" #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" using namespace mongo; diff --git a/src/mongo/db/commands/server_status_internal.cpp b/src/mongo/db/commands/server_status_internal.cpp index e85108c9493..738b22e8945 100644 --- a/src/mongo/db/commands/server_status_internal.cpp +++ b/src/mongo/db/commands/server_status_internal.cpp @@ -32,7 +32,7 @@ #include <iostream> #include "mongo/db/commands/server_status_metric.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -41,8 +41,6 @@ using std::endl; using std::map; using std::string; -using namespace mongoutils; - MetricTree* MetricTree::theMetricTree = NULL; void MetricTree::add(ServerStatusMetric* metric) { diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp index 3520097a5c3..ee93eafdf49 100644 --- a/src/mongo/db/commands/user_management_commands.cpp +++ b/src/mongo/db/commands/user_management_commands.cpp @@ -73,10 +73,10 @@ #include "mongo/stdx/unordered_set.h" #include "mongo/util/icu.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/ssl_manager.h" #include "mongo/util/password_digest.h" #include "mongo/util/sequence_util.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" #include "mongo/util/uuid.h" @@ -174,8 +174,8 @@ Status checkOkayToGrantRolesToRole(OperationContext* opCtx, const RoleName& roleToAdd = *it; if (roleToAdd == role) { return Status(ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Cannot grant role " << role.getFullName() - << " to itself."); + str::stream() << "Cannot grant role " << role.getFullName() + << " to itself."); } if (role.getDB() != "admin" && roleToAdd.getDB() != role.getDB()) { @@ -202,11 +202,10 @@ Status checkOkayToGrantRolesToRole(OperationContext* opCtx, } if (sequenceContains(indirectRoles, role)) { - return Status( - ErrorCodes::InvalidRoleModification, - mongoutils::str::stream() << "Granting " << roleToAdd.getFullName() << " to " - << role.getFullName() - << " would introduce a cycle in the role graph."); + return Status(ErrorCodes::InvalidRoleModification, + str::stream() << "Granting " << roleToAdd.getFullName() << " to " + << role.getFullName() + << " would introduce a cycle in the role graph."); } } return Status::OK(); diff --git a/src/mongo/db/commands/user_management_commands_common.cpp b/src/mongo/db/commands/user_management_commands_common.cpp index 27a573926b3..7abc55ab60a 100644 --- a/src/mongo/db/commands/user_management_commands_common.cpp +++ b/src/mongo/db/commands/user_management_commands_common.cpp @@ -47,8 +47,8 @@ #include "mongo/db/auth/user_management_commands_parser.h" #include "mongo/db/jsobj.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/sequence_util.h" +#include "mongo/util/str.h" namespace mongo { namespace auth { diff --git a/src/mongo/db/concurrency/d_concurrency.cpp b/src/mongo/db/concurrency/d_concurrency.cpp index c1f858a75a0..d15c7a1cafc 100644 --- a/src/mongo/db/concurrency/d_concurrency.cpp +++ b/src/mongo/db/concurrency/d_concurrency.cpp @@ -44,8 +44,8 @@ #include "mongo/stdx/mutex.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/stacktrace.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index 3870b7d5420..e6d85f0953a 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -46,8 +46,8 @@ #include "mongo/util/debug_util.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 42f336ec4fb..30936712067 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -54,8 +54,8 @@ #include "mongo/db/write_concern.h" #include "mongo/db/write_concern_options.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/and_hash.cpp b/src/mongo/db/exec/and_hash.cpp index 56a9673d694..76427fe126f 100644 --- a/src/mongo/db/exec/and_hash.cpp +++ b/src/mongo/db/exec/and_hash.cpp @@ -34,7 +34,7 @@ #include "mongo/db/exec/working_set.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { @@ -165,7 +165,7 @@ PlanStage::StageState AndHashStage::doWork(WorkingSetID* out) { if (_hashingChildren) { // Check memory usage of previously hashed results. if (_memUsage > _maxMemUsage) { - mongoutils::str::stream ss; + str::stream ss; ss << "hashed AND stage buffered data usage of " << _memUsage << " bytes exceeds internal limit of " << kDefaultMaxMemUsageBytes << " bytes"; Status status(ErrorCodes::Overflow, ss); diff --git a/src/mongo/db/exec/and_sorted.cpp b/src/mongo/db/exec/and_sorted.cpp index fd0e247b38c..31c7426f8d9 100644 --- a/src/mongo/db/exec/and_sorted.cpp +++ b/src/mongo/db/exec/and_sorted.cpp @@ -33,7 +33,7 @@ #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -122,7 +122,7 @@ PlanStage::StageState AndSortedStage::getTargetRecordId(WorkingSetID* out) { // failed, in which case 'id' is valid. If ID is invalid, we // create our own error message. if (WorkingSet::INVALID_ID == id) { - mongoutils::str::stream ss; + str::stream ss; ss << "sorted AND stage failed to read in results from first child"; Status status(ErrorCodes::InternalError, ss); *out = WorkingSetCommon::allocateStatusMember(_ws, status); diff --git a/src/mongo/db/exec/cached_plan.cpp b/src/mongo/db/exec/cached_plan.cpp index d988e8b5401..b824b0a9e66 100644 --- a/src/mongo/db/exec/cached_plan.cpp +++ b/src/mongo/db/exec/cached_plan.cpp @@ -47,7 +47,7 @@ #include "mongo/db/query/stage_builder.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/transitional_tools_do_not_use/vector_spooling.h" namespace mongo { diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp index 03b3925ce9a..e54415830c2 100644 --- a/src/mongo/db/exec/fetch.cpp +++ b/src/mongo/db/exec/fetch.cpp @@ -38,7 +38,7 @@ #include "mongo/db/exec/working_set_common.h" #include "mongo/stdx/memory.h" #include "mongo/util/fail_point_service.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp index d97b80d7976..8f1eef9e303 100644 --- a/src/mongo/db/exec/limit.cpp +++ b/src/mongo/db/exec/limit.cpp @@ -32,7 +32,7 @@ #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/merge_sort.cpp b/src/mongo/db/exec/merge_sort.cpp index f8ac6192f8a..ba01adee76f 100644 --- a/src/mongo/db/exec/merge_sort.cpp +++ b/src/mongo/db/exec/merge_sort.cpp @@ -34,7 +34,7 @@ #include "mongo/db/exec/working_set_common.h" #include "mongo/db/query/collation/collator_interface.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp index 77a7f0c4766..425a37087ff 100644 --- a/src/mongo/db/exec/multi_plan.cpp +++ b/src/mongo/db/exec/multi_plan.cpp @@ -48,7 +48,7 @@ #include "mongo/db/query/plan_ranker.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/or.cpp b/src/mongo/db/exec/or.cpp index a77100505a3..b7ca736215e 100644 --- a/src/mongo/db/exec/or.cpp +++ b/src/mongo/db/exec/or.cpp @@ -33,7 +33,7 @@ #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/projection.cpp b/src/mongo/db/exec/projection.cpp index 33ecf709de9..1501c5aca95 100644 --- a/src/mongo/db/exec/projection.cpp +++ b/src/mongo/db/exec/projection.cpp @@ -42,7 +42,7 @@ #include "mongo/db/record_id.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/projection_exec.cpp b/src/mongo/db/exec/projection_exec.cpp index 987ce85252b..ca0726b2cdc 100644 --- a/src/mongo/db/exec/projection_exec.cpp +++ b/src/mongo/db/exec/projection_exec.cpp @@ -35,7 +35,7 @@ #include "mongo/db/query/collation/collator_interface.h" #include "mongo/db/query/query_request.h" #include "mongo/db/update/path_support.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -95,7 +95,7 @@ ProjectionExec::ProjectionExec(OperationContext* opCtx, MatchExpressionParser::parse(elemMatchObj, std::move(expCtx)); invariant(statusWithMatcher.isOK()); // And store it in _matchers. - _matchers[mongoutils::str::before(e.fieldName(), '.').c_str()] = + _matchers[str::before(e.fieldName(), '.').c_str()] = statusWithMatcher.getValue().release(); add(e.fieldName(), true); @@ -138,7 +138,7 @@ ProjectionExec::ProjectionExec(OperationContext* opCtx, } } - if (mongoutils::str::contains(e.fieldName(), ".$")) { + if (str::contains(e.fieldName(), ".$")) { _arrayOpType = ARRAY_OP_POSITIONAL; } } @@ -483,7 +483,7 @@ Status ProjectionExec::append(BSONObjBuilder* bob, if (details && arrayOpType == ARRAY_OP_POSITIONAL) { // $ positional operator specified if (!details->hasElemMatchKey()) { - mongoutils::str::stream error; + str::stream error; error << "positional operator (" << elt.fieldName() << ".$) requires corresponding field" << " in query specifier"; diff --git a/src/mongo/db/exec/skip.cpp b/src/mongo/db/exec/skip.cpp index e5c6654e065..9675c1425c7 100644 --- a/src/mongo/db/exec/skip.cpp +++ b/src/mongo/db/exec/skip.cpp @@ -31,7 +31,7 @@ #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp index 622338d431a..9ddb29723b3 100644 --- a/src/mongo/db/exec/sort.cpp +++ b/src/mongo/db/exec/sort.cpp @@ -103,7 +103,7 @@ bool SortStage::isEOF() { PlanStage::StageState SortStage::doWork(WorkingSetID* out) { const size_t maxBytes = static_cast<size_t>(internalQueryExecMaxBlockingSortBytes.load()); if (_memUsage > maxBytes) { - mongoutils::str::stream ss; + str::stream ss; ss << "Sort operation used more than the maximum " << maxBytes << " bytes of RAM. Add an index, or specify a smaller limit."; Status status(ErrorCodes::OperationFailed, ss); diff --git a/src/mongo/db/exec/sort_test.cpp b/src/mongo/db/exec/sort_test.cpp index 1ddb5c21007..e3a2ad503dc 100644 --- a/src/mongo/db/exec/sort_test.cpp +++ b/src/mongo/db/exec/sort_test.cpp @@ -141,7 +141,7 @@ public: // Finally, we get to compare the sorted results against what we expect. BSONObj expectedObj = fromjson(expectedStr); if (SimpleBSONObjComparator::kInstance.evaluate(outputObj != expectedObj)) { - mongoutils::str::stream ss; + str::stream ss; // Even though we have the original string representation of the expected output, // we invoke BSONObj::toString() to get a format consistent with outputObj. ss << "Unexpected sort result with pattern=" << patternStr << "; limit=" << limit diff --git a/src/mongo/db/exec/subplan.cpp b/src/mongo/db/exec/subplan.cpp index 1a5cda14b3e..dade23b7b5e 100644 --- a/src/mongo/db/exec/subplan.cpp +++ b/src/mongo/db/exec/subplan.cpp @@ -125,7 +125,7 @@ Status SubplanStage::planSubqueries() { // Turn the i-th child into its own query. auto statusWithCQ = CanonicalQuery::canonicalize(getOpCtx(), *_query, orChild); if (!statusWithCQ.isOK()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Can't canonicalize subchild " << orChild->debugString() << " " << statusWithCQ.getStatus().reason(); return Status(ErrorCodes::BadValue, ss); @@ -158,7 +158,7 @@ Status SubplanStage::planSubqueries() { invariant(branchResult->solutions.empty()); auto solutions = QueryPlanner::plan(*branchResult->canonicalQuery, _plannerParams); if (!solutions.isOK()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Can't plan for subchild " << branchResult->canonicalQuery->toString() << " " << solutions.getStatus().reason(); return Status(ErrorCodes::BadValue, ss); @@ -169,7 +169,7 @@ Status SubplanStage::planSubqueries() { if (0 == branchResult->solutions.size()) { // If one child doesn't have an indexed solution, bail out. - mongoutils::str::stream ss; + str::stream ss; ss << "No solutions for subchild " << branchResult->canonicalQuery->toString(); return Status(ErrorCodes::BadValue, ss); } @@ -194,13 +194,13 @@ Status tagOrChildAccordingToCache(PlanCacheIndexTree* compositeCacheData, // We want a well-formed *indexed* solution. if (NULL == branchCacheData) { // For example, we don't cache things for 2d indices. - mongoutils::str::stream ss; + str::stream ss; ss << "No cache data for subchild " << orChild->debugString(); return Status(ErrorCodes::BadValue, ss); } if (SolutionCacheData::USE_INDEX_TAGS_SOLN != branchCacheData->solnType) { - mongoutils::str::stream ss; + str::stream ss; ss << "No indexed cache data for subchild " << orChild->debugString(); return Status(ErrorCodes::BadValue, ss); } @@ -210,7 +210,7 @@ Status tagOrChildAccordingToCache(PlanCacheIndexTree* compositeCacheData, QueryPlanner::tagAccordingToCache(orChild, branchCacheData->tree.get(), indexMap); if (!tagStatus.isOK()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Failed to extract indices from subchild " << orChild->debugString(); return Status(ErrorCodes::BadValue, ss); } @@ -290,7 +290,7 @@ Status SubplanStage::choosePlanForSubqueries(PlanYieldPolicy* yieldPolicy) { } if (!multiPlanStage->bestPlanChosen()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Failed to pick best plan for subchild " << branchResult->canonicalQuery->toString(); return Status(ErrorCodes::BadValue, ss); @@ -301,13 +301,13 @@ Status SubplanStage::choosePlanForSubqueries(PlanYieldPolicy* yieldPolicy) { // Check that we have good cache data. For example, we don't cache things // for 2d indices. if (NULL == bestSoln->cacheData.get()) { - mongoutils::str::stream ss; + str::stream ss; ss << "No cache data for subchild " << orChild->debugString(); return Status(ErrorCodes::BadValue, ss); } if (SolutionCacheData::USE_INDEX_TAGS_SOLN != bestSoln->cacheData->solnType) { - mongoutils::str::stream ss; + str::stream ss; ss << "No indexed cache data for subchild " << orChild->debugString(); return Status(ErrorCodes::BadValue, ss); } @@ -317,7 +317,7 @@ Status SubplanStage::choosePlanForSubqueries(PlanYieldPolicy* yieldPolicy) { orChild, bestSoln->cacheData->tree.get(), _indexMap); if (!tagStatus.isOK()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Failed to extract indices from subchild " << orChild->debugString(); return Status(ErrorCodes::BadValue, ss); } @@ -334,7 +334,7 @@ Status SubplanStage::choosePlanForSubqueries(PlanYieldPolicy* yieldPolicy) { *_query, std::move(_orExpression), _plannerParams.indices, _plannerParams)); if (!solnRoot) { - mongoutils::str::stream ss; + str::stream ss; ss << "Failed to build indexed data path for subplanned query\n"; return Status(ErrorCodes::BadValue, ss); } @@ -346,7 +346,7 @@ Status SubplanStage::choosePlanForSubqueries(PlanYieldPolicy* yieldPolicy) { QueryPlannerAnalysis::analyzeDataAccess(*_query, _plannerParams, std::move(solnRoot)); if (NULL == _compositeSolution.get()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Failed to analyze subplanned query"; return Status(ErrorCodes::BadValue, ss); } diff --git a/src/mongo/db/exec/text_match.cpp b/src/mongo/db/exec/text_match.cpp index cd09e3fc52b..301700389e4 100644 --- a/src/mongo/db/exec/text_match.cpp +++ b/src/mongo/db/exec/text_match.cpp @@ -36,7 +36,7 @@ #include "mongo/db/exec/working_set_common.h" #include "mongo/db/jsobj.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/exec/text_or.cpp b/src/mongo/db/exec/text_or.cpp index 31cc1c97bca..52fc60a53a1 100644 --- a/src/mongo/db/exec/text_or.cpp +++ b/src/mongo/db/exec/text_or.cpp @@ -204,7 +204,7 @@ PlanStage::StageState TextOrStage::readFromChildren(WorkingSetID* out) { // failed, in which case 'id' is valid. If ID is invalid, we // create our own error message. if (WorkingSet::INVALID_ID == id) { - mongoutils::str::stream ss; + str::stream ss; ss << "TEXT_OR stage failed to read in results from child"; Status status(ErrorCodes::InternalError, ss); *out = WorkingSetCommon::allocateStatusMember(_ws, status); diff --git a/src/mongo/db/field_parser-inl.h b/src/mongo/db/field_parser-inl.h index 213cb239736..3ad18fad184 100644 --- a/src/mongo/db/field_parser-inl.h +++ b/src/mongo/db/field_parser-inl.h @@ -28,7 +28,7 @@ */ #include "mongo/db/field_parser.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/field_ref_set.cpp b/src/mongo/db/field_ref_set.cpp index ab1ded753ed..cbfcee236d3 100644 --- a/src/mongo/db/field_ref_set.cpp +++ b/src/mongo/db/field_ref_set.cpp @@ -32,7 +32,7 @@ #include "mongo/db/field_ref_set.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/field_ref_test.cpp b/src/mongo/db/field_ref_test.cpp index ac59f0af975..f01020cbe0a 100644 --- a/src/mongo/db/field_ref_test.cpp +++ b/src/mongo/db/field_ref_test.cpp @@ -34,15 +34,11 @@ #include "mongo/base/string_data.h" #include "mongo/db/field_ref.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" +namespace mongo { namespace { -using mongo::FieldRef; -using mongo::StringData; -using mongoutils::str::stream; -using std::string; - TEST(Empty, NoFields) { FieldRef fieldRef(""); ASSERT_EQUALS(fieldRef.numParts(), 0U); @@ -50,7 +46,7 @@ TEST(Empty, NoFields) { } TEST(Empty, NoFieldNames) { - string field = "."; + std::string field = "."; FieldRef fieldRef(field); ASSERT_EQUALS(fieldRef.numParts(), 2U); ASSERT_EQUALS(fieldRef.getPart(0), ""); @@ -59,7 +55,7 @@ TEST(Empty, NoFieldNames) { } TEST(Empty, NoFieldNames2) { - string field = ".."; + std::string field = ".."; FieldRef fieldRef(field); ASSERT_EQUALS(fieldRef.numParts(), 3U); ASSERT_EQUALS(fieldRef.getPart(0), ""); @@ -69,7 +65,7 @@ TEST(Empty, NoFieldNames2) { } TEST(Empty, EmptyFieldName) { - string field = ".b."; + std::string field = ".b."; FieldRef fieldRef(field); ASSERT_EQUALS(fieldRef.numParts(), 3U); ASSERT_EQUALS(fieldRef.getPart(0), ""); @@ -88,7 +84,7 @@ TEST(Empty, ReinitializeWithEmptyString) { } TEST(Normal, SinglePart) { - string field = "a"; + std::string field = "a"; FieldRef fieldRef(field); ASSERT_EQUALS(fieldRef.numParts(), 1U); ASSERT_EQUALS(fieldRef.getPart(0), field); @@ -96,7 +92,7 @@ TEST(Normal, SinglePart) { } TEST(Normal, ParseTwice) { - string field = "a"; + std::string field = "a"; FieldRef fieldRef; for (int i = 0; i < 2; i++) { fieldRef.parse(field); @@ -109,7 +105,7 @@ TEST(Normal, ParseTwice) { TEST(Normal, MulitplePartsVariable) { const char* parts[] = {"a", "b", "c", "d", "e"}; size_t size = sizeof(parts) / sizeof(char*); - string field(parts[0]); + std::string field(parts[0]); for (size_t i = 1; i < size; i++) { field.append(1, '.'); field.append(parts[i]); @@ -124,12 +120,12 @@ TEST(Normal, MulitplePartsVariable) { } TEST(Replacement, SingleField) { - string field = "$"; + std::string field = "$"; FieldRef fieldRef(field); ASSERT_EQUALS(fieldRef.numParts(), 1U); ASSERT_EQUALS(fieldRef.getPart(0), "$"); - string newField = "a"; + std::string newField = "a"; fieldRef.setPart(0, newField); ASSERT_EQUALS(fieldRef.numParts(), 1U); ASSERT_EQUALS(fieldRef.getPart(0), newField); @@ -137,12 +133,12 @@ TEST(Replacement, SingleField) { } TEST(Replacement, InMultipleField) { - string field = "a.b.c.$.e"; + std::string field = "a.b.c.$.e"; FieldRef fieldRef(field); ASSERT_EQUALS(fieldRef.numParts(), 5U); ASSERT_EQUALS(fieldRef.getPart(3), "$"); - string newField = "d"; + std::string newField = "d"; fieldRef.setPart(3, newField); ASSERT_EQUALS(fieldRef.numParts(), 5U); ASSERT_EQUALS(fieldRef.getPart(3), newField); @@ -150,8 +146,8 @@ TEST(Replacement, InMultipleField) { } TEST(Replacement, SameFieldMultipleReplacements) { - string prefix = "a."; - string field = prefix + "$"; + std::string prefix = "a."; + std::string field = prefix + "$"; FieldRef fieldRef(field); ASSERT_EQUALS(fieldRef.numParts(), 2U); @@ -877,3 +873,4 @@ TEST(NumericPathComponents, FieldsWithLeadingZeroesAreNotConsideredNumeric) { } } // namespace +} // namespace mongo diff --git a/src/mongo/db/ftdc/block_compressor.cpp b/src/mongo/db/ftdc/block_compressor.cpp index ed7b80d5e4b..969cc5d1c77 100644 --- a/src/mongo/db/ftdc/block_compressor.cpp +++ b/src/mongo/db/ftdc/block_compressor.cpp @@ -33,7 +33,7 @@ #include <zlib.h> -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/ftdc/file_manager.cpp b/src/mongo/db/ftdc/file_manager.cpp index 6f25456c652..1ffde2afb04 100644 --- a/src/mongo/db/ftdc/file_manager.cpp +++ b/src/mongo/db/ftdc/file_manager.cpp @@ -45,7 +45,7 @@ #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/ftdc/file_reader.cpp b/src/mongo/db/ftdc/file_reader.cpp index a5851680a49..36d36d351a9 100644 --- a/src/mongo/db/ftdc/file_reader.cpp +++ b/src/mongo/db/ftdc/file_reader.cpp @@ -41,7 +41,7 @@ #include "mongo/db/ftdc/util.h" #include "mongo/db/jsobj.h" #include "mongo/rpc/object_check.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/ftdc/util.cpp b/src/mongo/db/ftdc/util.cpp index 0ad739d7bc4..f745068fdea 100644 --- a/src/mongo/db/ftdc/util.cpp +++ b/src/mongo/db/ftdc/util.cpp @@ -44,7 +44,7 @@ #include "mongo/db/service_context.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/fts/fts_basic_tokenizer.cpp b/src/mongo/db/fts/fts_basic_tokenizer.cpp index 72f7d3189af..0a46b562955 100644 --- a/src/mongo/db/fts/fts_basic_tokenizer.cpp +++ b/src/mongo/db/fts/fts_basic_tokenizer.cpp @@ -37,7 +37,7 @@ #include "mongo/db/fts/stop_words.h" #include "mongo/db/fts/tokenizer.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { diff --git a/src/mongo/db/fts/fts_element_iterator.cpp b/src/mongo/db/fts/fts_element_iterator.cpp index bbe09fb2ace..7589904c56e 100644 --- a/src/mongo/db/fts/fts_element_iterator.cpp +++ b/src/mongo/db/fts/fts_element_iterator.cpp @@ -30,7 +30,7 @@ #include "mongo/db/fts/fts_element_iterator.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/fts/fts_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" #include <stack> @@ -63,7 +63,7 @@ inline bool _matchPrefix(const string& dottedName, const string& weight) { if (weight == dottedName) { return true; } - return mongoutils::str::startsWith(weight, dottedName + '.'); + return str::startsWith(weight, dottedName + '.'); } } diff --git a/src/mongo/db/fts/fts_index_format.cpp b/src/mongo/db/fts/fts_index_format.cpp index 4c7902146d8..2bcf35ff398 100644 --- a/src/mongo/db/fts/fts_index_format.cpp +++ b/src/mongo/db/fts/fts_index_format.cpp @@ -38,7 +38,7 @@ #include "mongo/db/server_options.h" #include "mongo/util/hex.h" #include "mongo/util/md5.hpp" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -165,10 +165,10 @@ void FTSIndexFormat::getKeys(const FTSSpec& spec, const BSONObj& obj, BSONObjSet serverGlobalParams.featureCompatibility.getVersion() == ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo40) { uassert(16732, - mongoutils::str::stream() << "too many unique keys for a single document to" - << " have a text index, max is " - << term_freqs.size() - << obj["_id"], + str::stream() << "too many unique keys for a single document to" + << " have a text index, max is " + << term_freqs.size() + << obj["_id"], term_freqs.size() <= 400000); } @@ -204,11 +204,10 @@ void FTSIndexFormat::getKeys(const FTSSpec& spec, const BSONObj& obj, BSONObjSet serverGlobalParams.featureCompatibility.getVersion() == ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo40) { uassert(16733, - mongoutils::str::stream() - << "trying to index text where term list is too big, max is " - << MaxKeyBSONSizeMB - << "mb " - << obj["_id"], + str::stream() << "trying to index text where term list is too big, max is " + << MaxKeyBSONSizeMB + << "mb " + << obj["_id"], keyBSONSize <= (MaxKeyBSONSizeMB * 1024 * 1024)); } } diff --git a/src/mongo/db/fts/fts_index_format_test.cpp b/src/mongo/db/fts/fts_index_format_test.cpp index 990d1e4122f..b847d16dd9d 100644 --- a/src/mongo/db/fts/fts_index_format_test.cpp +++ b/src/mongo/db/fts/fts_index_format_test.cpp @@ -39,7 +39,7 @@ #include "mongo/db/fts/fts_spec.h" #include "mongo/unittest/unittest.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -139,7 +139,7 @@ void assertEqualsIndexKeys(std::set<std::string>& expectedKeys, const BSONObjSet string s = key.firstElement().String(); std::set<string>::const_iterator j = expectedKeys.find(s); if (j == expectedKeys.end()) { - mongoutils::str::stream ss; + str::stream ss; ss << "unexpected key " << s << " in FTSIndexFormat::getKeys result. " << "expected keys:"; for (std::set<string>::const_iterator k = expectedKeys.begin(); k != expectedKeys.end(); @@ -166,7 +166,7 @@ TEST(FTSIndexFormat, LongWordsTextIndexVersion1) { string longWordCat = longPrefix + "cat"; // "aaa...aaasat" string longWordSat = longPrefix + "sat"; - string text = mongoutils::str::stream() << longWordCat << " " << longWordSat; + string text = str::stream() << longWordCat << " " << longWordSat; FTSIndexFormat::getKeys(spec, BSON("data" << text), &keys); // Hard-coded expected computed keys for future-proofing. @@ -198,8 +198,7 @@ TEST(FTSIndexFormat, LongWordTextIndexVersion2) { string longWordSat = longPrefix + "sat"; // "aaa...aaamongodbfts" string longWordMongoDBFts = longPrefix + "mongodbfts"; - string text = mongoutils::str::stream() << longWordCat << " " << longWordSat << " " - << longWordMongoDBFts; + string text = str::stream() << longWordCat << " " << longWordSat << " " << longWordMongoDBFts; FTSIndexFormat::getKeys(spec, BSON("data" << text), &keys); // Hard-coded expected computed keys for future-proofing. @@ -231,7 +230,7 @@ TEST(FTSIndexFormat, LongWordTextIndexVersion3) { string longWordCat = longPrefix + "cat"; // "aaa...aaasat" string longWordSat = longPrefix + "sat"; - string text = mongoutils::str::stream() << longWordCat << " " << longWordSat; + string text = str::stream() << longWordCat << " " << longWordSat; FTSIndexFormat::getKeys(spec, BSON("data" << text), &keys); // Hard-coded expected computed keys for future-proofing. diff --git a/src/mongo/db/fts/fts_language.cpp b/src/mongo/db/fts/fts_language.cpp index c668bf849d0..518c8a8e9f4 100644 --- a/src/mongo/db/fts/fts_language.cpp +++ b/src/mongo/db/fts/fts_language.cpp @@ -38,7 +38,7 @@ #include "mongo/db/fts/fts_unicode_tokenizer.h" #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/string_map.h" #include "mongo/util/stringutils.h" @@ -278,9 +278,8 @@ StatusWithFTSLanguage FTSLanguage::make(StringData langName, TextIndexVersion te if (it == languageMap->end()) { // TEXT_INDEX_VERSION_2 and above reject unrecognized language strings. - Status status = - Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "unsupported language: \"" << langName + Status status = Status(ErrorCodes::BadValue, + str::stream() << "unsupported language: \"" << langName << "\" for text index version " << textIndexVersion); return StatusWithFTSLanguage(status); diff --git a/src/mongo/db/fts/fts_query_impl.cpp b/src/mongo/db/fts/fts_query_impl.cpp index e9eff03a5ea..4fc03b24746 100644 --- a/src/mongo/db/fts/fts_query_impl.cpp +++ b/src/mongo/db/fts/fts_query_impl.cpp @@ -35,15 +35,13 @@ #include "mongo/db/fts/fts_spec.h" #include "mongo/db/fts/fts_tokenizer.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { namespace fts { -using namespace mongoutils; - using std::set; using std::string; using std::stringstream; diff --git a/src/mongo/db/fts/fts_query_parser.cpp b/src/mongo/db/fts/fts_query_parser.cpp index bb2d05dbb32..4d86580374b 100644 --- a/src/mongo/db/fts/fts_query_parser.cpp +++ b/src/mongo/db/fts/fts_query_parser.cpp @@ -30,7 +30,7 @@ #include <string> #include "mongo/db/fts/fts_query_parser.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp index 14bb7b8bfdc..ec320a562f6 100644 --- a/src/mongo/db/fts/fts_spec.cpp +++ b/src/mongo/db/fts/fts_spec.cpp @@ -37,7 +37,7 @@ #include "mongo/db/fts/fts_tokenizer.h" #include "mongo/db/fts/fts_util.h" #include "mongo/db/matcher/expression_parser.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { @@ -46,7 +46,6 @@ namespace fts { using std::map; using std::string; -using namespace mongoutils; namespace dps = ::mongo::dotted_path_support; const double DEFAULT_WEIGHT = 1; diff --git a/src/mongo/db/fts/fts_spec_legacy.cpp b/src/mongo/db/fts/fts_spec_legacy.cpp index dcb7357166b..b5e61b2f535 100644 --- a/src/mongo/db/fts/fts_spec_legacy.cpp +++ b/src/mongo/db/fts/fts_spec_legacy.cpp @@ -30,7 +30,7 @@ #include "mongo/db/fts/fts_spec.h" #include "mongo/db/bson/dotted_path_support.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { @@ -44,7 +44,6 @@ namespace fts { using std::map; using std::string; -using namespace mongoutils; namespace dps = ::mongo::dotted_path_support; diff --git a/src/mongo/db/fts/fts_unicode_tokenizer.cpp b/src/mongo/db/fts/fts_unicode_tokenizer.cpp index 404cea9a8b6..f4db4881cb5 100644 --- a/src/mongo/db/fts/fts_unicode_tokenizer.cpp +++ b/src/mongo/db/fts/fts_unicode_tokenizer.cpp @@ -37,7 +37,7 @@ #include "mongo/db/fts/stop_words.h" #include "mongo/db/fts/tokenizer.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { diff --git a/src/mongo/db/fts/stemmer.cpp b/src/mongo/db/fts/stemmer.cpp index e7b0e899fe1..db5e97227da 100644 --- a/src/mongo/db/fts/stemmer.cpp +++ b/src/mongo/db/fts/stemmer.cpp @@ -30,7 +30,7 @@ #include <cstdlib> #include "mongo/db/fts/stemmer.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/fts/tokenizer.cpp b/src/mongo/db/fts/tokenizer.cpp index 56ee663ca55..2847f7486a8 100644 --- a/src/mongo/db/fts/tokenizer.cpp +++ b/src/mongo/db/fts/tokenizer.cpp @@ -30,7 +30,7 @@ #include <string> #include "mongo/db/fts/tokenizer.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { diff --git a/src/mongo/db/geo/geometry_container.cpp b/src/mongo/db/geo/geometry_container.cpp index bea64bf8f0f..5b4ade3d062 100644 --- a/src/mongo/db/geo/geometry_container.cpp +++ b/src/mongo/db/geo/geometry_container.cpp @@ -31,7 +31,7 @@ #include "mongo/db/geo/geoconstants.h" #include "mongo/db/geo/geoparser.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/transitional_tools_do_not_use/vector_spooling.h" namespace mongo { diff --git a/src/mongo/db/geo/geoparser.cpp b/src/mongo/db/geo/geoparser.cpp index c5a723805b2..db9e68a0c25 100644 --- a/src/mongo/db/geo/geoparser.cpp +++ b/src/mongo/db/geo/geoparser.cpp @@ -41,17 +41,14 @@ #include "mongo/db/jsobj.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/transitional_tools_do_not_use/vector_spooling.h" #include "third_party/s2/s2polygonbuilder.h" -#define BAD_VALUE(error) Status(ErrorCodes::BadValue, ::mongoutils::str::stream() << error) +#define BAD_VALUE(error) Status(ErrorCodes::BadValue, str::stream() << error) namespace mongo { -using std::unique_ptr; -using std::stringstream; - namespace dps = ::mongo::dotted_path_support; // This field must be present, and... @@ -116,7 +113,7 @@ static Status coordToPoint(double lng, double lat, S2Point* out) { S2LatLng ll = S2LatLng::FromDegrees(lat, lng).Normalized(); // This shouldn't happen since we should only have valid lng/lats. if (!ll.is_valid()) { - stringstream ss; + std::stringstream ss; ss << "coords invalid after normalization, lng = " << lng << " lat = " << lat << endl; uasserted(17125, ss.str()); } @@ -325,7 +322,7 @@ static Status parseBigSimplePolygonCoordinates(const BSONElement& elem, BigSimpl return BAD_VALUE("Loop must have at least 3 different vertices: " << elem.toString(false)); } - unique_ptr<S2Loop> loop(new S2Loop(exteriorVertices)); + std::unique_ptr<S2Loop> loop(new S2Loop(exteriorVertices)); // Check whether this loop is valid. if (!loop->IsValid(&err)) { return BAD_VALUE("Loop is not valid: " << elem.toString(false) << " " << err); diff --git a/src/mongo/db/geo/hash.cpp b/src/mongo/db/geo/hash.cpp index eb1b3d24631..f74a403f77b 100644 --- a/src/mongo/db/geo/hash.cpp +++ b/src/mongo/db/geo/hash.cpp @@ -32,14 +32,11 @@ #include "mongo/db/field_parser.h" #include "mongo/db/geo/shapes.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include <algorithm> // for max() #include <iostream> -// So we can get at the str namespace. -using namespace mongoutils; - namespace mongo { using std::stringstream; diff --git a/src/mongo/db/geo/hash_test.cpp b/src/mongo/db/geo/hash_test.cpp index 4081cc97aea..1681803083f 100644 --- a/src/mongo/db/geo/hash_test.cpp +++ b/src/mongo/db/geo/hash_test.cpp @@ -43,7 +43,7 @@ #include "mongo/platform/random.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/geo/shapes.cpp b/src/mongo/db/geo/shapes.cpp index 9dfd3170116..d0a062c5e2c 100644 --- a/src/mongo/db/geo/shapes.cpp +++ b/src/mongo/db/geo/shapes.cpp @@ -29,13 +29,10 @@ #include "mongo/db/geo/shapes.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" using std::abs; -// So we can get at the str namespace. -using namespace mongoutils; - namespace mongo { ////////////// Point diff --git a/src/mongo/db/index/btree_key_generator.cpp b/src/mongo/db/index/btree_key_generator.cpp index eddeca2a6d1..d479c458915 100644 --- a/src/mongo/db/index/btree_key_generator.cpp +++ b/src/mongo/db/index/btree_key_generator.cpp @@ -38,7 +38,7 @@ #include "mongo/db/query/collation/collator_interface.h" #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -88,20 +88,20 @@ BSONElement BtreeKeyGenerator::_extractNextElement(const BSONObj& obj, const PositionalPathInfo& positionalInfo, const char** field, bool* arrayNestedArray) const { - std::string firstField = mongoutils::str::before(*field, '.'); + std::string firstField = str::before(*field, '.'); bool haveObjField = !obj.getField(firstField).eoo(); BSONElement arrField = positionalInfo.positionallyIndexedElt; // An index component field name cannot exist in both a document // array and one of that array's children. - uassert(16746, - mongoutils::str::stream() - << "Ambiguous field name found in array (do not use numeric field names in " - "embedded elements in an array), field: '" - << arrField.fieldName() - << "' for array: " - << positionalInfo.arrayObj, - !haveObjField || !positionalInfo.hasPositionallyIndexedElt()); + uassert( + 16746, + str::stream() << "Ambiguous field name found in array (do not use numeric field names in " + "embedded elements in an array), field: '" + << arrField.fieldName() + << "' for array: " + << positionalInfo.arrayObj, + !haveObjField || !positionalInfo.hasPositionallyIndexedElt()); *arrayNestedArray = false; if (haveObjField) { diff --git a/src/mongo/db/index/expression_keys_private.cpp b/src/mongo/db/index/expression_keys_private.cpp index 33bad468181..11ed573f27f 100644 --- a/src/mongo/db/index/expression_keys_private.cpp +++ b/src/mongo/db/index/expression_keys_private.cpp @@ -48,7 +48,7 @@ #include "mongo/db/query/collation/collation_index_key.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "third_party/s2/s2cell.h" #include "third_party/s2/s2regioncoverer.h" @@ -279,7 +279,7 @@ void ExpressionKeysPrivate::get2DKeys(const BSONObj& obj, BSONElement locElement = oi.next(); uassert(16804, - mongoutils::str::stream() + str::stream() << "location object expected, location array not in correct format", locElement.isABSONObj()); @@ -437,7 +437,7 @@ int ExpressionKeysPrivate::hashHaystackElement(const BSONElement& e, double buck // static std::string ExpressionKeysPrivate::makeHaystackString(int hashedX, int hashedY) { - mongoutils::str::stream ss; + str::stream ss; ss << hashedX << "_" << hashedY; return ss; } diff --git a/src/mongo/db/index/expression_params.cpp b/src/mongo/db/index/expression_params.cpp index b53dd786a24..e47ef01a5e6 100644 --- a/src/mongo/db/index/expression_params.cpp +++ b/src/mongo/db/index/expression_params.cpp @@ -35,12 +35,12 @@ #include "mongo/db/index/2d_common.h" #include "mongo/db/index/s2_common.h" #include "mongo/db/index_names.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "third_party/s2/s2.h" namespace mongo { -using mongoutils::str::stream; +using str::stream; void ExpressionParams::parseTwoDParams(const BSONObj& infoObj, TwoDIndexingParams* out) { BSONObjIterator i(infoObj.getObjectField("key")); diff --git a/src/mongo/db/index/index_access_method.cpp b/src/mongo/db/index/index_access_method.cpp index d06e244a2a0..f017dd20f88 100644 --- a/src/mongo/db/index/index_access_method.cpp +++ b/src/mongo/db/index/index_access_method.cpp @@ -91,8 +91,8 @@ const int TempKeyMaxSize = 1024; // TODO SERVER-36385: Completely remove the key size check in 4.4 Status checkKeySize(const BSONObj& key) { if (key.objsize() >= TempKeyMaxSize) { - std::string msg = mongoutils::str::stream() << "Index key too large to index, failing " - << key.objsize() << ' ' << redact(key); + std::string msg = str::stream() << "Index key too large to index, failing " << key.objsize() + << ' ' << redact(key); return Status(ErrorCodes::KeyTooLong, msg); } return Status::OK(); diff --git a/src/mongo/db/index/s2_key_generator_test.cpp b/src/mongo/db/index/s2_key_generator_test.cpp index e607cdb9876..b57a2b58c43 100644 --- a/src/mongo/db/index/s2_key_generator_test.cpp +++ b/src/mongo/db/index/s2_key_generator_test.cpp @@ -43,7 +43,7 @@ #include "mongo/db/query/collation/collator_interface_mock.h" #include "mongo/unittest/unittest.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" using namespace mongo; diff --git a/src/mongo/db/index_build_entry_helpers.cpp b/src/mongo/db/index_build_entry_helpers.cpp index 453233ef9d4..df3ef2ebfb2 100644 --- a/src/mongo/db/index_build_entry_helpers.cpp +++ b/src/mongo/db/index_build_entry_helpers.cpp @@ -54,7 +54,7 @@ #include "mongo/db/record_id.h" #include "mongo/db/storage/write_unit_of_work.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/uuid.h" namespace mongo { @@ -70,7 +70,7 @@ Status upsert(OperationContext* opCtx, IndexBuildEntry indexBuildEntry) { opCtx, NamespaceString::kIndexBuildEntryNamespace, MODE_IX); Collection* collection = autoCollection.getCollection(); if (!collection) { - mongoutils::str::stream ss; + str::stream ss; ss << "Collection not found: " << NamespaceString::kIndexBuildEntryNamespace.ns(); return Status(ErrorCodes::NamespaceNotFound, ss); @@ -126,7 +126,7 @@ Status addIndexBuildEntry(OperationContext* opCtx, IndexBuildEntry indexBuildEnt opCtx, NamespaceString::kIndexBuildEntryNamespace, MODE_IX); Collection* collection = autoCollection.getCollection(); if (!collection) { - mongoutils::str::stream ss; + str::stream ss; ss << "Collection not found: " << NamespaceString::kIndexBuildEntryNamespace.ns(); return Status(ErrorCodes::NamespaceNotFound, ss); @@ -153,7 +153,7 @@ Status removeIndexBuildEntry(OperationContext* opCtx, UUID indexBuildUUID) { opCtx, NamespaceString::kIndexBuildEntryNamespace, MODE_IX); Collection* collection = autoCollection.getCollection(); if (!collection) { - mongoutils::str::stream ss; + str::stream ss; ss << "Collection not found: " << NamespaceString::kIndexBuildEntryNamespace.ns(); return Status(ErrorCodes::NamespaceNotFound, ss); } @@ -161,7 +161,7 @@ Status removeIndexBuildEntry(OperationContext* opCtx, UUID indexBuildUUID) { RecordId rid = Helpers::findOne( opCtx, collection, BSON("_id" << indexBuildUUID), /*requireIndex=*/true); if (rid.isNull()) { - mongoutils::str::stream ss; + str::stream ss; ss << "No matching IndexBuildEntry found with indexBuildUUID: " << indexBuildUUID; return Status(ErrorCodes::NoMatchingDocument, ss); } @@ -178,7 +178,7 @@ StatusWith<IndexBuildEntry> getIndexBuildEntry(OperationContext* opCtx, UUID ind AutoGetCollectionForRead autoCollection(opCtx, NamespaceString::kIndexBuildEntryNamespace); Collection* collection = autoCollection.getCollection(); if (!collection) { - mongoutils::str::stream ss; + str::stream ss; ss << "Collection not found: " << NamespaceString::kIndexBuildEntryNamespace.ns(); return Status(ErrorCodes::NamespaceNotFound, ss); } @@ -187,7 +187,7 @@ StatusWith<IndexBuildEntry> getIndexBuildEntry(OperationContext* opCtx, UUID ind bool foundObj = Helpers::findOne( opCtx, collection, BSON("_id" << indexBuildUUID), obj, /*requireIndex=*/true); if (!foundObj) { - mongoutils::str::stream ss; + str::stream ss; ss << "No matching IndexBuildEntry found with indexBuildUUID: " << indexBuildUUID; return Status(ErrorCodes::NoMatchingDocument, ss); } @@ -197,7 +197,7 @@ StatusWith<IndexBuildEntry> getIndexBuildEntry(OperationContext* opCtx, UUID ind IndexBuildEntry indexBuildEntry = IndexBuildEntry::parse(ctx, obj); return indexBuildEntry; } catch (...) { - mongoutils::str::stream ss; + str::stream ss; ss << "Invalid BSON found for matching document with indexBuildUUID: " << indexBuildUUID; return Status(ErrorCodes::InvalidBSON, ss); } @@ -208,7 +208,7 @@ StatusWith<std::vector<IndexBuildEntry>> getIndexBuildEntries(OperationContext* AutoGetCollectionForRead autoCollection(opCtx, NamespaceString::kIndexBuildEntryNamespace); Collection* collection = autoCollection.getCollection(); if (!collection) { - mongoutils::str::stream ss; + str::stream ss; ss << "Collection not found: " << NamespaceString::kIndexBuildEntryNamespace.ns(); return Status(ErrorCodes::NamespaceNotFound, ss); } @@ -250,7 +250,7 @@ StatusWith<std::vector<IndexBuildEntry>> getIndexBuildEntries(OperationContext* IndexBuildEntry indexBuildEntry = IndexBuildEntry::parse(ctx, obj); indexBuildEntries.push_back(indexBuildEntry); } catch (...) { - mongoutils::str::stream ss; + str::stream ss; ss << "Invalid BSON found for RecordId " << loc << " in collection " << collection->ns(); return Status(ErrorCodes::InvalidBSON, ss); @@ -356,7 +356,7 @@ Status clearAllIndexBuildEntries(OperationContext* opCtx) { opCtx, NamespaceString::kIndexBuildEntryNamespace, MODE_X); Collection* collection = autoCollection.getCollection(); if (!collection) { - mongoutils::str::stream ss; + str::stream ss; ss << "Collection not found: " << NamespaceString::kIndexBuildEntryNamespace.ns(); return Status(ErrorCodes::NamespaceNotFound, ss); diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp index 2302620a18e..41d97c164b9 100644 --- a/src/mongo/db/index_builder.cpp +++ b/src/mongo/db/index_builder.cpp @@ -46,7 +46,7 @@ #include "mongo/db/server_options.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index c6d3b6b4ec4..cb9dc57d248 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -53,7 +53,7 @@ #include "mongo/s/shard_key_pattern.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -375,26 +375,24 @@ bool IndexBuildsCoordinator::inProgForDb(StringData db) const { void IndexBuildsCoordinator::assertNoIndexBuildInProgress() const { stdx::unique_lock<stdx::mutex> lk(_mutex); uassert(ErrorCodes::BackgroundOperationInProgressForDatabase, - mongoutils::str::stream() << "cannot perform operation: there are currently " - << _allIndexBuilds.size() - << " index builds running.", + str::stream() << "cannot perform operation: there are currently " + << _allIndexBuilds.size() + << " index builds running.", _allIndexBuilds.size() == 0); } void IndexBuildsCoordinator::assertNoIndexBuildInProgForCollection( const UUID& collectionUUID) const { uassert(ErrorCodes::BackgroundOperationInProgressForNamespace, - mongoutils::str::stream() - << "cannot perform operation: an index build is currently running", + str::stream() << "cannot perform operation: an index build is currently running", !inProgForCollection(collectionUUID)); } void IndexBuildsCoordinator::assertNoBgOpInProgForDb(StringData db) const { uassert(ErrorCodes::BackgroundOperationInProgressForDatabase, - mongoutils::str::stream() - << "cannot perform operation: an index build is currently running for " - "database " - << db, + str::stream() << "cannot perform operation: an index build is currently running for " + "database " + << db, !inProgForDb(db)); } diff --git a/src/mongo/db/index_builds_coordinator_mongod.cpp b/src/mongo/db/index_builds_coordinator_mongod.cpp index 3bd3ac802ec..f915318f813 100644 --- a/src/mongo/db/index_builds_coordinator_mongod.cpp +++ b/src/mongo/db/index_builds_coordinator_mongod.cpp @@ -41,7 +41,7 @@ #include "mongo/db/service_context.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp index 1cfcc8af7b3..0565045ba9f 100644 --- a/src/mongo/db/initialize_server_global_state.cpp +++ b/src/mongo/db/initialize_server_global_state.cpp @@ -59,10 +59,10 @@ #include "mongo/logger/syslog_appender.h" #include "mongo/platform/process_id.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/processinfo.h" #include "mongo/util/quick_exit.h" #include "mongo/util/signal_handlers_synchronous.h" +#include "mongo/util/str.h" #if defined(__APPLE__) #include <TargetConditionals.h> @@ -254,17 +254,15 @@ MONGO_INITIALIZER_GENERAL( exists = boost::filesystem::exists(absoluteLogpath); } catch (boost::filesystem::filesystem_error& e) { return Status(ErrorCodes::FileNotOpen, - mongoutils::str::stream() << "Failed probe for \"" << absoluteLogpath - << "\": " - << e.code().message()); + str::stream() << "Failed probe for \"" << absoluteLogpath << "\": " + << e.code().message()); } if (exists) { if (boost::filesystem::is_directory(absoluteLogpath)) { - return Status( - ErrorCodes::FileNotOpen, - mongoutils::str::stream() << "logpath \"" << absoluteLogpath - << "\" should name a file, not a directory."); + return Status(ErrorCodes::FileNotOpen, + str::stream() << "logpath \"" << absoluteLogpath + << "\" should name a file, not a directory."); } if (!serverGlobalParams.logAppend && boost::filesystem::is_regular(absoluteLogpath)) { @@ -276,7 +274,7 @@ MONGO_INITIALIZER_GENERAL( << renameTarget << "\"."; } else { return Status(ErrorCodes::FileRenameFailed, - mongoutils::str::stream() + str::stream() << "Could not rename preexisting log file \"" << absoluteLogpath << "\" to \"" diff --git a/src/mongo/db/keypattern.h b/src/mongo/db/keypattern.h index 25aa05968eb..d87bc8632c5 100644 --- a/src/mongo/db/keypattern.h +++ b/src/mongo/db/keypattern.h @@ -32,7 +32,7 @@ #include "mongo/base/string_data.h" #include "mongo/bson/util/builder.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/keys_collection_cache.cpp b/src/mongo/db/keys_collection_cache.cpp index c5dc43a58f4..ea63be756fc 100644 --- a/src/mongo/db/keys_collection_cache.cpp +++ b/src/mongo/db/keys_collection_cache.cpp @@ -33,7 +33,7 @@ #include "mongo/db/keys_collection_client.h" #include "mongo/db/keys_collection_document.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/keys_collection_manager.cpp b/src/mongo/db/keys_collection_manager.cpp index bc539af60a1..df82ebe71a0 100644 --- a/src/mongo/db/keys_collection_manager.cpp +++ b/src/mongo/db/keys_collection_manager.cpp @@ -43,7 +43,7 @@ #include "mongo/util/concurrency/idle_thread_block.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/matcher/expression_geo.cpp b/src/mongo/db/matcher/expression_geo.cpp index 34596d34c45..99081c3e910 100644 --- a/src/mongo/db/matcher/expression_geo.cpp +++ b/src/mongo/db/matcher/expression_geo.cpp @@ -36,7 +36,7 @@ #include "mongo/db/matcher/expression_parser.h" #include "mongo/platform/basic.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -216,7 +216,7 @@ Status GeoNearExpression::parseNewQuery(const BSONObj& obj) { // Just one arg. to $geoNear. if (objIt.more()) { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() + str::stream() << "geo near accepts just one argument when querying for a GeoJSON " << "point. Extra field found: " << objIt.next()); @@ -231,8 +231,7 @@ Status GeoNearExpression::parseNewQuery(const BSONObj& obj) { if (PathAcceptingKeyword::GEO_NEAR != MatchExpressionParser::parsePathAcceptingKeyword(e)) { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "invalid geo near query operator: " - << e.fieldName()); + str::stream() << "invalid geo near query operator: " << e.fieldName()); } // Iterate over the argument. diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp index 7327f3c4a86..e379c1c24d0 100644 --- a/src/mongo/db/matcher/expression_leaf.cpp +++ b/src/mongo/db/matcher/expression_leaf.cpp @@ -44,8 +44,8 @@ #include "mongo/db/matcher/path.h" #include "mongo/db/query/collation/collator_interface.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/regex_util.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/matcher/expression_optimize_test.cpp b/src/mongo/db/matcher/expression_optimize_test.cpp index 956a5d96ef9..ba9345a84a1 100644 --- a/src/mongo/db/matcher/expression_optimize_test.cpp +++ b/src/mongo/db/matcher/expression_optimize_test.cpp @@ -55,7 +55,7 @@ MatchExpression* parseMatchExpression(const BSONObj& obj) { ExtensionsCallbackNoop(), MatchExpressionParser::kAllowAllSpecialFeatures); if (!status.isOK()) { - mongoutils::str::stream ss; + str::stream ss; ss << "failed to parse query: " << obj.toString() << ". Reason: " << status.getStatus().toString(); FAIL(ss); diff --git a/src/mongo/db/matcher/expression_parser.cpp b/src/mongo/db/matcher/expression_parser.cpp index df0351cc1b9..182ff15aa25 100644 --- a/src/mongo/db/matcher/expression_parser.cpp +++ b/src/mongo/db/matcher/expression_parser.cpp @@ -67,7 +67,7 @@ #include "mongo/db/namespace_string.h" #include "mongo/db/query/query_knobs_gen.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/string_map.h" namespace { diff --git a/src/mongo/db/matcher/matcher.cpp b/src/mongo/db/matcher/matcher.cpp index d51ed4b2061..4faf2fe44bf 100644 --- a/src/mongo/db/matcher/matcher.cpp +++ b/src/mongo/db/matcher/matcher.cpp @@ -35,8 +35,8 @@ #include "mongo/db/matcher/expression_parser.h" #include "mongo/db/matcher/matcher.h" #include "mongo/db/matcher/path.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/stacktrace.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index 3c5deb111be..93debb74db2 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -52,9 +52,9 @@ #include "mongo/db/server_options_nongeneral_gen.h" #include "mongo/db/server_options_server_helpers.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/ssl_options.h" #include "mongo/util/options_parser/startup_options.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" #include "mongo/util/version.h" diff --git a/src/mongo/db/multi_key_path_tracker_test.cpp b/src/mongo/db/multi_key_path_tracker_test.cpp index 3b992a819e9..7c19eb69dc9 100644 --- a/src/mongo/db/multi_key_path_tracker_test.cpp +++ b/src/mongo/db/multi_key_path_tracker_test.cpp @@ -37,7 +37,7 @@ #include "mongo/db/multi_key_path_tracker.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp index 3f24658f060..5fbb645c09c 100644 --- a/src/mongo/db/namespace_string.cpp +++ b/src/mongo/db/namespace_string.cpp @@ -34,7 +34,7 @@ #include <ostream> #include "mongo/base/parse_number.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/ops/insert.cpp b/src/mongo/db/ops/insert.cpp index cb056f6fc33..d891c998a7c 100644 --- a/src/mongo/db/ops/insert.cpp +++ b/src/mongo/db/ops/insert.cpp @@ -36,14 +36,12 @@ #include "mongo/db/logical_clock.h" #include "mongo/db/logical_time.h" #include "mongo/db/views/durable_view_catalog.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { using std::string; -using namespace mongoutils; - namespace { /** * Validates the nesting depth of 'obj', returning a non-OK status if it exceeds the limit. diff --git a/src/mongo/db/ops/parsed_delete.cpp b/src/mongo/db/ops/parsed_delete.cpp index 3221b340d5b..ad6ec0c25e0 100644 --- a/src/mongo/db/ops/parsed_delete.cpp +++ b/src/mongo/db/ops/parsed_delete.cpp @@ -43,7 +43,7 @@ #include "mongo/db/query/query_planner_common.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/ops/update_request.h b/src/mongo/db/ops/update_request.h index c47dbe113e6..00249500343 100644 --- a/src/mongo/db/ops/update_request.h +++ b/src/mongo/db/ops/update_request.h @@ -34,12 +34,10 @@ #include "mongo/db/logical_session_id.h" #include "mongo/db/namespace_string.h" #include "mongo/db/query/explain.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { -namespace str = mongoutils::str; - class FieldRef; class UpdateRequest { diff --git a/src/mongo/db/ops/update_result.cpp b/src/mongo/db/ops/update_result.cpp index d63d806f17f..8765dd1dde1 100644 --- a/src/mongo/db/ops/update_result.cpp +++ b/src/mongo/db/ops/update_result.cpp @@ -36,7 +36,7 @@ #include "mongo/db/lasterror.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/ops/write_ops_parsers.cpp b/src/mongo/db/ops/write_ops_parsers.cpp index bfc99fef55c..7d6a03ec977 100644 --- a/src/mongo/db/ops/write_ops_parsers.cpp +++ b/src/mongo/db/ops/write_ops_parsers.cpp @@ -34,7 +34,7 @@ #include "mongo/db/dbmessage.h" #include "mongo/db/ops/write_ops.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/pipeline/accumulation_statement.cpp b/src/mongo/db/pipeline/accumulation_statement.cpp index 4c191f1ed3d..d47c507c6d9 100644 --- a/src/mongo/db/pipeline/accumulation_statement.cpp +++ b/src/mongo/db/pipeline/accumulation_statement.cpp @@ -36,7 +36,7 @@ #include "mongo/db/pipeline/accumulator.h" #include "mongo/db/pipeline/value.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/string_map.h" namespace mongo { diff --git a/src/mongo/db/pipeline/dependencies.cpp b/src/mongo/db/pipeline/dependencies.cpp index 8849a98c3e5..6bfdc19bdce 100644 --- a/src/mongo/db/pipeline/dependencies.cpp +++ b/src/mongo/db/pipeline/dependencies.cpp @@ -32,16 +32,10 @@ #include "mongo/db/jsobj.h" #include "mongo/db/pipeline/dependencies.h" #include "mongo/db/pipeline/field_path.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { -using std::set; -using std::string; -using std::vector; - -namespace str = mongoutils::str; - constexpr DepsTracker::MetadataAvailable DepsTracker::kAllGeoNearDataAvailable; bool DepsTracker::_appendMetaProjections(BSONObjBuilder* projectionBuilder) const { @@ -90,15 +84,15 @@ BSONObj DepsTracker::toProjection() const { } bool needId = false; - string last; - for (set<string>::const_iterator it(fields.begin()), end(fields.end()); it != end; ++it) { - if (str::startsWith(*it, "_id") && (it->size() == 3 || (*it)[3] == '.')) { + std::string last; + for (const auto& field : fields) { + if (str::startsWith(field, "_id") && (field.size() == 3 || field[3] == '.')) { // _id and subfields are handled specially due in part to SERVER-7502 needId = true; continue; } - if (!last.empty() && str::startsWith(*it, last)) { + if (!last.empty() && str::startsWith(field, last)) { // we are including a parent of *it so we don't need to include this field // explicitly. In fact, due to SERVER-6527 if we included this field, the parent // wouldn't be fully included. This logic relies on on set iterators going in @@ -107,8 +101,8 @@ BSONObj DepsTracker::toProjection() const { continue; } - last = *it + '.'; - bb.append(*it, 1); + last = field + '.'; + bb.append(field, 1); } if (needId) // we are explicit either way @@ -131,17 +125,17 @@ boost::optional<ParsedDeps> DepsTracker::toParsedDeps() const { return boost::none; } - string last; - for (set<string>::const_iterator it(fields.begin()), end(fields.end()); it != end; ++it) { - if (!last.empty() && str::startsWith(*it, last)) { + std::string last; + for (const auto& field : fields) { + if (!last.empty() && str::startsWith(field, last)) { // we are including a parent of *it so we don't need to include this field // explicitly. In fact, if we included this field, the parent wouldn't be fully // included. This logic relies on on set iterators going in lexicographic order so // that a string is always directly before of all fields it prefixes. continue; } - last = *it + '.'; - md.setNestedField(*it, Value(true)); + last = field + '.'; + md.setNestedField(field, Value(true)); } return ParsedDeps(md.freeze()); @@ -230,7 +224,7 @@ Document documentHelper(const BSONObj& bson, const Document& neededFields, int n Value arrayHelper(const BSONObj& bson, const Document& neededFields) { BSONObjIterator it(bson); - vector<Value> values; + std::vector<Value> values; while (it.more()) { BSONElement bsonElement(it.next()); if (bsonElement.type() == Object) { diff --git a/src/mongo/db/pipeline/document.cpp b/src/mongo/db/pipeline/document.cpp index 5758b198589..7d0d23ed24c 100644 --- a/src/mongo/db/pipeline/document.cpp +++ b/src/mongo/db/pipeline/document.cpp @@ -36,10 +36,9 @@ #include "mongo/bson/bson_depth.h" #include "mongo/db/jsobj.h" #include "mongo/db/pipeline/field_path.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { -using namespace mongoutils; using boost::intrusive_ptr; using std::string; using std::vector; diff --git a/src/mongo/db/pipeline/document_source_current_op_test.cpp b/src/mongo/db/pipeline/document_source_current_op_test.cpp index 0ab59c42180..7f72327a51c 100644 --- a/src/mongo/db/pipeline/document_source_current_op_test.cpp +++ b/src/mongo/db/pipeline/document_source_current_op_test.cpp @@ -36,7 +36,7 @@ #include "mongo/db/pipeline/stub_mongo_process_interface.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/pipeline/document_source_facet.cpp b/src/mongo/db/pipeline/document_source_facet.cpp index c3085279e8f..3c9b55bb215 100644 --- a/src/mongo/db/pipeline/document_source_facet.cpp +++ b/src/mongo/db/pipeline/document_source_facet.cpp @@ -47,7 +47,7 @@ #include "mongo/db/pipeline/value.h" #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp b/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp index c322469e8a8..f0fae26f470 100644 --- a/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp +++ b/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp @@ -40,7 +40,7 @@ #include "mongo/db/pipeline/stub_mongo_process_interface.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp index 864ca057945..364f8804cd9 100644 --- a/src/mongo/db/pipeline/expression.cpp +++ b/src/mongo/db/pipeline/expression.cpp @@ -47,16 +47,14 @@ #include "mongo/db/query/datetime/date_time_support.h" #include "mongo/platform/bits.h" #include "mongo/platform/decimal128.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/regex_util.h" +#include "mongo/util/str.h" #include "mongo/util/string_map.h" #include "mongo/util/summation.h" namespace mongo { using Parser = Expression::Parser; -using namespace mongoutils; - using boost::intrusive_ptr; using std::map; using std::move; diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h index f5b7ec4fc12..e98798f6d78 100644 --- a/src/mongo/db/pipeline/expression.h +++ b/src/mongo/db/pipeline/expression.h @@ -48,7 +48,7 @@ #include "mongo/db/server_options.h" #include "mongo/stdx/functional.h" #include "mongo/util/intrusive_counter.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -343,14 +343,12 @@ public: void validateArguments(const Expression::ExpressionVector& args) const override { uassert(28667, - mongoutils::str::stream() << "Expression " << this->getOpName() - << " takes at least " - << MinArgs - << " arguments, and at most " - << MaxArgs - << ", but " - << args.size() - << " were passed in.", + str::stream() << "Expression " << this->getOpName() << " takes at least " << MinArgs + << " arguments, and at most " + << MaxArgs + << ", but " + << args.size() + << " were passed in.", MinArgs <= args.size() && args.size() <= MaxArgs); } }; @@ -364,11 +362,10 @@ public: void validateArguments(const Expression::ExpressionVector& args) const override { uassert(16020, - mongoutils::str::stream() << "Expression " << this->getOpName() << " takes exactly " - << NArgs - << " arguments. " - << args.size() - << " were passed in.", + str::stream() << "Expression " << this->getOpName() << " takes exactly " << NArgs + << " arguments. " + << args.size() + << " were passed in.", args.size() == NArgs); } }; diff --git a/src/mongo/db/pipeline/field_path.cpp b/src/mongo/db/pipeline/field_path.cpp index dab64594e71..bb26fc478ca 100644 --- a/src/mongo/db/pipeline/field_path.cpp +++ b/src/mongo/db/pipeline/field_path.cpp @@ -33,7 +33,7 @@ #include "mongo/base/string_data.h" #include "mongo/bson/bson_depth.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/pipeline/parsed_aggregation_projection.cpp b/src/mongo/db/pipeline/parsed_aggregation_projection.cpp index 5c431e17798..3f283079ac4 100644 --- a/src/mongo/db/pipeline/parsed_aggregation_projection.cpp +++ b/src/mongo/db/pipeline/parsed_aggregation_projection.cpp @@ -42,7 +42,7 @@ #include "mongo/db/pipeline/parsed_inclusion_projection.h" #include "mongo/stdx/unordered_set.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace parsed_aggregation_projection { diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp index 677daa986f8..3728f5b503c 100644 --- a/src/mongo/db/pipeline/pipeline.cpp +++ b/src/mongo/db/pipeline/pipeline.cpp @@ -51,7 +51,7 @@ #include "mongo/db/pipeline/expression.h" #include "mongo/db/pipeline/expression_context.h" #include "mongo/util/fail_point_service.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/pipeline/pipeline_metadata_tree_test.cpp b/src/mongo/db/pipeline/pipeline_metadata_tree_test.cpp index 46a816ad22e..128b820b753 100644 --- a/src/mongo/db/pipeline/pipeline_metadata_tree_test.cpp +++ b/src/mongo/db/pipeline/pipeline_metadata_tree_test.cpp @@ -63,7 +63,7 @@ try { \ EXPRESSION; \ } catch (const AssertionException& e) { \ - ::mongoutils::str::stream err; \ + ::mongo::str::stream err; \ err << "Threw an exception incorrectly: " << e.toString() \ << " Exception occured in: " << #EXPRESSION; \ ::mongo::unittest::TestAssertionFailure(__FILE__, __LINE__, err).stream(); \ diff --git a/src/mongo/db/pipeline/value.cpp b/src/mongo/db/pipeline/value.cpp index c4ee8c848b4..e8961ead90a 100644 --- a/src/mongo/db/pipeline/value.cpp +++ b/src/mongo/db/pipeline/value.cpp @@ -45,11 +45,10 @@ #include "mongo/db/query/datetime/date_time_support.h" #include "mongo/platform/decimal128.h" #include "mongo/util/hex.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/represent_as.h" +#include "mongo/util/str.h" namespace mongo { -using namespace mongoutils; using boost::intrusive_ptr; using std::min; using std::numeric_limits; diff --git a/src/mongo/db/pipeline/variables.cpp b/src/mongo/db/pipeline/variables.cpp index c4d812831de..d8a17fe72d2 100644 --- a/src/mongo/db/pipeline/variables.cpp +++ b/src/mongo/db/pipeline/variables.cpp @@ -32,7 +32,7 @@ #include "mongo/db/logical_clock.h" #include "mongo/platform/basic.h" #include "mongo/platform/random.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/query/canonical_query_test.cpp b/src/mongo/db/query/canonical_query_test.cpp index 6afbbfe4d57..8926ce0dd2d 100644 --- a/src/mongo/db/query/canonical_query_test.cpp +++ b/src/mongo/db/query/canonical_query_test.cpp @@ -57,7 +57,7 @@ MatchExpression* parseMatchExpression(const BSONObj& obj) { ExtensionsCallbackNoop(), MatchExpressionParser::kAllowAllSpecialFeatures); if (!status.isOK()) { - mongoutils::str::stream ss; + str::stream ss; ss << "failed to parse query: " << obj.toString() << ". Reason: " << status.getStatus().toString(); FAIL(ss); @@ -72,7 +72,7 @@ void assertEquivalent(const char* queryStr, if (actual->equivalent(expected)) { return; } - mongoutils::str::stream ss; + str::stream ss; ss << "Match expressions are not equivalent." << "\nOriginal query: " << queryStr << "\nExpected: " << expected->debugString() << "\nActual: " << actual->debugString(); @@ -85,7 +85,7 @@ void assertNotEquivalent(const char* queryStr, if (!actual->equivalent(expected)) { return; } - mongoutils::str::stream ss; + str::stream ss; ss << "Match expressions are equivalent." << "\nOriginal query: " << queryStr << "\nExpected: " << expected->debugString() << "\nActual: " << actual->debugString(); diff --git a/src/mongo/db/query/collation/collator_factory_icu.cpp b/src/mongo/db/query/collation/collator_factory_icu.cpp index 8c232d60025..c8b8de7a5ab 100644 --- a/src/mongo/db/query/collation/collator_factory_icu.cpp +++ b/src/mongo/db/query/collation/collator_factory_icu.cpp @@ -40,7 +40,7 @@ #include "mongo/bson/util/bson_extract.h" #include "mongo/db/query/collation/collator_interface_icu.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/count_request.cpp b/src/mongo/db/query/count_request.cpp index 733287b0e15..77c8b82b211 100644 --- a/src/mongo/db/query/count_request.cpp +++ b/src/mongo/db/query/count_request.cpp @@ -32,7 +32,7 @@ #include "mongo/db/query/count_request.h" #include "mongo/db/query/query_request.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/query/count_request_test.cpp b/src/mongo/db/query/count_request_test.cpp index e81877a07f8..21225033d07 100644 --- a/src/mongo/db/query/count_request_test.cpp +++ b/src/mongo/db/query/count_request_test.cpp @@ -35,7 +35,7 @@ #include "mongo/db/pipeline/aggregation_request.h" #include "mongo/db/query/count_request.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/query/datetime/date_time_support.cpp b/src/mongo/db/query/datetime/date_time_support.cpp index c3325351158..01397b1c605 100644 --- a/src/mongo/db/query/datetime/date_time_support.cpp +++ b/src/mongo/db/query/datetime/date_time_support.cpp @@ -43,7 +43,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/duration.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/datetime/init_timezone_data.cpp b/src/mongo/db/query/datetime/init_timezone_data.cpp index 2097b9c4f27..dea7322dd90 100644 --- a/src/mongo/db/query/datetime/init_timezone_data.cpp +++ b/src/mongo/db/query/datetime/init_timezone_data.cpp @@ -36,7 +36,7 @@ #include "mongo/db/server_options.h" #include "mongo/db/service_context.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp index 0b6ac374326..8eecde1fad1 100644 --- a/src/mongo/db/query/explain.cpp +++ b/src/mongo/db/query/explain.cpp @@ -53,8 +53,8 @@ #include "mongo/db/query/stage_builder.h" #include "mongo/db/server_options.h" #include "mongo/util/hex.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/socket_utils.h" +#include "mongo/util/str.h" #include "mongo/util/version.h" namespace { @@ -296,7 +296,7 @@ unique_ptr<PlanStageStats> getWinningPlanStatsTree(const PlanExecutor* exec) { namespace mongo { -using mongoutils::str::stream; +using str::stream; // static void Explain::statsToBSON(const PlanStageStats& stats, diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index 7133be046d5..ce24825218a 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -65,8 +65,8 @@ #include "mongo/stdx/memory.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/get_executor_test.cpp b/src/mongo/db/query/get_executor_test.cpp index be61a15fcb5..50b50275a4c 100644 --- a/src/mongo/db/query/get_executor_test.cpp +++ b/src/mongo/db/query/get_executor_test.cpp @@ -42,7 +42,7 @@ #include "mongo/db/query/query_test_service_context.h" #include "mongo/stdx/unordered_set.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" using namespace mongo; diff --git a/src/mongo/db/query/index_bounds.cpp b/src/mongo/db/query/index_bounds.cpp index b76e083d7a1..929f73368f3 100644 --- a/src/mongo/db/query/index_bounds.cpp +++ b/src/mongo/db/query/index_bounds.cpp @@ -127,7 +127,7 @@ bool IndexBounds::operator!=(const IndexBounds& other) const { } string OrderedIntervalList::toString() const { - mongoutils::str::stream ss; + str::stream ss; ss << "['" << name << "']: "; for (size_t j = 0; j < intervals.size(); ++j) { ss << intervals[j].toString(); @@ -297,7 +297,7 @@ void OrderedIntervalList::complement() { } string IndexBounds::toString() const { - mongoutils::str::stream ss; + str::stream ss; if (isSimpleRange) { if (IndexBounds::isStartIncludedInBound(boundInclusion)) { ss << "["; diff --git a/src/mongo/db/query/index_bounds_builder.cpp b/src/mongo/db/query/index_bounds_builder.cpp index 43c5a55772c..bd3c92c38fc 100644 --- a/src/mongo/db/query/index_bounds_builder.cpp +++ b/src/mongo/db/query/index_bounds_builder.cpp @@ -50,7 +50,7 @@ #include "mongo/db/query/planner_wildcard_helpers.h" #include "mongo/db/query/query_knobs_gen.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "third_party/s2/s2cell.h" #include "third_party/s2/s2regioncoverer.h" @@ -194,7 +194,7 @@ string IndexBoundsBuilder::simpleRegex(const char* regex, } } - mongoutils::str::stream ss; + str::stream ss; string r = ""; while (*regex) { diff --git a/src/mongo/db/query/index_bounds_test.cpp b/src/mongo/db/query/index_bounds_test.cpp index fee6d873365..beded95e98a 100644 --- a/src/mongo/db/query/index_bounds_test.cpp +++ b/src/mongo/db/query/index_bounds_test.cpp @@ -38,7 +38,7 @@ #include "mongo/db/query/index_bounds.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/text.h" using namespace mongo; @@ -981,7 +981,7 @@ void testFindIntervalForField(int key, IndexBoundsChecker::Location location = IndexBoundsChecker::findIntervalForField(keyElt, oil, expectedDirection, &intervalIndex); if (expectedLocation != location) { - mongoutils::str::stream ss; + str::stream ss; ss << "Unexpected location from findIntervalForField: key=" << keyElt << "; intervals=" << oil.toString() << "; direction=" << expectedDirection << ". Expected: " << toString(expectedLocation) << ". Actual: " << toString(location); @@ -991,7 +991,7 @@ void testFindIntervalForField(int key, if ((IndexBoundsChecker::BEHIND == expectedLocation || IndexBoundsChecker::WITHIN == expectedLocation) && expectedIntervalIndex != intervalIndex) { - mongoutils::str::stream ss; + str::stream ss; ss << "Unexpected interval index from findIntervalForField: key=" << keyElt << "; intervals=" << oil.toString() << "; direction=" << expectedDirection << "; location= " << toString(location) << ". Expected: " << expectedIntervalIndex diff --git a/src/mongo/db/query/index_entry.h b/src/mongo/db/query/index_entry.h index 5595de03fb4..89b14ffd609 100644 --- a/src/mongo/db/query/index_entry.h +++ b/src/mongo/db/query/index_entry.h @@ -37,7 +37,7 @@ #include "mongo/db/index/multikey_paths.h" #include "mongo/db/index_names.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/interval.h b/src/mongo/db/query/interval.h index 2e8b52a6712..e86af179f78 100644 --- a/src/mongo/db/query/interval.h +++ b/src/mongo/db/query/interval.h @@ -30,7 +30,7 @@ #pragma once #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -53,7 +53,7 @@ struct Interval { Interval(); std::string toString() const { - mongoutils::str::stream ss; + str::stream ss; if (startInclusive) { ss << "["; } else { diff --git a/src/mongo/db/query/parsed_distinct.cpp b/src/mongo/db/query/parsed_distinct.cpp index 245392d95ad..b570b160a94 100644 --- a/src/mongo/db/query/parsed_distinct.cpp +++ b/src/mongo/db/query/parsed_distinct.cpp @@ -39,7 +39,7 @@ #include "mongo/db/repl/read_concern_args.h" #include "mongo/idl/idl_parser.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/parsed_projection.cpp b/src/mongo/db/query/parsed_projection.cpp index 91b0156f8f4..415087e7fb1 100644 --- a/src/mongo/db/query/parsed_projection.cpp +++ b/src/mongo/db/query/parsed_projection.cpp @@ -114,7 +114,7 @@ Status ParsedProjection::make(OperationContext* opCtx, "Cannot specify positional operator and $elemMatch."); } - if (mongoutils::str::contains(elem.fieldName(), '.')) { + if (str::contains(elem.fieldName(), '.')) { return Status(ErrorCodes::BadValue, "Cannot use $elemMatch projection on a nested field."); } @@ -149,7 +149,7 @@ Status ParsedProjection::make(OperationContext* opCtx, pp->_arrayFields.push_back(elem.fieldNameStringData()); } else if (e2.fieldNameStringData() == "$meta") { // Field for meta must be top level. We can relax this at some point. - if (mongoutils::str::contains(elem.fieldName(), '.')) { + if (str::contains(elem.fieldName(), '.')) { return Status(ErrorCodes::BadValue, "field for $meta cannot be nested"); } @@ -231,17 +231,17 @@ Status ParsedProjection::make(OperationContext* opCtx, "Cannot specify positional operator and $elemMatch."); } - std::string after = mongoutils::str::after(elem.fieldName(), ".$"); - if (mongoutils::str::contains(after, ".$")) { - mongoutils::str::stream ss; + std::string after = str::after(elem.fieldName(), ".$"); + if (str::contains(after, ".$")) { + str::stream ss; ss << "Positional projection '" << elem.fieldName() << "' contains " << "the positional operator more than once."; return Status(ErrorCodes::BadValue, ss); } - std::string matchfield = mongoutils::str::before(elem.fieldName(), '.'); + std::string matchfield = str::before(elem.fieldName(), '.'); if (query && !_hasPositionalOperatorMatch(query, matchfield)) { - mongoutils::str::stream ss; + str::stream ss; ss << "Positional projection '" << elem.fieldName() << "' does not " << "match the query document."; return Status(ErrorCodes::BadValue, ss); @@ -382,10 +382,8 @@ bool ParsedProjection::isFieldRetainedExactly(StringData path) const { // static bool ParsedProjection::_isPositionalOperator(const char* fieldName) { - return mongoutils::str::contains(fieldName, ".$") && - !mongoutils::str::contains(fieldName, ".$ref") && - !mongoutils::str::contains(fieldName, ".$id") && - !mongoutils::str::contains(fieldName, ".$db"); + return str::contains(fieldName, ".$") && !str::contains(fieldName, ".$ref") && + !str::contains(fieldName, ".$id") && !str::contains(fieldName, ".$db"); } // static @@ -406,7 +404,7 @@ bool ParsedProjection::_hasPositionalOperatorMatch(const MatchExpression* const if (!pathRawData) { return false; } - std::string pathPrefix = mongoutils::str::before(pathRawData, '.'); + std::string pathPrefix = str::before(pathRawData, '.'); return pathPrefix == matchfield; } return false; diff --git a/src/mongo/db/query/parsed_projection.h b/src/mongo/db/query/parsed_projection.h index 4fbd6e21f35..e22a594a528 100644 --- a/src/mongo/db/query/parsed_projection.h +++ b/src/mongo/db/query/parsed_projection.h @@ -31,7 +31,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/matcher/expression_parser.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/parsed_projection_test.cpp b/src/mongo/db/query/parsed_projection_test.cpp index 029f9b41fd4..84669166c8d 100644 --- a/src/mongo/db/query/parsed_projection_test.cpp +++ b/src/mongo/db/query/parsed_projection_test.cpp @@ -61,10 +61,9 @@ unique_ptr<ParsedProjection> createParsedProjection(const BSONObj& query, const ParsedProjection* out = NULL; Status status = ParsedProjection::make(opCtx.get(), projObj, queryMatchExpr.get(), &out); if (!status.isOK()) { - FAIL(mongoutils::str::stream() << "failed to parse projection " << projObj << " (query: " - << query - << "): " - << status.toString()); + FAIL(str::stream() << "failed to parse projection " << projObj << " (query: " << query + << "): " + << status.toString()); } ASSERT(out); return unique_ptr<ParsedProjection>(out); diff --git a/src/mongo/db/query/plan_enumerator.cpp b/src/mongo/db/query/plan_enumerator.cpp index 1dbdb6c973d..8bc87ce75cb 100644 --- a/src/mongo/db/query/plan_enumerator.cpp +++ b/src/mongo/db/query/plan_enumerator.cpp @@ -48,8 +48,8 @@ using std::string; using std::vector; std::string getPathPrefix(std::string path) { - if (mongoutils::str::contains(path, '.')) { - return mongoutils::str::before(path, '.'); + if (str::contains(path, '.')) { + return str::before(path, '.'); } else { return path; } @@ -282,7 +282,7 @@ Status PlanEnumerator::init() { } std::string PlanEnumerator::dumpMemo() { - mongoutils::str::stream ss; + str::stream ss; // Note that this needs to be kept in sync with allocateAssignment which assigns memo IDs. for (size_t i = 1; i <= _memo.size(); ++i) { @@ -293,7 +293,7 @@ std::string PlanEnumerator::dumpMemo() { string PlanEnumerator::NodeAssignment::toString() const { if (NULL != andAssignment) { - mongoutils::str::stream ss; + str::stream ss; ss << "AND enumstate counter " << andAssignment->counter; for (size_t i = 0; i < andAssignment->choices.size(); ++i) { ss << "\n\tchoice " << i << ":\n"; @@ -319,7 +319,7 @@ string PlanEnumerator::NodeAssignment::toString() const { } return ss; } else if (NULL != arrayAssignment) { - mongoutils::str::stream ss; + str::stream ss; ss << "ARRAY SUBNODES enumstate " << arrayAssignment->counter << "/ ONE OF: [ "; for (size_t i = 0; i < arrayAssignment->subnodes.size(); ++i) { ss << arrayAssignment->subnodes[i] << " "; @@ -328,7 +328,7 @@ string PlanEnumerator::NodeAssignment::toString() const { return ss; } else { verify(NULL != orAssignment); - mongoutils::str::stream ss; + str::stream ss; ss << "ALL OF: [ "; for (size_t i = 0; i < orAssignment->subnodes.size(); ++i) { ss << orAssignment->subnodes[i] << " "; diff --git a/src/mongo/db/query/plan_ranker.cpp b/src/mongo/db/query/plan_ranker.cpp index baf92677727..4d3069fb47a 100644 --- a/src/mongo/db/query/plan_ranker.cpp +++ b/src/mongo/db/query/plan_ranker.cpp @@ -242,7 +242,7 @@ double PlanRanker::scoreTree(const PlanStageStats* stats) { double tieBreakers = noFetchBonus + noSortBonus + noIxisectBonus; double score = baseScore + productivity + tieBreakers; - mongoutils::str::stream ss; + str::stream ss; ss << "score(" << score << ") = baseScore(" << baseScore << ")" << " + productivity((" << stats->common.advanced << " advanced)/(" << stats->common.works << " works) = " << productivity << ")" diff --git a/src/mongo/db/query/planner_ixselect_test.cpp b/src/mongo/db/query/planner_ixselect_test.cpp index 1f021e13d6e..e80eddd187b 100644 --- a/src/mongo/db/query/planner_ixselect_test.cpp +++ b/src/mongo/db/query/planner_ixselect_test.cpp @@ -70,7 +70,7 @@ unique_ptr<MatchExpression> parseMatchExpression(const BSONObj& obj) { */ template <typename Iter> string toString(Iter begin, Iter end) { - mongoutils::str::stream ss; + str::stream ss; ss << "["; for (Iter i = begin; i != end; i++) { if (i != begin) { @@ -100,7 +100,7 @@ void testGetFields(const char* query, const char* prefix, const char* expectedFi for (vector<string>::const_iterator i = expectedFields.begin(); i != expectedFields.end(); i++) { if (fields.find(*i) == fields.end()) { - mongoutils::str::stream ss; + str::stream ss; ss << "getFields(query=" << query << ", prefix=" << prefix << "): unable to find " << *i << " in result: " << toString(fields.begin(), fields.end()); FAIL(ss); @@ -109,7 +109,7 @@ void testGetFields(const char* query, const char* prefix, const char* expectedFi // Next, confirm that results do not contain any unexpected fields. if (fields.size() != expectedFields.size()) { - mongoutils::str::stream ss; + str::stream ss; ss << "getFields(query=" << query << ", prefix=" << prefix << "): unexpected fields in result. expected: " << toString(expectedFields.begin(), expectedFields.end()) @@ -173,7 +173,7 @@ void findRelevantTaggedNodePathsAndIndices(MatchExpression* root, tag->debugString(&buf); RelevantTag* r = dynamic_cast<RelevantTag*>(tag); if (!r) { - mongoutils::str::stream ss; + str::stream ss; ss << "tag is not instance of RelevantTag. tree: " << root->debugString() << "; tag: " << buf.str(); FAIL(ss); @@ -235,7 +235,7 @@ void testRateIndices(const char* query, // Compare the expected indices with the actual indices. if (actualIndices != expectedIndices) { - mongoutils::str::stream ss; + str::stream ss; ss << "rateIndices(query=" << query << ", prefix=" << prefix << "): expected indices did not match actual indices. expected: " << toString(expectedIndices.begin(), expectedIndices.end()) @@ -247,7 +247,7 @@ void testRateIndices(const char* query, // First verify number of paths retrieved. vector<string> expectedPaths = StringSplitter::split(expectedPathsStr, ","); if (paths.size() != expectedPaths.size()) { - mongoutils::str::stream ss; + str::stream ss; ss << "rateIndices(query=" << query << ", prefix=" << prefix << "): unexpected number of tagged nodes found. expected: " << toString(expectedPaths.begin(), expectedPaths.end()) @@ -262,7 +262,7 @@ void testRateIndices(const char* query, if (*i == *j) { continue; } - mongoutils::str::stream ss; + str::stream ss; ss << "rateIndices(query=" << query << ", prefix=" << prefix << "): unexpected path found. expected: " << *j << " " << toString(expectedPaths.begin(), expectedPaths.end()) << ". actual: " << *i << " " diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp index d7503c724a8..fb819ce9c36 100644 --- a/src/mongo/db/query/query_planner.cpp +++ b/src/mongo/db/query/query_planner.cpp @@ -87,7 +87,7 @@ static bool is2DIndex(const BSONObj& pattern) { } string optionString(size_t options) { - mongoutils::str::stream ss; + str::stream ss; if (QueryPlannerParams::DEFAULT == options) { ss << "DEFAULT "; @@ -308,7 +308,7 @@ StatusWith<std::unique_ptr<PlanCacheIndexTree>> QueryPlanner::cacheDataFromTagge taggedTree->getTag()->getType() == MatchExpression::TagData::Type::IndexTag) { IndexTag* itag = static_cast<IndexTag*>(taggedTree->getTag()); if (itag->index >= relevantIndices.size()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Index number is " << itag->index << " but there are only " << relevantIndices.size() << " relevant indices."; return Status(ErrorCodes::BadValue, ss); @@ -384,7 +384,7 @@ Status QueryPlanner::tagAccordingToCache(MatchExpression* filter, verify(NULL == filter->getTag()); if (filter->numChildren() != indexTree->children.size()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Cache topology and query did not match: " << "query has " << filter->numChildren() << " children " << "and cache has " << indexTree->children.size() << " children."; @@ -419,7 +419,7 @@ Status QueryPlanner::tagAccordingToCache(MatchExpression* filter, if (indexTree->entry.get()) { const auto got = indexMap.find(indexTree->entry->identifier); if (got == indexMap.end()) { - mongoutils::str::stream ss; + str::stream ss; ss << "Did not find index with name: " << indexTree->entry->identifier.catalogName; return Status(ErrorCodes::BadValue, ss); } diff --git a/src/mongo/db/query/query_planner_test_fixture.cpp b/src/mongo/db/query/query_planner_test_fixture.cpp index d04d3060b4a..59306ff1feb 100644 --- a/src/mongo/db/query/query_planner_test_fixture.cpp +++ b/src/mongo/db/query/query_planner_test_fixture.cpp @@ -473,12 +473,12 @@ size_t QueryPlannerTest::getNumSolutions() const { } void QueryPlannerTest::dumpSolutions() const { - mongoutils::str::stream ost; + str::stream ost; dumpSolutions(ost); log() << std::string(ost); } -void QueryPlannerTest::dumpSolutions(mongoutils::str::stream& ost) const { +void QueryPlannerTest::dumpSolutions(str::stream& ost) const { for (auto&& soln : solns) { ost << soln->toString() << '\n'; } @@ -488,7 +488,7 @@ void QueryPlannerTest::assertNumSolutions(size_t expectSolutions) const { if (getNumSolutions() == expectSolutions) { return; } - mongoutils::str::stream ss; + str::stream ss; ss << "expected " << expectSolutions << " solutions but got " << getNumSolutions() << " instead. solutions generated: " << '\n'; dumpSolutions(ss); @@ -512,7 +512,7 @@ void QueryPlannerTest::assertSolutionExists(const std::string& solnJson, size_t if (numMatches == matches) { return; } - mongoutils::str::stream ss; + str::stream ss; ss << "expected " << numMatches << " matches for solution " << solnJson << " but got " << matches << " instead. all solutions generated: " << '\n'; dumpSolutions(ss); @@ -530,7 +530,7 @@ void QueryPlannerTest::assertHasOneSolutionOf(const std::vector<std::string>& so if (1U == matches) { return; } - mongoutils::str::stream ss; + str::stream ss; ss << "assertHasOneSolutionOf expected one matching solution" << " but got " << matches << " instead. all solutions generated: " << '\n'; dumpSolutions(ss); diff --git a/src/mongo/db/query/query_planner_test_fixture.h b/src/mongo/db/query/query_planner_test_fixture.h index 885401b6900..b314099057f 100644 --- a/src/mongo/db/query/query_planner_test_fixture.h +++ b/src/mongo/db/query/query_planner_test_fixture.h @@ -174,7 +174,7 @@ protected: void dumpSolutions() const; - void dumpSolutions(mongoutils::str::stream& ost) const; + void dumpSolutions(str::stream& ost) const; /** * Will use a relaxed bounds check for the remaining assert* calls. Subsequent calls to assert* diff --git a/src/mongo/db/query/query_request.cpp b/src/mongo/db/query/query_request.cpp index 6cdca0a5327..ca26724a64b 100644 --- a/src/mongo/db/query/query_request.cpp +++ b/src/mongo/db/query/query_request.cpp @@ -42,7 +42,7 @@ #include "mongo/db/repl/read_concern_args.h" #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/query_solution.cpp b/src/mongo/db/query/query_solution.cpp index dd0be890782..23c83c6fb8a 100644 --- a/src/mongo/db/query/query_solution.cpp +++ b/src/mongo/db/query/query_solution.cpp @@ -157,19 +157,19 @@ void addEqualityFieldSorts(const BSONObj& sortPattern, } string QuerySolutionNode::toString() const { - mongoutils::str::stream ss; + str::stream ss; appendToString(&ss, 0); return ss; } // static -void QuerySolutionNode::addIndent(mongoutils::str::stream* ss, int level) { +void QuerySolutionNode::addIndent(str::stream* ss, int level) { for (int i = 0; i < level; ++i) { *ss << "---"; } } -void QuerySolutionNode::addCommon(mongoutils::str::stream* ss, int indent) const { +void QuerySolutionNode::addCommon(str::stream* ss, int indent) const { addIndent(ss, indent + 1); *ss << "fetched = " << fetched() << '\n'; addIndent(ss, indent + 1); @@ -186,7 +186,7 @@ void QuerySolutionNode::addCommon(mongoutils::str::stream* ss, int indent) const // TextNode // -void TextNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void TextNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "TEXT\n"; addIndent(ss, indent + 1); @@ -228,7 +228,7 @@ QuerySolutionNode* TextNode::clone() const { CollectionScanNode::CollectionScanNode() : _sort(SimpleBSONObjComparator::kInstance.makeBSONObjSet()), tailable(false), direction(1) {} -void CollectionScanNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void CollectionScanNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "COLLSCAN\n"; addIndent(ss, indent + 1); @@ -262,7 +262,7 @@ AndHashNode::AndHashNode() : _sort(SimpleBSONObjComparator::kInstance.makeBSONOb AndHashNode::~AndHashNode() {} -void AndHashNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void AndHashNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "AND_HASH\n"; if (NULL != filter) { @@ -316,7 +316,7 @@ AndSortedNode::AndSortedNode() : _sort(SimpleBSONObjComparator::kInstance.makeBS AndSortedNode::~AndSortedNode() {} -void AndSortedNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void AndSortedNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "AND_SORTED\n"; addCommon(ss, indent); @@ -366,7 +366,7 @@ OrNode::OrNode() : _sort(SimpleBSONObjComparator::kInstance.makeBSONObjSet()), d OrNode::~OrNode() {} -void OrNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void OrNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "OR\n"; if (NULL != filter) { @@ -427,7 +427,7 @@ MergeSortNode::MergeSortNode() MergeSortNode::~MergeSortNode() {} -void MergeSortNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void MergeSortNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "MERGE_SORT\n"; if (NULL != filter) { @@ -486,7 +486,7 @@ QuerySolutionNode* MergeSortNode::clone() const { FetchNode::FetchNode() : _sorts(SimpleBSONObjComparator::kInstance.makeBSONObjSet()) {} -void FetchNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void FetchNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "FETCH\n"; if (NULL != filter) { @@ -523,7 +523,7 @@ IndexScanNode::IndexScanNode(IndexEntry index) shouldDedup(index.multikey), queryCollator(nullptr) {} -void IndexScanNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void IndexScanNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "IXSCAN\n"; addIndent(ss, indent + 1); @@ -851,7 +851,7 @@ bool IndexScanNode::operator==(const IndexScanNode& other) const { // ProjectionNode // -void ProjectionNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void ProjectionNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "PROJ\n"; addIndent(ss, indent + 1); @@ -932,7 +932,7 @@ ProjectionNode* ProjectionNodeSimple::clone() const { // SortKeyGeneratorNode // -void SortKeyGeneratorNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void SortKeyGeneratorNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "SORT_KEY_GENERATOR\n"; addIndent(ss, indent + 1); @@ -954,7 +954,7 @@ QuerySolutionNode* SortKeyGeneratorNode::clone() const { // SortNode // -void SortNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void SortNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "SORT\n"; addIndent(ss, indent + 1); @@ -983,7 +983,7 @@ QuerySolutionNode* SortNode::clone() const { // -void LimitNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void LimitNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "LIMIT\n"; addIndent(ss, indent + 1); @@ -1008,7 +1008,7 @@ QuerySolutionNode* LimitNode::clone() const { // SkipNode // -void SkipNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void SkipNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "SKIP\n"; addIndent(ss, indent + 1); @@ -1032,7 +1032,7 @@ QuerySolutionNode* SkipNode::clone() const { // GeoNear2DNode // -void GeoNear2DNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void GeoNear2DNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "GEO_NEAR_2D\n"; addIndent(ss, indent + 1); @@ -1064,7 +1064,7 @@ QuerySolutionNode* GeoNear2DNode::clone() const { // GeoNear2DSphereNode // -void GeoNear2DSphereNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void GeoNear2DSphereNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "GEO_NEAR_2DSPHERE\n"; addIndent(ss, indent + 1); @@ -1098,7 +1098,7 @@ QuerySolutionNode* GeoNear2DSphereNode::clone() const { // ShardingFilterNode // -void ShardingFilterNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void ShardingFilterNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "SHARDING_FILTER\n"; if (NULL != filter) { @@ -1124,7 +1124,7 @@ QuerySolutionNode* ShardingFilterNode::clone() const { // DistinctNode // -void DistinctNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void DistinctNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "DISTINCT\n"; addIndent(ss, indent + 1); @@ -1162,7 +1162,7 @@ void DistinctNode::computeProperties() { // CountScanNode // -void CountScanNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void CountScanNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "COUNT\n"; addIndent(ss, indent + 1); @@ -1192,7 +1192,7 @@ QuerySolutionNode* CountScanNode::clone() const { // EnsureSortedNode // -void EnsureSortedNode::appendToString(mongoutils::str::stream* ss, int indent) const { +void EnsureSortedNode::appendToString(str::stream* ss, int indent) const { addIndent(ss, indent); *ss << "ENSURE_SORTED\n"; addIndent(ss, indent + 1); diff --git a/src/mongo/db/query/query_solution.h b/src/mongo/db/query/query_solution.h index 04e6cd6d997..44c63d4bfb6 100644 --- a/src/mongo/db/query/query_solution.h +++ b/src/mongo/db/query/query_solution.h @@ -77,7 +77,7 @@ struct QuerySolutionNode { * * TODO: Consider outputting into a BSONObj or builder thereof. */ - virtual void appendToString(mongoutils::str::stream* ss, int indent) const = 0; + virtual void appendToString(str::stream* ss, int indent) const = 0; // // Computed properties @@ -179,13 +179,13 @@ protected: /** * Formatting helper used by toString(). */ - static void addIndent(mongoutils::str::stream* ss, int level); + static void addIndent(str::stream* ss, int level); /** * Every solution node has properties and this adds the debug info for the * properties. */ - void addCommon(mongoutils::str::stream* ss, int indent) const; + void addCommon(str::stream* ss, int indent) const; private: QuerySolutionNode(const QuerySolutionNode&) = delete; @@ -233,7 +233,7 @@ struct QuerySolution { return "empty query solution"; } - mongoutils::str::stream ss; + str::stream ss; root->appendToString(&ss, 0); return ss; } @@ -253,7 +253,7 @@ struct TextNode : public QuerySolutionNode { return STAGE_TEXT; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; // Text's return is LOC_AND_OBJ so it's fetched and has all fields. bool fetched() const { @@ -297,7 +297,7 @@ struct CollectionScanNode : public QuerySolutionNode { return STAGE_COLLSCAN; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return true; @@ -341,7 +341,7 @@ struct AndHashNode : public QuerySolutionNode { return STAGE_AND_HASH; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const; bool hasField(const std::string& field) const; @@ -365,7 +365,7 @@ struct AndSortedNode : public QuerySolutionNode { return STAGE_AND_SORTED; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const; bool hasField(const std::string& field) const; @@ -389,7 +389,7 @@ struct OrNode : public QuerySolutionNode { return STAGE_OR; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const; bool hasField(const std::string& field) const; @@ -417,7 +417,7 @@ struct MergeSortNode : public QuerySolutionNode { return STAGE_SORT_MERGE; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const; bool hasField(const std::string& field) const; @@ -453,7 +453,7 @@ struct FetchNode : public QuerySolutionNode { return STAGE_FETCH; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return true; @@ -483,7 +483,7 @@ struct IndexScanNode : public QuerySolutionNode { return STAGE_IXSCAN; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return false; @@ -547,7 +547,7 @@ struct ProjectionNode : QuerySolutionNode { void computeProperties() final; - void appendToString(mongoutils::str::stream* ss, int indent) const final; + void appendToString(str::stream* ss, int indent) const final; /** * Data from the projection node is considered fetch iff the child provides fetched data. @@ -684,7 +684,7 @@ struct SortKeyGeneratorNode : public QuerySolutionNode { QuerySolutionNode* clone() const final; - void appendToString(mongoutils::str::stream* ss, int indent) const final; + void appendToString(str::stream* ss, int indent) const final; // The user-supplied sort pattern. BSONObj sortSpec; @@ -699,7 +699,7 @@ struct SortNode : public QuerySolutionNode { return STAGE_SORT; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return children[0]->fetched(); @@ -741,7 +741,7 @@ struct LimitNode : public QuerySolutionNode { return STAGE_LIMIT; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return children[0]->fetched(); @@ -768,7 +768,7 @@ struct SkipNode : public QuerySolutionNode { virtual StageType getType() const { return STAGE_SKIP; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return children[0]->fetched(); @@ -801,7 +801,7 @@ struct GeoNear2DNode : public QuerySolutionNode { virtual StageType getType() const { return STAGE_GEO_NEAR_2D; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return true; @@ -842,7 +842,7 @@ struct GeoNear2DSphereNode : public QuerySolutionNode { virtual StageType getType() const { return STAGE_GEO_NEAR_2DSPHERE; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return true; @@ -887,7 +887,7 @@ struct ShardingFilterNode : public QuerySolutionNode { virtual StageType getType() const { return STAGE_SHARDING_FILTER; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return children[0]->fetched(); @@ -918,7 +918,7 @@ struct DistinctNode : public QuerySolutionNode { virtual StageType getType() const { return STAGE_DISTINCT_SCAN; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; // This stage is created "on top" of normal planning and as such the properties // below don't really matter. @@ -964,7 +964,7 @@ struct CountScanNode : public QuerySolutionNode { virtual StageType getType() const { return STAGE_COUNT_SCAN; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return false; @@ -1003,7 +1003,7 @@ struct EnsureSortedNode : public QuerySolutionNode { return STAGE_ENSURE_SORTED; } - virtual void appendToString(mongoutils::str::stream* ss, int indent) const; + virtual void appendToString(str::stream* ss, int indent) const; bool fetched() const { return children[0]->fetched(); diff --git a/src/mongo/db/query/query_solution_test.cpp b/src/mongo/db/query/query_solution_test.cpp index 1fcfe1c8bd8..7ac47cb2aad 100644 --- a/src/mongo/db/query/query_solution_test.cpp +++ b/src/mongo/db/query/query_solution_test.cpp @@ -726,10 +726,9 @@ auto createMatchExprAndParsedProjection(const BSONObj& query, const BSONObj& pro Status status = ParsedProjection::make(opCtx.get(), projObj, queryMatchExpr.getValue().get(), &out); if (!status.isOK()) { - FAIL(mongoutils::str::stream() << "failed to parse projection " << projObj << " (query: " - << query - << "): " - << status.toString()); + FAIL(str::stream() << "failed to parse projection " << projObj << " (query: " << query + << "): " + << status.toString()); } ASSERT(out); return std::make_pair(std::move(queryMatchExpr.getValue()), diff --git a/src/mongo/db/query/stage_builder.cpp b/src/mongo/db/query/stage_builder.cpp index 24b74ad206d..012efb8a262 100644 --- a/src/mongo/db/query/stage_builder.cpp +++ b/src/mongo/db/query/stage_builder.cpp @@ -389,7 +389,7 @@ PlanStage* buildStages(OperationContext* opCtx, case STAGE_TRIAL: case STAGE_UNKNOWN: case STAGE_UPDATE: { - mongoutils::str::stream ss; + str::stream ss; root->appendToString(&ss, 0); string nodeStr(ss); warning() << "Can't build exec tree for node " << nodeStr << endl; diff --git a/src/mongo/db/repl/abstract_async_component.cpp b/src/mongo/db/repl/abstract_async_component.cpp index 22a6cd9eeaa..181f2f5ef69 100644 --- a/src/mongo/db/repl/abstract_async_component.cpp +++ b/src/mongo/db/repl/abstract_async_component.cpp @@ -32,7 +32,7 @@ #include "mongo/db/repl/abstract_async_component.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/base_cloner_test_fixture.cpp b/src/mongo/db/repl/base_cloner_test_fixture.cpp index d7b99a555f9..359f6a2c4a2 100644 --- a/src/mongo/db/repl/base_cloner_test_fixture.cpp +++ b/src/mongo/db/repl/base_cloner_test_fixture.cpp @@ -35,7 +35,7 @@ #include "mongo/db/jsobj.h" #include "mongo/stdx/thread.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index 71f17f41b4e..28c50c11e82 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -59,7 +59,7 @@ #include "mongo/rpc/metadata/repl_set_metadata.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/repl/check_quorum_for_config_change.cpp b/src/mongo/db/repl/check_quorum_for_config_change.cpp index 6beca6bb321..ec0ea421550 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change.cpp +++ b/src/mongo/db/repl/check_quorum_for_config_change.cpp @@ -42,7 +42,7 @@ #include "mongo/db/server_options.h" #include "mongo/rpc/metadata/repl_set_metadata.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/collection_bulk_loader_impl.cpp b/src/mongo/db/repl/collection_bulk_loader_impl.cpp index e554c91e309..6acaeaffbe5 100644 --- a/src/mongo/db/repl/collection_bulk_loader_impl.cpp +++ b/src/mongo/db/repl/collection_bulk_loader_impl.cpp @@ -46,8 +46,8 @@ #include "mongo/db/repl/collection_bulk_loader_impl.h" #include "mongo/util/destructor_guard.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/collection_cloner.cpp b/src/mongo/db/repl/collection_cloner.cpp index ac0cfb22647..4ed16cd31e3 100644 --- a/src/mongo/db/repl/collection_cloner.cpp +++ b/src/mongo/db/repl/collection_cloner.cpp @@ -51,7 +51,7 @@ #include "mongo/util/destructor_guard.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/collection_cloner_test.cpp b/src/mongo/db/repl/collection_cloner_test.cpp index 4cb8147c75d..20c4eb00ae3 100644 --- a/src/mongo/db/repl/collection_cloner_test.cpp +++ b/src/mongo/db/repl/collection_cloner_test.cpp @@ -42,7 +42,7 @@ #include "mongo/stdx/memory.h" #include "mongo/unittest/task_executor_proxy.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/repl/database_cloner.cpp b/src/mongo/db/repl/database_cloner.cpp index 3b29095c8fd..267428f3831 100644 --- a/src/mongo/db/repl/database_cloner.cpp +++ b/src/mongo/db/repl/database_cloner.cpp @@ -47,7 +47,7 @@ #include "mongo/util/destructor_guard.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/database_cloner_test.cpp b/src/mongo/db/repl/database_cloner_test.cpp index e9f3a6fee90..66948a482ef 100644 --- a/src/mongo/db/repl/database_cloner_test.cpp +++ b/src/mongo/db/repl/database_cloner_test.cpp @@ -42,7 +42,7 @@ #include "mongo/dbtests/mock/mock_dbclient_connection.h" #include "mongo/unittest/task_executor_proxy.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/uuid.h" namespace { diff --git a/src/mongo/db/repl/databases_cloner.cpp b/src/mongo/db/repl/databases_cloner.cpp index b95c683a93e..9639734e645 100644 --- a/src/mongo/db/repl/databases_cloner.cpp +++ b/src/mongo/db/repl/databases_cloner.cpp @@ -47,7 +47,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/databases_cloner_test.cpp b/src/mongo/db/repl/databases_cloner_test.cpp index f381077c4ab..c13154b179a 100644 --- a/src/mongo/db/repl/databases_cloner_test.cpp +++ b/src/mongo/db/repl/databases_cloner_test.cpp @@ -48,8 +48,8 @@ #include "mongo/unittest/unittest.h" #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/concurrency/thread_pool.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace { using namespace mongo; diff --git a/src/mongo/db/repl/drop_pending_collection_reaper_test.cpp b/src/mongo/db/repl/drop_pending_collection_reaper_test.cpp index 626cf172120..4a3b2ffdc55 100644 --- a/src/mongo/db/repl/drop_pending_collection_reaper_test.cpp +++ b/src/mongo/db/repl/drop_pending_collection_reaper_test.cpp @@ -45,7 +45,7 @@ #include "mongo/db/service_context_d_test_fixture.h" #include "mongo/stdx/memory.h" #include "mongo/unittest/death_test.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp index b41a20510c6..9bfdfbd13cd 100644 --- a/src/mongo/db/repl/initial_syncer.cpp +++ b/src/mongo/db/repl/initial_syncer.cpp @@ -67,8 +67,8 @@ #include "mongo/util/destructor_guard.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" #include "mongo/util/timer.h" diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp index 2a30780c6e0..ac82555ff60 100644 --- a/src/mongo/db/repl/initial_syncer_test.cpp +++ b/src/mongo/db/repl/initial_syncer_test.cpp @@ -64,8 +64,8 @@ #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/concurrency/thread_pool.h" #include "mongo/util/fail_point_service.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" #include "mongo/unittest/barrier.h" #include "mongo/unittest/unittest.h" diff --git a/src/mongo/db/repl/is_master_response.cpp b/src/mongo/db/repl/is_master_response.cpp index c2c3fb83e38..e160054208b 100644 --- a/src/mongo/db/repl/is_master_response.cpp +++ b/src/mongo/db/repl/is_master_response.cpp @@ -37,7 +37,7 @@ #include "mongo/bson/oid.h" #include "mongo/bson/util/bson_extract.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/member_config.cpp b/src/mongo/db/repl/member_config.cpp index 0221ece932b..29907879a2e 100644 --- a/src/mongo/db/repl/member_config.cpp +++ b/src/mongo/db/repl/member_config.cpp @@ -36,7 +36,7 @@ #include "mongo/bson/util/bson_check.h" #include "mongo/bson/util/bson_extract.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/member_state.h b/src/mongo/db/repl/member_state.h index c5af9992498..bc954a4dc35 100644 --- a/src/mongo/db/repl/member_state.h +++ b/src/mongo/db/repl/member_state.h @@ -38,7 +38,7 @@ #include "mongo/base/error_codes.h" #include "mongo/base/static_assert.h" #include "mongo/base/status_with.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index 129f7ab16db..4f84da29db7 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -96,8 +96,8 @@ #include "mongo/util/fail_point_service.h" #include "mongo/util/file.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/startup_test.h" +#include "mongo/util/str.h" namespace mongo { @@ -1993,8 +1993,8 @@ Status applyCommand_inlock(OperationContext* opCtx, auto op = kOpsMap.find(o.firstElementFieldName()); if (op == kOpsMap.end()) { return Status(ErrorCodes::BadValue, - mongoutils::str::stream() << "Invalid key '" << o.firstElementFieldName() - << "' found in field 'o'"); + str::stream() << "Invalid key '" << o.firstElementFieldName() + << "' found in field 'o'"); } const ApplyOpMetadata& curOpToApply = op->second; diff --git a/src/mongo/db/repl/oplog_interface_local.cpp b/src/mongo/db/repl/oplog_interface_local.cpp index a7174be8304..4a0ec3a9551 100644 --- a/src/mongo/db/repl/oplog_interface_local.cpp +++ b/src/mongo/db/repl/oplog_interface_local.cpp @@ -35,8 +35,8 @@ #include "mongo/db/namespace_string.h" #include "mongo/db/query/internal_plans.h" #include "mongo/db/query/plan_executor.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/socket_utils.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/oplog_interface_remote.cpp b/src/mongo/db/repl/oplog_interface_remote.cpp index 8cb0d84c49d..4c0332cdfa6 100644 --- a/src/mongo/db/repl/oplog_interface_remote.cpp +++ b/src/mongo/db/repl/oplog_interface_remote.cpp @@ -34,7 +34,7 @@ #include "mongo/client/dbclient_base.h" #include "mongo/client/dbclient_cursor.h" #include "mongo/db/jsobj.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/optime_with.h b/src/mongo/db/repl/optime_with.h index 5174bbc3367..d0d990aafd1 100644 --- a/src/mongo/db/repl/optime_with.h +++ b/src/mongo/db/repl/optime_with.h @@ -33,7 +33,7 @@ #include <string> #include "mongo/db/repl/optime.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/read_concern_args.cpp b/src/mongo/db/repl/read_concern_args.cpp index be12bb924b9..89545a0fb4a 100644 --- a/src/mongo/db/repl/read_concern_args.cpp +++ b/src/mongo/db/repl/read_concern_args.cpp @@ -38,7 +38,7 @@ #include "mongo/db/logical_time.h" #include "mongo/db/operation_context.h" #include "mongo/db/repl/bson_extract_optime.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" using std::string; diff --git a/src/mongo/db/repl/repl_set_config_checks.cpp b/src/mongo/db/repl/repl_set_config_checks.cpp index e4fb98fccf4..14cc8e99e61 100644 --- a/src/mongo/db/repl/repl_set_config_checks.cpp +++ b/src/mongo/db/repl/repl_set_config_checks.cpp @@ -36,7 +36,7 @@ #include "mongo/db/repl/repl_set_config.h" #include "mongo/db/repl/replication_coordinator_external_state.h" #include "mongo/db/service_context.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/repl_set_heartbeat_response.cpp b/src/mongo/db/repl/repl_set_heartbeat_response.cpp index 53d40c5f511..a312970aad3 100644 --- a/src/mongo/db/repl/repl_set_heartbeat_response.cpp +++ b/src/mongo/db/repl/repl_set_heartbeat_response.cpp @@ -42,7 +42,7 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/repl_set_tag.cpp b/src/mongo/db/repl/repl_set_tag.cpp index d2af5fb297d..8068b46e783 100644 --- a/src/mongo/db/repl/repl_set_tag.cpp +++ b/src/mongo/db/repl/repl_set_tag.cpp @@ -36,8 +36,8 @@ #include "mongo/base/string_data.h" #include "mongo/db/jsobj.h" #include "mongo/stdx/functional.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/sequence_util.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/replication_consistency_markers_impl_test.cpp b/src/mongo/db/repl/replication_consistency_markers_impl_test.cpp index ba4ee828fa8..1a14281b863 100644 --- a/src/mongo/db/repl/replication_consistency_markers_impl_test.cpp +++ b/src/mongo/db/repl/replication_consistency_markers_impl_test.cpp @@ -46,7 +46,7 @@ #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index 2811ec062ca..0fedfec9401 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -102,9 +102,9 @@ #include "mongo/util/exit.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp index 2deed387dc0..bb330cdb9a7 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp @@ -60,7 +60,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/repl/replication_process.cpp b/src/mongo/db/repl/replication_process.cpp index efd4f432b03..d3e77314cd3 100644 --- a/src/mongo/db/repl/replication_process.cpp +++ b/src/mongo/db/repl/replication_process.cpp @@ -43,7 +43,7 @@ #include "mongo/db/service_context.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/replication_recovery_test.cpp b/src/mongo/db/repl/replication_recovery_test.cpp index c2b01b1e55f..48729331783 100644 --- a/src/mongo/db/repl/replication_recovery_test.cpp +++ b/src/mongo/db/repl/replication_recovery_test.cpp @@ -49,7 +49,7 @@ #include "mongo/unittest/death_test.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/repl/roll_back_local_operations.cpp b/src/mongo/db/repl/roll_back_local_operations.cpp index bee6afa549e..9b516691b08 100644 --- a/src/mongo/db/repl/roll_back_local_operations.cpp +++ b/src/mongo/db/repl/roll_back_local_operations.cpp @@ -35,7 +35,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/rollback_source_impl.cpp b/src/mongo/db/repl/rollback_source_impl.cpp index 06651aa5c4f..2170ee1663d 100644 --- a/src/mongo/db/repl/rollback_source_impl.cpp +++ b/src/mongo/db/repl/rollback_source_impl.cpp @@ -36,7 +36,7 @@ #include "mongo/db/namespace_string.h" #include "mongo/db/repl/oplogreader.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/rollback_test_fixture.cpp b/src/mongo/db/repl/rollback_test_fixture.cpp index d07e4b238a4..d16e02bf290 100644 --- a/src/mongo/db/repl/rollback_test_fixture.cpp +++ b/src/mongo/db/repl/rollback_test_fixture.cpp @@ -49,7 +49,7 @@ #include "mongo/logger/log_component.h" #include "mongo/logger/logger.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/storage_interface.cpp b/src/mongo/db/repl/storage_interface.cpp index d23d034df46..f7d4efb4354 100644 --- a/src/mongo/db/repl/storage_interface.cpp +++ b/src/mongo/db/repl/storage_interface.cpp @@ -33,7 +33,7 @@ #include "mongo/db/operation_context.h" #include "mongo/db/repl/storage_interface.h" #include "mongo/db/service_context.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp index da758476930..49520e65937 100644 --- a/src/mongo/db/repl/storage_interface_impl.cpp +++ b/src/mongo/db/repl/storage_interface_impl.cpp @@ -76,7 +76,7 @@ #include "mongo/db/service_context.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/storage_interface_impl_test.cpp b/src/mongo/db/repl/storage_interface_impl_test.cpp index cfeaad4c945..661edb58c25 100644 --- a/src/mongo/db/repl/storage_interface_impl_test.cpp +++ b/src/mongo/db/repl/storage_interface_impl_test.cpp @@ -57,7 +57,7 @@ #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" #include "mongo/util/fail_point_service.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/repl/storage_interface_mock.cpp b/src/mongo/db/repl/storage_interface_mock.cpp index 7a78792ee16..d171032c575 100644 --- a/src/mongo/db/repl/storage_interface_mock.cpp +++ b/src/mongo/db/repl/storage_interface_mock.cpp @@ -35,7 +35,7 @@ #include "mongo/db/repl/storage_interface_mock.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/sync_source_resolver.cpp b/src/mongo/db/repl/sync_source_resolver.cpp index 072a06f58fe..adfcc7b2f31 100644 --- a/src/mongo/db/repl/sync_source_resolver.cpp +++ b/src/mongo/db/repl/sync_source_resolver.cpp @@ -42,7 +42,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index 37d270817ab..cf46630d6de 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -79,9 +79,9 @@ #include "mongo/util/exit.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/socket_exception.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/task_runner.cpp b/src/mongo/db/repl/task_runner.cpp index b4036617a57..a79cdfa7faa 100644 --- a/src/mongo/db/repl/task_runner.cpp +++ b/src/mongo/db/repl/task_runner.cpp @@ -44,7 +44,7 @@ #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/destructor_guard.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/topology_coordinator.cpp b/src/mongo/db/repl/topology_coordinator.cpp index 6f2f10b0ffe..191ba2c4da2 100644 --- a/src/mongo/db/repl/topology_coordinator.cpp +++ b/src/mongo/db/repl/topology_coordinator.cpp @@ -61,8 +61,8 @@ #include "mongo/util/fail_point_service.h" #include "mongo/util/hex.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/vote_requester_test.cpp b/src/mongo/db/repl/vote_requester_test.cpp index 07c6ccfacf7..ab8525d026b 100644 --- a/src/mongo/db/repl/vote_requester_test.cpp +++ b/src/mongo/db/repl/vote_requester_test.cpp @@ -40,7 +40,7 @@ #include "mongo/executor/remote_command_response.h" #include "mongo/stdx/functional.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/s/balancer/balancer_chunk_selection_policy.cpp b/src/mongo/db/s/balancer/balancer_chunk_selection_policy.cpp index 8684dc87c37..72b39356c8d 100644 --- a/src/mongo/db/s/balancer/balancer_chunk_selection_policy.cpp +++ b/src/mongo/db/s/balancer/balancer_chunk_selection_policy.cpp @@ -31,7 +31,7 @@ #include "mongo/db/s/balancer/balancer_chunk_selection_policy.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp index 93fdf758f9c..3162ca40daf 100644 --- a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp +++ b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp @@ -45,7 +45,7 @@ #include "mongo/s/grid.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/s/balancer/cluster_statistics_impl.cpp b/src/mongo/db/s/balancer/cluster_statistics_impl.cpp index e8fb4eff996..9fd3ebf675d 100644 --- a/src/mongo/db/s/balancer/cluster_statistics_impl.cpp +++ b/src/mongo/db/s/balancer/cluster_statistics_impl.cpp @@ -43,7 +43,7 @@ #include "mongo/s/grid.h" #include "mongo/s/shard_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/collection_metadata.cpp b/src/mongo/db/s/collection_metadata.cpp index a60729473c5..112499944af 100644 --- a/src/mongo/db/s/collection_metadata.cpp +++ b/src/mongo/db/s/collection_metadata.cpp @@ -39,7 +39,7 @@ #include "mongo/s/catalog/type_chunk.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/s/collection_range_deleter.cpp b/src/mongo/db/s/collection_range_deleter.cpp index 06b73a37e8b..f8cb571a14f 100644 --- a/src/mongo/db/s/collection_range_deleter.cpp +++ b/src/mongo/db/s/collection_range_deleter.cpp @@ -60,8 +60,8 @@ #include "mongo/db/write_concern.h" #include "mongo/executor/task_executor.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/s/config/configsvr_add_shard_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_command.cpp index 31bcc1abfb7..fcbb9006222 100644 --- a/src/mongo/db/s/config/configsvr_add_shard_command.cpp +++ b/src/mongo/db/s/config/configsvr_add_shard_command.cpp @@ -46,7 +46,7 @@ #include "mongo/s/grid.h" #include "mongo/s/request_types/add_shard_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp index 24a499dba8d..6b6974b082f 100644 --- a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp +++ b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp @@ -41,7 +41,7 @@ #include "mongo/s/grid.h" #include "mongo/s/request_types/add_shard_to_zone_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp index 2b0ff8900f0..6d20630c201 100644 --- a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp +++ b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp @@ -38,7 +38,7 @@ #include "mongo/db/s/balancer/balancer.h" #include "mongo/s/balancer_configuration.h" #include "mongo/s/grid.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp index c4cfdaf193c..e9ad4d92564 100644 --- a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp @@ -42,7 +42,7 @@ #include "mongo/s/grid.h" #include "mongo/s/request_types/merge_chunk_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp index 6f4542a5027..9ed7f4f292d 100644 --- a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp @@ -41,7 +41,7 @@ #include "mongo/db/s/balancer/balancer.h" #include "mongo/s/request_types/balance_chunk_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp index a782953987d..2f3fb559fe2 100644 --- a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp +++ b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp @@ -41,7 +41,7 @@ #include "mongo/s/grid.h" #include "mongo/s/request_types/remove_shard_from_zone_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp index 30824550e1e..3cdb4d2e5d3 100644 --- a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp +++ b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp @@ -60,8 +60,8 @@ #include "mongo/s/request_types/shard_collection_gen.h" #include "mongo/s/shard_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp index 049f0de1e6e..5451137ad59 100644 --- a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp @@ -42,7 +42,7 @@ #include "mongo/s/grid.h" #include "mongo/s/request_types/split_chunk_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp index 33b74ceb62e..02d82cafa52 100644 --- a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp +++ b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp @@ -41,7 +41,7 @@ #include "mongo/s/grid.h" #include "mongo/s/request_types/update_zone_key_range_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp index cc232240444..338507de042 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp @@ -52,7 +52,7 @@ #include "mongo/s/shard_key_pattern.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp index 80b3e27e896..ddc0b54f29a 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp @@ -69,8 +69,8 @@ #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp index 419bb15dc82..8e6e2e29423 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp @@ -76,8 +76,8 @@ #include "mongo/s/write_ops/batched_command_response.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/merge_chunks_command.cpp b/src/mongo/db/s/merge_chunks_command.cpp index 4aa84b0b877..0a808e8daac 100644 --- a/src/mongo/db/s/merge_chunks_command.cpp +++ b/src/mongo/db/s/merge_chunks_command.cpp @@ -47,7 +47,7 @@ #include "mongo/s/grid.h" #include "mongo/s/request_types/merge_chunk_request_type.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp index bd599fc74b1..3ad2f76461c 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp @@ -55,8 +55,8 @@ #include "mongo/s/grid.h" #include "mongo/util/elapsed_tracker.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp index 5113d76d537..3b0501316a5 100644 --- a/src/mongo/db/s/migration_destination_manager.cpp +++ b/src/mongo/db/s/migration_destination_manager.cpp @@ -65,9 +65,9 @@ #include "mongo/util/concurrency/notification.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/producer_consumer_queue.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/migration_session_id.cpp b/src/mongo/db/s/migration_session_id.cpp index da08b89b6b1..d2cfeab3254 100644 --- a/src/mongo/db/s/migration_session_id.cpp +++ b/src/mongo/db/s/migration_session_id.cpp @@ -35,7 +35,7 @@ #include "mongo/bson/bsonobjbuilder.h" #include "mongo/bson/oid.h" #include "mongo/bson/util/bson_extract.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/s/session_catalog_migration_source.cpp b/src/mongo/db/s/session_catalog_migration_source.cpp index c60b596d123..e93a756dc07 100644 --- a/src/mongo/db/s/session_catalog_migration_source.cpp +++ b/src/mongo/db/s/session_catalog_migration_source.cpp @@ -46,7 +46,7 @@ #include "mongo/platform/random.h" #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/sharding_logging_test.cpp b/src/mongo/db/s/sharding_logging_test.cpp index 3ac6ed54135..6d2fa80994e 100644 --- a/src/mongo/db/s/sharding_logging_test.cpp +++ b/src/mongo/db/s/sharding_logging_test.cpp @@ -44,7 +44,7 @@ #include "mongo/stdx/chrono.h" #include "mongo/stdx/future.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/text.h" namespace mongo { diff --git a/src/mongo/db/s/shardsvr_shard_collection.cpp b/src/mongo/db/s/shardsvr_shard_collection.cpp index bfb106786f3..48b48dc7532 100644 --- a/src/mongo/db/s/shardsvr_shard_collection.cpp +++ b/src/mongo/db/s/shardsvr_shard_collection.cpp @@ -63,8 +63,8 @@ #include "mongo/s/request_types/shard_collection_gen.h" #include "mongo/s/shard_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/s/split_chunk_command.cpp b/src/mongo/db/s/split_chunk_command.cpp index 99d4a9f417f..4ddc478c405 100644 --- a/src/mongo/db/s/split_chunk_command.cpp +++ b/src/mongo/db/s/split_chunk_command.cpp @@ -44,7 +44,7 @@ #include "mongo/db/s/split_chunk.h" #include "mongo/s/catalog/type_chunk.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp index eb962a21b8c..4a9e1a3acef 100644 --- a/src/mongo/db/server_options_helpers.cpp +++ b/src/mongo/db/server_options_helpers.cpp @@ -53,11 +53,11 @@ #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" #include "mongo/util/map_util.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/sock.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/net/ssl_options.h" #include "mongo/util/options_parser/startup_options.h" +#include "mongo/util/str.h" using std::endl; using std::string; diff --git a/src/mongo/db/server_options_server_helpers.cpp b/src/mongo/db/server_options_server_helpers.cpp index 02bfa0b981a..0dfe6e1f78a 100644 --- a/src/mongo/db/server_options_server_helpers.cpp +++ b/src/mongo/db/server_options_server_helpers.cpp @@ -53,12 +53,12 @@ #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" #include "mongo/util/map_util.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/net/sock.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/net/ssl_options.h" #include "mongo/util/options_parser/options_parser.h" #include "mongo/util/options_parser/startup_options.h" +#include "mongo/util/str.h" using std::endl; using std::string; diff --git a/src/mongo/db/service_context.cpp b/src/mongo/db/service_context.cpp index bd24819b416..e83d983ca50 100644 --- a/src/mongo/db/service_context.cpp +++ b/src/mongo/db/service_context.cpp @@ -48,7 +48,7 @@ #include "mongo/transport/transport_layer.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/system_clock_source.h" #include "mongo/util/system_tick_source.h" diff --git a/src/mongo/db/signed_logical_time.cpp b/src/mongo/db/signed_logical_time.cpp index 7a6e4e7a999..be984f41145 100644 --- a/src/mongo/db/signed_logical_time.cpp +++ b/src/mongo/db/signed_logical_time.cpp @@ -29,7 +29,7 @@ #include "mongo/db/signed_logical_time.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index 7eedd1ce35a..4efa4a79840 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -64,7 +64,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/bufreader.h" #include "mongo/util/destructor_guard.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/unowned_ptr.h" namespace mongo { @@ -72,7 +72,6 @@ namespace mongo { namespace sorter { using std::shared_ptr; -using namespace mongoutils; // We need to use the "real" errno everywhere, not GetLastError() on Windows inline std::string myErrnoWithDescription() { @@ -904,7 +903,6 @@ SortedFileWriter<Key, Value>::SortedFileWriter(const SortOptions& opts, const std::streampos fileStartOffset, const Settings& settings) : _settings(settings) { - namespace str = mongoutils::str; // This should be checked by consumers, but if we get here don't allow writes. uassert( @@ -946,8 +944,6 @@ void SortedFileWriter<Key, Value>::addAlreadySorted(const Key& key, const Value& template <typename Key, typename Value> void SortedFileWriter<Key, Value>::spill() { - namespace str = mongoutils::str; - int32_t size = _buffer.len(); char* outBuffer = _buffer.buf(); diff --git a/src/mongo/db/sorter/sorter_test.cpp b/src/mongo/db/sorter/sorter_test.cpp index 61af0e368e9..18fcf91f0b1 100644 --- a/src/mongo/db/sorter/sorter_test.cpp +++ b/src/mongo/db/sorter/sorter_test.cpp @@ -42,7 +42,7 @@ #include "mongo/stdx/thread.h" #include "mongo/unittest/temp_dir.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include <memory> diff --git a/src/mongo/db/startup_warnings_mongod.cpp b/src/mongo/db/startup_warnings_mongod.cpp index e3fa7349748..470fc90388e 100644 --- a/src/mongo/db/startup_warnings_mongod.cpp +++ b/src/mongo/db/startup_warnings_mongod.cpp @@ -44,8 +44,8 @@ #include "mongo/db/startup_warnings_common.h" #include "mongo/db/storage/storage_options.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/processinfo.h" +#include "mongo/util/str.h" #include "mongo/util/version.h" namespace mongo { diff --git a/src/mongo/db/storage/biggie/biggie_sorted_impl.cpp b/src/mongo/db/storage/biggie/biggie_sorted_impl.cpp index 845e428e355..c000336928d 100644 --- a/src/mongo/db/storage/biggie/biggie_sorted_impl.cpp +++ b/src/mongo/db/storage/biggie/biggie_sorted_impl.cpp @@ -47,8 +47,8 @@ #include "mongo/stdx/memory.h" #include "mongo/util/bufreader.h" #include "mongo/util/hex.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/shared_buffer.h" +#include "mongo/util/str.h" namespace mongo { namespace biggie { diff --git a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_btree_impl.cpp b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_btree_impl.cpp index 13b26e66f37..fef05e67b96 100644 --- a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_btree_impl.cpp +++ b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_btree_impl.cpp @@ -37,7 +37,7 @@ #include "mongo/db/storage/ephemeral_for_test/ephemeral_for_test_recovery_unit.h" #include "mongo/db/storage/index_entry_comparison.h" #include "mongo/stdx/memory.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp index ed39c18f5ee..3ce3af87357 100644 --- a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp +++ b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp @@ -38,7 +38,7 @@ #include "mongo/db/storage/recovery_unit.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/unowned_ptr.h" namespace mongo { diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp index ced31ab93ac..8d8e5f70e03 100644 --- a/src/mongo/db/storage/kv/kv_catalog.cpp +++ b/src/mongo/db/storage/kv/kv_catalog.cpp @@ -45,7 +45,7 @@ #include "mongo/platform/random.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp b/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp index 9cf27243c78..aac41f173c2 100644 --- a/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp +++ b/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp @@ -46,7 +46,7 @@ #include "mongo/db/storage/kv/kv_storage_engine.h" #include "mongo/unittest/death_test.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/storage/kv/kv_storage_engine.cpp b/src/mongo/db/storage/kv/kv_storage_engine.cpp index 64486ba431f..2719c02a899 100644 --- a/src/mongo/db/storage/kv/kv_storage_engine.cpp +++ b/src/mongo/db/storage/kv/kv_storage_engine.cpp @@ -49,8 +49,8 @@ #include "mongo/db/unclean_shutdown.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/kv/temporary_kv_record_store.cpp b/src/mongo/db/storage/kv/temporary_kv_record_store.cpp index c752e9fca05..ff4e19864cf 100644 --- a/src/mongo/db/storage/kv/temporary_kv_record_store.cpp +++ b/src/mongo/db/storage/kv/temporary_kv_record_store.cpp @@ -35,7 +35,7 @@ #include "mongo/db/storage/kv/kv_engine.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/mobile/mobile_record_store.cpp b/src/mongo/db/storage/mobile/mobile_record_store.cpp index c40c915a90a..a28d26dcb3d 100644 --- a/src/mongo/db/storage/mobile/mobile_record_store.cpp +++ b/src/mongo/db/storage/mobile/mobile_record_store.cpp @@ -49,7 +49,7 @@ #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/mobile/mobile_util.cpp b/src/mongo/db/storage/mobile/mobile_util.cpp index 8e01f04d111..3af03c7ca65 100644 --- a/src/mongo/db/storage/mobile/mobile_util.cpp +++ b/src/mongo/db/storage/mobile/mobile_util.cpp @@ -30,7 +30,7 @@ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include <sqlite3.h> diff --git a/src/mongo/db/storage/storage_engine.h b/src/mongo/db/storage/storage_engine.h index 74f6687976c..94134ba0a26 100644 --- a/src/mongo/db/storage/storage_engine.h +++ b/src/mongo/db/storage/storage_engine.h @@ -37,7 +37,7 @@ #include "mongo/bson/timestamp.h" #include "mongo/db/storage/temporary_record_store.h" #include "mongo/util/functional.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/storage_engine_init.cpp b/src/mongo/db/storage/storage_engine_init.cpp index 9914110c044..fd7701b8c8d 100644 --- a/src/mongo/db/storage/storage_engine_init.cpp +++ b/src/mongo/db/storage/storage_engine_init.cpp @@ -47,7 +47,7 @@ #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp index 19dd4b6fb73..1d0d5868cf7 100644 --- a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp +++ b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp @@ -44,7 +44,7 @@ #include "mongo/platform/process_id.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/storage_engine_lock_file_windows.cpp b/src/mongo/db/storage/storage_engine_lock_file_windows.cpp index 8d2326c2e86..64d79c00ce7 100644 --- a/src/mongo/db/storage/storage_engine_lock_file_windows.cpp +++ b/src/mongo/db/storage/storage_engine_lock_file_windows.cpp @@ -40,7 +40,7 @@ #include "mongo/platform/process_id.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/text.h" namespace mongo { diff --git a/src/mongo/db/storage/storage_engine_metadata.cpp b/src/mongo/db/storage/storage_engine_metadata.cpp index d48eb365625..62fecc4c102 100644 --- a/src/mongo/db/storage/storage_engine_metadata.cpp +++ b/src/mongo/db/storage/storage_engine_metadata.cpp @@ -55,7 +55,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/file.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/storage_options.cpp b/src/mongo/db/storage/storage_options.cpp index 12d142ad2f2..5cc702e1302 100644 --- a/src/mongo/db/storage/storage_options.cpp +++ b/src/mongo/db/storage/storage_options.cpp @@ -32,7 +32,7 @@ #include "mongo/db/storage/storage_options.h" #include "mongo/platform/compiler.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp index 8d2804fba71..d42ee175913 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp @@ -55,7 +55,7 @@ #include "mongo/util/fail_point.h" #include "mongo/util/hex.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #define TRACING_ENABLED 0 diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_init_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_init_test.cpp index 99b0dac24b5..b84d3e812b1 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_init_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_init_test.cpp @@ -39,7 +39,7 @@ #include "mongo/db/storage/wiredtiger/wiredtiger_global_options.h" #include "mongo/db/storage/wiredtiger/wiredtiger_record_store.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp index 0202a663454..c5ebea88b34 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp @@ -33,7 +33,7 @@ #include "mongo/db/storage/wiredtiger/wiredtiger_parameters_gen.h" #include "mongo/logger/parse_log_component_settings.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { @@ -61,10 +61,8 @@ Status WiredTigerEngineRuntimeConfigParameter::setFromString(const std::string& int ret = _data.second->reconfigure(str.c_str()); if (ret != 0) { string result = - (mongoutils::str::stream() << "WiredTiger reconfiguration failed with error code (" - << ret - << "): " - << wiredtiger_strerror(ret)); + (str::stream() << "WiredTiger reconfiguration failed with error code (" << ret << "): " + << wiredtiger_strerror(ret)); error() << result; return Status(ErrorCodes::BadValue, result); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp index 8fa398b4fb0..d04b8e4df0c 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -61,8 +61,8 @@ #include "mongo/util/concurrency/idle_thread_block.h" #include "mongo/util/fail_point.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" #include "mongo/util/time_support.h" #include "mongo/util/timer.h" diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp index d64f654f8e4..01f5a34480c 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp @@ -44,9 +44,9 @@ #include "mongo/db/storage/wiredtiger/wiredtiger_session_cache.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/processinfo.h" #include "mongo/util/scopeguard.h" +#include "mongo/util/str.h" namespace mongo { @@ -649,7 +649,7 @@ Status WiredTigerUtil::exportTableToBSON(WT_SESSION* session, BSONObjBuilder*& sub = subs[prefix.toString()]; if (!sub) sub = new BSONObjBuilder(); - sub->appendNumber(mongoutils::str::ltrim(suffix.toString()), v); + sub->appendNumber(str::ltrim(suffix.toString()), v); } } diff --git a/src/mongo/db/traffic_recorder.cpp b/src/mongo/db/traffic_recorder.cpp index 320f1f2b6ff..17f4756cce9 100644 --- a/src/mongo/db/traffic_recorder.cpp +++ b/src/mongo/db/traffic_recorder.cpp @@ -43,8 +43,8 @@ #include "mongo/db/service_context.h" #include "mongo/rpc/factory.h" #include "mongo/stdx/thread.h" -#include "mongo/util/mongoutils/str.h" #include "mongo/util/producer_consumer_queue.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/traffic_recorder_validators.cpp b/src/mongo/db/traffic_recorder_validators.cpp index a96e489f45c..918784563d2 100644 --- a/src/mongo/db/traffic_recorder_validators.cpp +++ b/src/mongo/db/traffic_recorder_validators.cpp @@ -31,7 +31,7 @@ #include <boost/filesystem/operations.hpp> -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/transaction_history_iterator.cpp b/src/mongo/db/transaction_history_iterator.cpp index 5de036272f0..5358e3ab6c9 100644 --- a/src/mongo/db/transaction_history_iterator.cpp +++ b/src/mongo/db/transaction_history_iterator.cpp @@ -38,7 +38,7 @@ #include "mongo/db/repl/oplog_entry.h" #include "mongo/db/transaction_history_iterator.h" #include "mongo/logger/redaction.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/transaction_participant.h b/src/mongo/db/transaction_participant.h index 0c16db50160..1e91e4e5744 100644 --- a/src/mongo/db/transaction_participant.h +++ b/src/mongo/db/transaction_participant.h @@ -53,7 +53,7 @@ #include "mongo/stdx/unordered_map.h" #include "mongo/util/assert_util.h" #include "mongo/util/concurrency/with_lock.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/transaction_participant_test.cpp b/src/mongo/db/transaction_participant_test.cpp index 33c6c3b8788..8828b002e5b 100644 --- a/src/mongo/db/transaction_participant_test.cpp +++ b/src/mongo/db/transaction_participant_test.cpp @@ -3627,8 +3627,7 @@ TEST_F(TxnParticipantTest, OldestActiveTransactionTimestamp) { return; } } - FAIL(mongoutils::str::stream() << "No prepared transaction with start timestamp (1, " << i - << ")"); + FAIL(str::stream() << "No prepared transaction with start timestamp (1, " << i << ")"); }; auto oldestActiveTransactionTS = [&]() { diff --git a/src/mongo/db/update/field_checker.cpp b/src/mongo/db/update/field_checker.cpp index 4f339550fcd..a915da0a6ab 100644 --- a/src/mongo/db/update/field_checker.cpp +++ b/src/mongo/db/update/field_checker.cpp @@ -31,11 +31,11 @@ #include "mongo/base/error_codes.h" #include "mongo/db/field_ref.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { -using mongoutils::str::stream; +using str::stream; namespace fieldchecker { @@ -51,10 +51,8 @@ Status isUpdatable(const FieldRef& field) { if (part.empty()) { return Status(ErrorCodes::EmptyFieldName, - mongoutils::str::stream() - << "The update path '" - << field.dottedField() - << "' contains an empty field name, which is not allowed."); + str::stream() << "The update path '" << field.dottedField() + << "' contains an empty field name, which is not allowed."); } } diff --git a/src/mongo/db/update/log_builder.cpp b/src/mongo/db/update/log_builder.cpp index e760e28d860..e78cd295b1f 100644 --- a/src/mongo/db/update/log_builder.cpp +++ b/src/mongo/db/update/log_builder.cpp @@ -28,12 +28,11 @@ */ #include "mongo/db/update/log_builder.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { using mutablebson::Element; -namespace str = mongoutils::str; namespace { const char kSet[] = "$set"; diff --git a/src/mongo/db/update/path_support.cpp b/src/mongo/db/update/path_support.cpp index 93f4e5fe111..5b470c0dc94 100644 --- a/src/mongo/db/update/path_support.cpp +++ b/src/mongo/db/update/path_support.cpp @@ -34,14 +34,14 @@ #include "mongo/bson/mutable/document.h" #include "mongo/bson/mutable/element.h" #include "mongo/util/assert_util.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { namespace pathsupport { using std::string; -using mongoutils::str::stream; +using str::stream; namespace { @@ -54,9 +54,8 @@ Status maybePadTo(mutablebson::Element* elemArray, size_t sizeRequired) { if (toPad > kMaxPaddingAllowed) { return Status(ErrorCodes::CannotBackfillArray, - mongoutils::str::stream() << "can't backfill more than " - << kMaxPaddingAllowed - << " elements"); + str::stream() << "can't backfill more than " << kMaxPaddingAllowed + << " elements"); } for (size_t i = 0; i < toPad; i++) { @@ -129,12 +128,11 @@ Status findLongestPrefix(const FieldRef& prefix, *idxFound = i - 1; *elemFound = prev; return Status(ErrorCodes::PathNotViable, - mongoutils::str::stream() << "cannot use the part (" << prefix.getPart(i - 1) - << " of " - << prefix.dottedField() - << ") to traverse the element ({" - << curr.toString() - << "})"); + str::stream() << "cannot use the part (" << prefix.getPart(i - 1) << " of " + << prefix.dottedField() + << ") to traverse the element ({" + << curr.toString() + << "})"); } else if (curr.ok()) { *idxFound = i - 1; *elemFound = curr; diff --git a/src/mongo/db/update/path_support_test.cpp b/src/mongo/db/update/path_support_test.cpp index d848c63402e..78f721e558d 100644 --- a/src/mongo/db/update/path_support_test.cpp +++ b/src/mongo/db/update/path_support_test.cpp @@ -52,13 +52,13 @@ #include "mongo/db/pipeline/expression_context_for_test.h" #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace { using namespace mongo; using namespace pathsupport; -using mongoutils::str::stream; +using str::stream; using mutablebson::Element; using std::unique_ptr; using std::string; diff --git a/src/mongo/db/update/update_driver.cpp b/src/mongo/db/update/update_driver.cpp index b109fff0705..b071c6e141a 100644 --- a/src/mongo/db/update/update_driver.cpp +++ b/src/mongo/db/update/update_driver.cpp @@ -45,17 +45,11 @@ #include "mongo/db/update/path_support.h" #include "mongo/db/update/storage_validation.h" #include "mongo/util/embedded_builder.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" #include "mongo/util/stringutils.h" namespace mongo { -namespace str = mongoutils::str; -namespace mb = mongo::mutablebson; - -using std::unique_ptr; -using std::vector; - using pathsupport::EqualityMatches; namespace { @@ -211,7 +205,7 @@ Status UpdateDriver::populateDocumentWithQueryFields(OperationContext* opCtx, if (!statusWithCQ.isOK()) { return statusWithCQ.getStatus(); } - unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue()); + std::unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue()); return populateDocumentWithQueryFields(*cq, immutablePaths, doc); } diff --git a/src/mongo/db/update/update_driver_test.cpp b/src/mongo/db/update/update_driver_test.cpp index d76d5babddd..15e4eca2340 100644 --- a/src/mongo/db/update/update_driver_test.cpp +++ b/src/mongo/db/update/update_driver_test.cpp @@ -50,7 +50,7 @@ try { \ EXPRESSION; \ } catch (const AssertionException& e) { \ - ::mongoutils::str::stream err; \ + ::mongo::str::stream err; \ err << "Threw an exception incorrectly: " << e.toString(); \ ::mongo::unittest::TestAssertionFailure(__FILE__, __LINE__, err).stream(); \ } @@ -58,7 +58,7 @@ namespace mongo { namespace { -using mongoutils::str::stream; +using str::stream; using unittest::assertGet; TEST(Parse, Normal) { diff --git a/src/mongo/db/views/view_catalog_test.cpp b/src/mongo/db/views/view_catalog_test.cpp index 1c0e257779f..543b5edc323 100644 --- a/src/mongo/db/views/view_catalog_test.cpp +++ b/src/mongo/db/views/view_catalog_test.cpp @@ -53,7 +53,7 @@ #include "mongo/stdx/functional.h" #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { namespace { diff --git a/src/mongo/db/write_concern_options.cpp b/src/mongo/db/write_concern_options.cpp index 02348ba7ac6..055fa23a5ee 100644 --- a/src/mongo/db/write_concern_options.cpp +++ b/src/mongo/db/write_concern_options.cpp @@ -35,7 +35,7 @@ #include "mongo/base/string_data.h" #include "mongo/bson/util/bson_extract.h" #include "mongo/db/field_parser.h" -#include "mongo/util/mongoutils/str.h" +#include "mongo/util/str.h" namespace mongo { |