summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/base/data_range.cpp2
-rw-r--r--src/mongo/base/data_range.h2
-rw-r--r--src/mongo/base/data_range_cursor.cpp6
-rw-r--r--src/mongo/base/data_range_cursor.h2
-rw-r--r--src/mongo/base/data_type.cpp6
-rw-r--r--src/mongo/base/data_type_string_data.cpp2
-rw-r--r--src/mongo/base/data_type_terminated.cpp2
-rw-r--r--src/mongo/base/error_codes.tpl.cpp4
-rw-r--r--src/mongo/base/parse_number_test.cpp7
-rw-r--r--src/mongo/base/status.cpp4
-rw-r--r--src/mongo/base/status.h9
-rw-r--r--src/mongo/base/status_with.h3
-rw-r--r--src/mongo/base/validate_locale.cpp2
-rw-r--r--src/mongo/bson/bsonelement.cpp3
-rw-r--r--src/mongo/bson/bsonobj.cpp4
-rw-r--r--src/mongo/bson/json.cpp2
-rw-r--r--src/mongo/bson/mutable/algorithm.h4
-rw-r--r--src/mongo/bson/util/bson_check.h2
-rw-r--r--src/mongo/bson/util/bson_extract.cpp53
-rw-r--r--src/mongo/client/connection_string.cpp2
-rw-r--r--src/mongo/client/cyrus_sasl_client_session.cpp10
-rw-r--r--src/mongo/client/dbclient_base.h2
-rw-r--r--src/mongo/client/dbclient_connection.h2
-rw-r--r--src/mongo/client/fetcher.cpp2
-rw-r--r--src/mongo/client/mongo_uri.cpp2
-rw-r--r--src/mongo/client/mongo_uri_connect.cpp2
-rw-r--r--src/mongo/client/native_sasl_client_session.cpp7
-rw-r--r--src/mongo/client/query_spec.h2
-rw-r--r--src/mongo/client/read_preference.cpp2
-rw-r--r--src/mongo/client/remote_command_targeter_rs.cpp2
-rw-r--r--src/mongo/client/sasl_client_authenticate.cpp4
-rw-r--r--src/mongo/client/sasl_client_session.cpp2
-rw-r--r--src/mongo/client/sasl_scram_client_conversation.cpp8
-rw-r--r--src/mongo/client/sasl_sspi.cpp18
-rw-r--r--src/mongo/db/auth/action_set.cpp2
-rw-r--r--src/mongo/db/auth/authorization_manager.cpp2
-rw-r--r--src/mongo/db/auth/authorization_manager_impl.cpp28
-rw-r--r--src/mongo/db/auth/authorization_manager_test.cpp11
-rw-r--r--src/mongo/db/auth/authorization_session.cpp2
-rw-r--r--src/mongo/db/auth/authorization_session_impl.cpp4
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_d.cpp7
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_local.cpp30
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_mock.cpp11
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_s.cpp2
-rwxr-xr-xsrc/mongo/db/auth/generate_action_types.py6
-rw-r--r--src/mongo/db/auth/privilege_parser.cpp4
-rw-r--r--src/mongo/db/auth/role_graph.cpp108
-rw-r--r--src/mongo/db/auth/role_graph_test.cpp10
-rw-r--r--src/mongo/db/auth/role_graph_update.cpp19
-rw-r--r--src/mongo/db/auth/sasl_commands.cpp2
-rw-r--r--src/mongo/db/auth/sasl_mechanism_registry.cpp8
-rw-r--r--src/mongo/db/auth/sasl_options_init.cpp2
-rw-r--r--src/mongo/db/auth/sasl_plain_server_conversation.cpp2
-rw-r--r--src/mongo/db/auth/sasl_scram_server_conversation.cpp2
-rw-r--r--src/mongo/db/auth/security_file.cpp2
-rw-r--r--src/mongo/db/auth/user_document_parser.cpp6
-rw-r--r--src/mongo/db/auth/user_management_commands_parser.cpp16
-rw-r--r--src/mongo/db/background.cpp8
-rw-r--r--src/mongo/db/catalog/collection_options.cpp2
-rw-r--r--src/mongo/db/catalog/commit_quorum_options.cpp2
-rw-r--r--src/mongo/db/catalog/database_impl.cpp17
-rw-r--r--src/mongo/db/catalog/drop_database_test.cpp2
-rw-r--r--src/mongo/db/catalog/index_builds_manager.cpp2
-rw-r--r--src/mongo/db/catalog/index_catalog_impl.cpp5
-rw-r--r--src/mongo/db/catalog/index_key_validate.cpp9
-rw-r--r--src/mongo/db/catalog/rename_collection_test.cpp2
-rw-r--r--src/mongo/db/client.cpp2
-rw-r--r--src/mongo/db/cloner.cpp2
-rw-r--r--src/mongo/db/commands.cpp2
-rw-r--r--src/mongo/db/commands/explain_cmd.cpp2
-rw-r--r--src/mongo/db/commands/kill_op.cpp2
-rw-r--r--src/mongo/db/commands/kill_op_cmd_base.cpp2
-rw-r--r--src/mongo/db/commands/mr.cpp2
-rw-r--r--src/mongo/db/commands/mr_common.cpp7
-rw-r--r--src/mongo/db/commands/parameters.cpp19
-rw-r--r--src/mongo/db/commands/plan_cache_commands_test.cpp2
-rw-r--r--src/mongo/db/commands/server_status_internal.cpp4
-rw-r--r--src/mongo/db/commands/user_management_commands.cpp15
-rw-r--r--src/mongo/db/commands/user_management_commands_common.cpp2
-rw-r--r--src/mongo/db/concurrency/d_concurrency.cpp2
-rw-r--r--src/mongo/db/concurrency/lock_state.cpp2
-rw-r--r--src/mongo/db/dbhelpers.cpp2
-rw-r--r--src/mongo/db/exec/and_hash.cpp4
-rw-r--r--src/mongo/db/exec/and_sorted.cpp4
-rw-r--r--src/mongo/db/exec/cached_plan.cpp2
-rw-r--r--src/mongo/db/exec/fetch.cpp2
-rw-r--r--src/mongo/db/exec/limit.cpp2
-rw-r--r--src/mongo/db/exec/merge_sort.cpp2
-rw-r--r--src/mongo/db/exec/multi_plan.cpp2
-rw-r--r--src/mongo/db/exec/or.cpp2
-rw-r--r--src/mongo/db/exec/projection.cpp2
-rw-r--r--src/mongo/db/exec/projection_exec.cpp8
-rw-r--r--src/mongo/db/exec/skip.cpp2
-rw-r--r--src/mongo/db/exec/sort.cpp2
-rw-r--r--src/mongo/db/exec/sort_test.cpp2
-rw-r--r--src/mongo/db/exec/subplan.cpp24
-rw-r--r--src/mongo/db/exec/text_match.cpp2
-rw-r--r--src/mongo/db/exec/text_or.cpp2
-rw-r--r--src/mongo/db/field_parser-inl.h2
-rw-r--r--src/mongo/db/field_ref_set.cpp2
-rw-r--r--src/mongo/db/field_ref_test.cpp33
-rw-r--r--src/mongo/db/ftdc/block_compressor.cpp2
-rw-r--r--src/mongo/db/ftdc/file_manager.cpp2
-rw-r--r--src/mongo/db/ftdc/file_reader.cpp2
-rw-r--r--src/mongo/db/ftdc/util.cpp2
-rw-r--r--src/mongo/db/fts/fts_basic_tokenizer.cpp2
-rw-r--r--src/mongo/db/fts/fts_element_iterator.cpp4
-rw-r--r--src/mongo/db/fts/fts_index_format.cpp19
-rw-r--r--src/mongo/db/fts/fts_index_format_test.cpp11
-rw-r--r--src/mongo/db/fts/fts_language.cpp7
-rw-r--r--src/mongo/db/fts/fts_query_impl.cpp4
-rw-r--r--src/mongo/db/fts/fts_query_parser.cpp2
-rw-r--r--src/mongo/db/fts/fts_spec.cpp3
-rw-r--r--src/mongo/db/fts/fts_spec_legacy.cpp3
-rw-r--r--src/mongo/db/fts/fts_unicode_tokenizer.cpp2
-rw-r--r--src/mongo/db/fts/stemmer.cpp2
-rw-r--r--src/mongo/db/fts/tokenizer.cpp2
-rw-r--r--src/mongo/db/geo/geometry_container.cpp2
-rw-r--r--src/mongo/db/geo/geoparser.cpp11
-rw-r--r--src/mongo/db/geo/hash.cpp5
-rw-r--r--src/mongo/db/geo/hash_test.cpp2
-rw-r--r--src/mongo/db/geo/shapes.cpp5
-rw-r--r--src/mongo/db/index/btree_key_generator.cpp20
-rw-r--r--src/mongo/db/index/expression_keys_private.cpp6
-rw-r--r--src/mongo/db/index/expression_params.cpp4
-rw-r--r--src/mongo/db/index/index_access_method.cpp4
-rw-r--r--src/mongo/db/index/s2_key_generator_test.cpp2
-rw-r--r--src/mongo/db/index_build_entry_helpers.cpp22
-rw-r--r--src/mongo/db/index_builder.cpp2
-rw-r--r--src/mongo/db/index_builds_coordinator.cpp18
-rw-r--r--src/mongo/db/index_builds_coordinator_mongod.cpp2
-rw-r--r--src/mongo/db/initialize_server_global_state.cpp16
-rw-r--r--src/mongo/db/keypattern.h2
-rw-r--r--src/mongo/db/keys_collection_cache.cpp2
-rw-r--r--src/mongo/db/keys_collection_manager.cpp2
-rw-r--r--src/mongo/db/matcher/expression_geo.cpp7
-rw-r--r--src/mongo/db/matcher/expression_leaf.cpp2
-rw-r--r--src/mongo/db/matcher/expression_optimize_test.cpp2
-rw-r--r--src/mongo/db/matcher/expression_parser.cpp2
-rw-r--r--src/mongo/db/matcher/matcher.cpp2
-rw-r--r--src/mongo/db/mongod_options.cpp2
-rw-r--r--src/mongo/db/multi_key_path_tracker_test.cpp2
-rw-r--r--src/mongo/db/namespace_string.cpp2
-rw-r--r--src/mongo/db/ops/insert.cpp4
-rw-r--r--src/mongo/db/ops/parsed_delete.cpp2
-rw-r--r--src/mongo/db/ops/update_request.h4
-rw-r--r--src/mongo/db/ops/update_result.cpp2
-rw-r--r--src/mongo/db/ops/write_ops_parsers.cpp2
-rw-r--r--src/mongo/db/pipeline/accumulation_statement.cpp2
-rw-r--r--src/mongo/db/pipeline/dependencies.cpp32
-rw-r--r--src/mongo/db/pipeline/document.cpp3
-rw-r--r--src/mongo/db/pipeline/document_source_current_op_test.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_facet.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_graph_lookup_test.cpp2
-rw-r--r--src/mongo/db/pipeline/expression.cpp4
-rw-r--r--src/mongo/db/pipeline/expression.h25
-rw-r--r--src/mongo/db/pipeline/field_path.cpp2
-rw-r--r--src/mongo/db/pipeline/parsed_aggregation_projection.cpp2
-rw-r--r--src/mongo/db/pipeline/pipeline.cpp2
-rw-r--r--src/mongo/db/pipeline/pipeline_metadata_tree_test.cpp2
-rw-r--r--src/mongo/db/pipeline/value.cpp3
-rw-r--r--src/mongo/db/pipeline/variables.cpp2
-rw-r--r--src/mongo/db/query/canonical_query_test.cpp6
-rw-r--r--src/mongo/db/query/collation/collator_factory_icu.cpp2
-rw-r--r--src/mongo/db/query/count_request.cpp2
-rw-r--r--src/mongo/db/query/count_request_test.cpp2
-rw-r--r--src/mongo/db/query/datetime/date_time_support.cpp2
-rw-r--r--src/mongo/db/query/datetime/init_timezone_data.cpp2
-rw-r--r--src/mongo/db/query/explain.cpp4
-rw-r--r--src/mongo/db/query/find.cpp2
-rw-r--r--src/mongo/db/query/get_executor_test.cpp2
-rw-r--r--src/mongo/db/query/index_bounds.cpp4
-rw-r--r--src/mongo/db/query/index_bounds_builder.cpp4
-rw-r--r--src/mongo/db/query/index_bounds_test.cpp6
-rw-r--r--src/mongo/db/query/index_entry.h2
-rw-r--r--src/mongo/db/query/interval.h4
-rw-r--r--src/mongo/db/query/parsed_distinct.cpp2
-rw-r--r--src/mongo/db/query/parsed_projection.cpp22
-rw-r--r--src/mongo/db/query/parsed_projection.h2
-rw-r--r--src/mongo/db/query/parsed_projection_test.cpp7
-rw-r--r--src/mongo/db/query/plan_enumerator.cpp12
-rw-r--r--src/mongo/db/query/plan_ranker.cpp2
-rw-r--r--src/mongo/db/query/planner_ixselect_test.cpp14
-rw-r--r--src/mongo/db/query/query_planner.cpp8
-rw-r--r--src/mongo/db/query/query_planner_test_fixture.cpp10
-rw-r--r--src/mongo/db/query/query_planner_test_fixture.h2
-rw-r--r--src/mongo/db/query/query_request.cpp2
-rw-r--r--src/mongo/db/query/query_solution.cpp44
-rw-r--r--src/mongo/db/query/query_solution.h46
-rw-r--r--src/mongo/db/query/query_solution_test.cpp7
-rw-r--r--src/mongo/db/query/stage_builder.cpp2
-rw-r--r--src/mongo/db/repl/abstract_async_component.cpp2
-rw-r--r--src/mongo/db/repl/base_cloner_test_fixture.cpp2
-rw-r--r--src/mongo/db/repl/bgsync.cpp2
-rw-r--r--src/mongo/db/repl/check_quorum_for_config_change.cpp2
-rw-r--r--src/mongo/db/repl/collection_bulk_loader_impl.cpp2
-rw-r--r--src/mongo/db/repl/collection_cloner.cpp2
-rw-r--r--src/mongo/db/repl/collection_cloner_test.cpp2
-rw-r--r--src/mongo/db/repl/database_cloner.cpp2
-rw-r--r--src/mongo/db/repl/database_cloner_test.cpp2
-rw-r--r--src/mongo/db/repl/databases_cloner.cpp2
-rw-r--r--src/mongo/db/repl/databases_cloner_test.cpp2
-rw-r--r--src/mongo/db/repl/drop_pending_collection_reaper_test.cpp2
-rw-r--r--src/mongo/db/repl/initial_syncer.cpp2
-rw-r--r--src/mongo/db/repl/initial_syncer_test.cpp2
-rw-r--r--src/mongo/db/repl/is_master_response.cpp2
-rw-r--r--src/mongo/db/repl/member_config.cpp2
-rw-r--r--src/mongo/db/repl/member_state.h2
-rw-r--r--src/mongo/db/repl/oplog.cpp6
-rw-r--r--src/mongo/db/repl/oplog_interface_local.cpp2
-rw-r--r--src/mongo/db/repl/oplog_interface_remote.cpp2
-rw-r--r--src/mongo/db/repl/optime_with.h2
-rw-r--r--src/mongo/db/repl/read_concern_args.cpp2
-rw-r--r--src/mongo/db/repl/repl_set_config_checks.cpp2
-rw-r--r--src/mongo/db/repl/repl_set_heartbeat_response.cpp2
-rw-r--r--src/mongo/db/repl/repl_set_tag.cpp2
-rw-r--r--src/mongo/db/repl/replication_consistency_markers_impl_test.cpp2
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_impl.cpp2
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp2
-rw-r--r--src/mongo/db/repl/replication_process.cpp2
-rw-r--r--src/mongo/db/repl/replication_recovery_test.cpp2
-rw-r--r--src/mongo/db/repl/roll_back_local_operations.cpp2
-rw-r--r--src/mongo/db/repl/rollback_source_impl.cpp2
-rw-r--r--src/mongo/db/repl/rollback_test_fixture.cpp2
-rw-r--r--src/mongo/db/repl/storage_interface.cpp2
-rw-r--r--src/mongo/db/repl/storage_interface_impl.cpp2
-rw-r--r--src/mongo/db/repl/storage_interface_impl_test.cpp2
-rw-r--r--src/mongo/db/repl/storage_interface_mock.cpp2
-rw-r--r--src/mongo/db/repl/sync_source_resolver.cpp2
-rw-r--r--src/mongo/db/repl/sync_tail.cpp2
-rw-r--r--src/mongo/db/repl/task_runner.cpp2
-rw-r--r--src/mongo/db/repl/topology_coordinator.cpp2
-rw-r--r--src/mongo/db/repl/vote_requester_test.cpp2
-rw-r--r--src/mongo/db/s/balancer/balancer_chunk_selection_policy.cpp2
-rw-r--r--src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp2
-rw-r--r--src/mongo/db/s/balancer/cluster_statistics_impl.cpp2
-rw-r--r--src/mongo/db/s/collection_metadata.cpp2
-rw-r--r--src/mongo/db/s/collection_range_deleter.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_add_shard_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_control_balancer_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_merge_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_move_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_shard_collection_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_split_chunk_command.cpp2
-rw-r--r--src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp2
-rw-r--r--src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp2
-rw-r--r--src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp2
-rw-r--r--src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp2
-rw-r--r--src/mongo/db/s/merge_chunks_command.cpp2
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp2
-rw-r--r--src/mongo/db/s/migration_destination_manager.cpp2
-rw-r--r--src/mongo/db/s/migration_session_id.cpp2
-rw-r--r--src/mongo/db/s/session_catalog_migration_source.cpp2
-rw-r--r--src/mongo/db/s/sharding_logging_test.cpp2
-rw-r--r--src/mongo/db/s/shardsvr_shard_collection.cpp2
-rw-r--r--src/mongo/db/s/split_chunk_command.cpp2
-rw-r--r--src/mongo/db/server_options_helpers.cpp2
-rw-r--r--src/mongo/db/server_options_server_helpers.cpp2
-rw-r--r--src/mongo/db/service_context.cpp2
-rw-r--r--src/mongo/db/signed_logical_time.cpp2
-rw-r--r--src/mongo/db/sorter/sorter.cpp6
-rw-r--r--src/mongo/db/sorter/sorter_test.cpp2
-rw-r--r--src/mongo/db/startup_warnings_mongod.cpp2
-rw-r--r--src/mongo/db/storage/biggie/biggie_sorted_impl.cpp2
-rw-r--r--src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_btree_impl.cpp2
-rw-r--r--src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp2
-rw-r--r--src/mongo/db/storage/kv/kv_catalog.cpp2
-rw-r--r--src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp2
-rw-r--r--src/mongo/db/storage/kv/kv_storage_engine.cpp2
-rw-r--r--src/mongo/db/storage/kv/temporary_kv_record_store.cpp2
-rw-r--r--src/mongo/db/storage/mobile/mobile_record_store.cpp2
-rw-r--r--src/mongo/db/storage/mobile/mobile_util.cpp2
-rw-r--r--src/mongo/db/storage/storage_engine.h2
-rw-r--r--src/mongo/db/storage/storage_engine_init.cpp2
-rw-r--r--src/mongo/db/storage/storage_engine_lock_file_posix.cpp2
-rw-r--r--src/mongo/db/storage/storage_engine_lock_file_windows.cpp2
-rw-r--r--src/mongo/db/storage/storage_engine_metadata.cpp2
-rw-r--r--src/mongo/db/storage/storage_options.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_init_test.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp8
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp4
-rw-r--r--src/mongo/db/traffic_recorder.cpp2
-rw-r--r--src/mongo/db/traffic_recorder_validators.cpp2
-rw-r--r--src/mongo/db/transaction_history_iterator.cpp2
-rw-r--r--src/mongo/db/transaction_participant.h2
-rw-r--r--src/mongo/db/transaction_participant_test.cpp3
-rw-r--r--src/mongo/db/update/field_checker.cpp10
-rw-r--r--src/mongo/db/update/log_builder.cpp3
-rw-r--r--src/mongo/db/update/path_support.cpp20
-rw-r--r--src/mongo/db/update/path_support_test.cpp4
-rw-r--r--src/mongo/db/update/update_driver.cpp10
-rw-r--r--src/mongo/db/update/update_driver_test.cpp4
-rw-r--r--src/mongo/db/views/view_catalog_test.cpp2
-rw-r--r--src/mongo/db/write_concern_options.cpp2
-rw-r--r--src/mongo/dbtests/mock/mock_remote_db_server.cpp2
-rw-r--r--src/mongo/dbtests/multikey_paths_test.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_and.cpp4
-rw-r--r--src/mongo/dbtests/query_stage_update.cpp2
-rw-r--r--src/mongo/embedded/api_common.h4
-rw-r--r--src/mongo/embedded/index_builds_coordinator_embedded.cpp2
-rw-r--r--src/mongo/executor/network_interface_mock.cpp2
-rw-r--r--src/mongo/executor/remote_command_request.cpp2
-rw-r--r--src/mongo/executor/remote_command_response.cpp2
-rw-r--r--src/mongo/executor/task_executor_test_common.cpp11
-rw-r--r--src/mongo/executor/task_executor_test_fixture.cpp2
-rw-r--r--src/mongo/idl/idl_parser.cpp2
-rw-r--r--src/mongo/logger/log_function_test.cpp2
-rw-r--r--src/mongo/logger/log_test.cpp2
-rw-r--r--src/mongo/logger/parse_log_component_settings.cpp2
-rw-r--r--src/mongo/logger/ramlog.cpp2
-rw-r--r--src/mongo/logger/rotatable_file_writer.cpp42
-rw-r--r--src/mongo/platform/shared_library_posix.cpp2
-rw-r--r--src/mongo/platform/shared_library_windows.cpp2
-rw-r--r--src/mongo/rpc/factory.cpp2
-rw-r--r--src/mongo/rpc/get_status_from_command_result.cpp4
-rw-r--r--src/mongo/rpc/legacy_reply.cpp2
-rw-r--r--src/mongo/rpc/legacy_reply_builder.cpp2
-rw-r--r--src/mongo/rpc/message.h2
-rw-r--r--src/mongo/rpc/metadata/client_metadata.cpp2
-rw-r--r--src/mongo/rpc/metadata/sharding_metadata.cpp2
-rw-r--r--src/mongo/rpc/protocol.cpp2
-rw-r--r--src/mongo/rpc/write_concern_error_detail.cpp2
-rw-r--r--src/mongo/s/balancer_configuration.cpp2
-rw-r--r--src/mongo/s/catalog/dist_lock_catalog_mock.cpp2
-rw-r--r--src/mongo/s/catalog/dist_lock_manager_mock.cpp2
-rw-r--r--src/mongo/s/catalog/replset_dist_lock_manager.cpp2
-rw-r--r--src/mongo/s/catalog/sharding_catalog_client_impl.cpp2
-rw-r--r--src/mongo/s/catalog/type_changelog.cpp2
-rw-r--r--src/mongo/s/catalog/type_chunk.cpp2
-rw-r--r--src/mongo/s/catalog/type_config_version.cpp2
-rw-r--r--src/mongo/s/catalog/type_lockpings.cpp2
-rw-r--r--src/mongo/s/catalog/type_locks.cpp2
-rw-r--r--src/mongo/s/catalog/type_mongos.cpp2
-rw-r--r--src/mongo/s/catalog/type_shard.cpp2
-rw-r--r--src/mongo/s/catalog/type_tags.cpp2
-rw-r--r--src/mongo/s/chunk.cpp2
-rw-r--r--src/mongo/s/chunk_manager_refresh_bm.cpp2
-rw-r--r--src/mongo/s/chunk_version.cpp2
-rw-r--r--src/mongo/s/client/shard_registry.cpp2
-rw-r--r--src/mongo/s/client/shard_remote.cpp2
-rw-r--r--src/mongo/s/client/sharding_network_connection_hook.cpp2
-rw-r--r--src/mongo/s/cluster_identity_loader_test.cpp2
-rw-r--r--src/mongo/s/cluster_last_error_info_test.cpp2
-rw-r--r--src/mongo/s/commands/cluster_kill_op.cpp2
-rw-r--r--src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp2
-rw-r--r--src/mongo/s/commands/document_shard_key_update_util.cpp2
-rw-r--r--src/mongo/s/commands/strategy.cpp2
-rw-r--r--src/mongo/s/mongos_options.cpp2
-rw-r--r--src/mongo/s/query/cluster_cursor_manager.cpp2
-rw-r--r--src/mongo/s/request_types/add_shard_request_type.cpp2
-rw-r--r--src/mongo/s/request_types/set_shard_version_request.cpp2
-rw-r--r--src/mongo/s/request_types/update_zone_key_range_request_type.cpp12
-rw-r--r--src/mongo/s/shard_key_pattern.cpp2
-rw-r--r--src/mongo/s/shard_util.cpp2
-rw-r--r--src/mongo/s/sharding_initialization.cpp2
-rw-r--r--src/mongo/s/sharding_uptime_reporter.cpp2
-rw-r--r--src/mongo/s/write_ops/batched_command_response.cpp4
-rw-r--r--src/mongo/s/write_ops/batched_upsert_detail.cpp2
-rw-r--r--src/mongo/s/write_ops/chunk_manager_targeter.cpp2
-rw-r--r--src/mongo/s/write_ops/cluster_write.cpp2
-rw-r--r--src/mongo/s/write_ops/write_error_detail.cpp2
-rw-r--r--src/mongo/scripting/bson_template_evaluator.cpp2
-rw-r--r--src/mongo/scripting/mozjs/bindata.cpp2
-rw-r--r--src/mongo/scripting/mozjs/code.cpp2
-rw-r--r--src/mongo/scripting/mozjs/dbpointer.cpp2
-rw-r--r--src/mongo/scripting/mozjs/implscope.cpp2
-rw-r--r--src/mongo/scripting/mozjs/nativefunction.cpp2
-rw-r--r--src/mongo/scripting/mozjs/numberdecimal.cpp2
-rw-r--r--src/mongo/scripting/mozjs/numberint.cpp2
-rw-r--r--src/mongo/scripting/mozjs/numberlong.cpp2
-rw-r--r--src/mongo/scripting/mozjs/oid.cpp2
-rw-r--r--src/mongo/scripting/mozjs/session.cpp2
-rw-r--r--src/mongo/scripting/mozjs/timestamp.cpp2
-rw-r--r--src/mongo/scripting/mozjs/uri.cpp2
-rw-r--r--src/mongo/shell/bench.cpp3
-rw-r--r--src/mongo/shell/shell_options.cpp10
-rw-r--r--src/mongo/shell/shell_utils_extended.cpp4
-rw-r--r--src/mongo/tools/bridge.cpp2
-rw-r--r--src/mongo/tools/bridge_commands.cpp2
-rw-r--r--src/mongo/tools/mongoebench_options.cpp2
-rw-r--r--src/mongo/transport/transport_layer_asio.cpp2
-rw-r--r--src/mongo/unittest/temp_dir.cpp3
-rw-r--r--src/mongo/unittest/unittest.h4
-rw-r--r--src/mongo/util/assert_util.cpp2
-rw-r--r--src/mongo/util/assert_util_test.cpp2
-rw-r--r--src/mongo/util/background.cpp4
-rw-r--r--src/mongo/util/cmdline_utils/censor_cmdline.cpp5
-rw-r--r--src/mongo/util/concurrency/thread_name.cpp2
-rw-r--r--src/mongo/util/concurrency/thread_pool.cpp2
-rw-r--r--src/mongo/util/concurrency/ticketholder.cpp2
-rw-r--r--src/mongo/util/descriptive_stats-inl.h5
-rw-r--r--src/mongo/util/dns_name.h2
-rw-r--r--src/mongo/util/duration.h2
-rw-r--r--src/mongo/util/errno_util.cpp2
-rw-r--r--src/mongo/util/fail_point.cpp2
-rw-r--r--src/mongo/util/fail_point_registry.cpp2
-rw-r--r--src/mongo/util/file.cpp32
-rw-r--r--src/mongo/util/hex.h2
-rw-r--r--src/mongo/util/icu.cpp2
-rw-r--r--src/mongo/util/intrusive_counter.cpp3
-rw-r--r--src/mongo/util/net/hostandport.cpp2
-rw-r--r--src/mongo/util/net/http_client_winhttp.cpp2
-rw-r--r--src/mongo/util/net/sock.cpp2
-rw-r--r--src/mongo/util/net/sockaddr.cpp9
-rw-r--r--src/mongo/util/net/socket_exception.cpp2
-rw-r--r--src/mongo/util/net/socket_utils.cpp4
-rw-r--r--src/mongo/util/net/ssl/detail/impl/engine_apple.ipp2
-rw-r--r--src/mongo/util/net/ssl_manager.cpp18
-rw-r--r--src/mongo/util/net/ssl_manager_openssl.cpp2
-rw-r--r--src/mongo/util/net/ssl_manager_windows.cpp2
-rw-r--r--src/mongo/util/ntservice.cpp2
-rw-r--r--src/mongo/util/options_parser/options_parser.cpp4
-rw-r--r--src/mongo/util/perfctr_collect.cpp2
-rw-r--r--src/mongo/util/processinfo_solaris.cpp22
-rw-r--r--src/mongo/util/procparser.cpp2
-rw-r--r--src/mongo/util/regex_util.cpp2
-rw-r--r--src/mongo/util/shell_exec.cpp2
-rw-r--r--src/mongo/util/signal_win32.cpp4
-rw-r--r--src/mongo/util/str.h (renamed from src/mongo/util/mongoutils/str.h)20
-rw-r--r--src/mongo/util/stringutils.h2
-rw-r--r--src/mongo/util/tcmalloc_set_parameter.cpp2
-rw-r--r--src/mongo/util/text.cpp4
-rw-r--r--src/mongo/util/time_support.cpp2
-rwxr-xr-xsrc/third_party/s2/base/logging.cc4
-rw-r--r--src/third_party/s2/s2loop.cc4
-rw-r--r--src/third_party/s2/s2polygon.cc4
-rw-r--r--src/third_party/s2/s2polyline.cc4
431 files changed, 912 insertions, 1054 deletions
diff --git a/src/mongo/base/data_range.cpp b/src/mongo/base/data_range.cpp
index 38704a9bbae..c17dbdfff93 100644
--- a/src/mongo/base/data_range.cpp
+++ b/src/mongo/base/data_range.cpp
@@ -29,7 +29,7 @@
#include "mongo/base/data_range.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/base/data_range.h b/src/mongo/base/data_range.h
index eb53af9719a..75acf53ec0f 100644
--- a/src/mongo/base/data_range.h
+++ b/src/mongo/base/data_range.h
@@ -37,7 +37,7 @@
#include "mongo/base/error_codes.h"
#include "mongo/base/status_with.h"
#include "mongo/platform/endian.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
class ConstDataRange {
diff --git a/src/mongo/base/data_range_cursor.cpp b/src/mongo/base/data_range_cursor.cpp
index c7626ada66a..b22ee726e2a 100644
--- a/src/mongo/base/data_range_cursor.cpp
+++ b/src/mongo/base/data_range_cursor.cpp
@@ -29,12 +29,12 @@
#include "mongo/base/data_range_cursor.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
Status ConstDataRangeCursor::makeAdvanceStatus(size_t advance) const {
- mongoutils::str::stream ss;
+ str::stream ss;
ss << "Invalid advance (" << advance << ") past end of buffer[" << length()
<< "] at offset: " << _debug_offset;
@@ -42,7 +42,7 @@ Status ConstDataRangeCursor::makeAdvanceStatus(size_t advance) const {
}
Status DataRangeCursor::makeAdvanceStatus(size_t advance) const {
- mongoutils::str::stream ss;
+ str::stream ss;
ss << "Invalid advance (" << advance << ") past end of buffer[" << length()
<< "] at offset: " << _debug_offset;
diff --git a/src/mongo/base/data_range_cursor.h b/src/mongo/base/data_range_cursor.h
index 13f0fdae4d3..89dff93eb43 100644
--- a/src/mongo/base/data_range_cursor.h
+++ b/src/mongo/base/data_range_cursor.h
@@ -36,7 +36,7 @@
#include "mongo/base/data_range.h"
#include "mongo/base/data_type.h"
#include "mongo/platform/endian.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/base/data_type.cpp b/src/mongo/base/data_type.cpp
index da0608eb2e7..6c2d5444b08 100644
--- a/src/mongo/base/data_type.cpp
+++ b/src/mongo/base/data_type.cpp
@@ -29,19 +29,19 @@
#include "mongo/base/data_type.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
Status DataType::makeTrivialLoadStatus(size_t sizeOfT, size_t length, size_t debug_offset) {
- mongoutils::str::stream ss;
+ str::stream ss;
ss << "buffer size too small to read (" << sizeOfT << ") bytes out of buffer[" << length
<< "] at offset: " << debug_offset;
return Status(ErrorCodes::Overflow, ss);
}
Status DataType::makeTrivialStoreStatus(size_t sizeOfT, size_t length, size_t debug_offset) {
- mongoutils::str::stream ss;
+ str::stream ss;
ss << "buffer size too small to write (" << sizeOfT << ") bytes into buffer[" << length
<< "] at offset: " << debug_offset;
return Status(ErrorCodes::Overflow, ss);
diff --git a/src/mongo/base/data_type_string_data.cpp b/src/mongo/base/data_type_string_data.cpp
index eb6198b609a..51929f718a5 100644
--- a/src/mongo/base/data_type_string_data.cpp
+++ b/src/mongo/base/data_type_string_data.cpp
@@ -29,7 +29,7 @@
#include "mongo/base/data_type.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/base/data_type_terminated.cpp b/src/mongo/base/data_type_terminated.cpp
index 20ea8472167..5074abbe22f 100644
--- a/src/mongo/base/data_type_terminated.cpp
+++ b/src/mongo/base/data_type_terminated.cpp
@@ -29,7 +29,7 @@
#include "mongo/base/data_type_terminated.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include "mongo/util/stringutils.h"
namespace mongo {
diff --git a/src/mongo/base/error_codes.tpl.cpp b/src/mongo/base/error_codes.tpl.cpp
index d4eaffce1c9..9242c885629 100644
--- a/src/mongo/base/error_codes.tpl.cpp
+++ b/src/mongo/base/error_codes.tpl.cpp
@@ -33,7 +33,7 @@
#include "mongo/base/static_assert.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
//#set $codes_with_extra = [ec for ec in $codes if ec.extra]
@@ -58,7 +58,7 @@ std::string ErrorCodes::errorString(Error err) {
return "$ec.name";
//#end for
default:
- return mongoutils::str::stream() << "Location" << int(err);
+ return str::stream() << "Location" << int(err);
}
}
diff --git a/src/mongo/base/parse_number_test.cpp b/src/mongo/base/parse_number_test.cpp
index d2d96934988..b17968f4081 100644
--- a/src/mongo/base/parse_number_test.cpp
+++ b/src/mongo/base/parse_number_test.cpp
@@ -36,7 +36,7 @@
#include "mongo/base/parse_number.h"
#include "mongo/base/status.h"
#include "mongo/unittest/unittest.h"
-#include "mongo/util/mongoutils/str.h" // for str::stream()!
+#include "mongo/util/str.h" // for str::stream()!
#define ASSERT_PARSES(TYPE, INPUT_STRING, EXPECTED_VALUE) \
do { \
@@ -147,7 +147,6 @@ public:
}
static void TestParsingLimits() {
- using namespace mongoutils;
NumberType ignored;
ASSERT_PARSES(NumberType, std::string(str::stream() << Limits::max()), Limits::max());
ASSERT_PARSES(NumberType, std::string(str::stream() << Limits::min()), Limits::min());
@@ -226,7 +225,7 @@ TEST(ParseNumber, Int8) {
ASSERT_EQUALS(ErrorCodes::FailedToParse, parseNumberFromString("900", &ignored));
for (int32_t i = -128; i <= 127; ++i)
- ASSERT_PARSES(int8_t, std::string(mongoutils::str::stream() << i), i);
+ ASSERT_PARSES(int8_t, std::string(str::stream() << i), i);
}
TEST(ParseNumber, UInt8) {
@@ -238,7 +237,7 @@ TEST(ParseNumber, UInt8) {
ASSERT_EQUALS(ErrorCodes::FailedToParse, parseNumberFromString("+900", &ignored));
for (uint32_t i = 0; i <= 255; ++i)
- ASSERT_PARSES(uint8_t, std::string(mongoutils::str::stream() << i), i);
+ ASSERT_PARSES(uint8_t, std::string(str::stream() << i), i);
}
TEST(ParseNumber, TestParsingOverflow) {
diff --git a/src/mongo/base/status.cpp b/src/mongo/base/status.cpp
index a97885a55b0..696ff79e5e0 100644
--- a/src/mongo/base/status.cpp
+++ b/src/mongo/base/status.cpp
@@ -32,7 +32,7 @@
#include "mongo/base/status.h"
#include "mongo/db/jsobj.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include <ostream>
#include <sstream>
@@ -97,7 +97,7 @@ Status::Status(ErrorCodes::Error code, StringData reason, const BSONObj& extraIn
}
}
-Status::Status(ErrorCodes::Error code, const mongoutils::str::stream& reason)
+Status::Status(ErrorCodes::Error code, const str::stream& reason)
: Status(code, std::string(reason)) {}
Status Status::withReason(StringData newReason) const {
diff --git a/src/mongo/base/status.h b/src/mongo/base/status.h
index 21b9eadf268..61a155e98cf 100644
--- a/src/mongo/base/status.h
+++ b/src/mongo/base/status.h
@@ -37,13 +37,11 @@
#include "mongo/platform/atomic_word.h"
#include "mongo/platform/compiler.h"
-namespace mongoutils {
+namespace mongo {
+
namespace str {
class stream;
} // namespace str
-} // namespace mongoutils
-
-namespace mongo {
// Including builder.h here would cause a cycle.
template <typename Allocator>
@@ -80,8 +78,7 @@ public:
MONGO_COMPILER_COLD_FUNCTION Status(ErrorCodes::Error code, const std::string& reason);
MONGO_COMPILER_COLD_FUNCTION Status(ErrorCodes::Error code, const char* reason);
MONGO_COMPILER_COLD_FUNCTION Status(ErrorCodes::Error code, StringData reason);
- MONGO_COMPILER_COLD_FUNCTION Status(ErrorCodes::Error code,
- const mongoutils::str::stream& reason);
+ MONGO_COMPILER_COLD_FUNCTION Status(ErrorCodes::Error code, const str::stream& reason);
MONGO_COMPILER_COLD_FUNCTION Status(ErrorCodes::Error code,
StringData message,
const BSONObj& extraInfoHolder);
diff --git a/src/mongo/base/status_with.h b/src/mongo/base/status_with.h
index 4284a1ab530..453cfb08101 100644
--- a/src/mongo/base/status_with.h
+++ b/src/mongo/base/status_with.h
@@ -114,8 +114,7 @@ public:
: _status(code, std::move(reason)) {}
MONGO_COMPILER_COLD_FUNCTION StatusWith(ErrorCodes::Error code, const char* reason)
: _status(code, reason) {}
- MONGO_COMPILER_COLD_FUNCTION StatusWith(ErrorCodes::Error code,
- const mongoutils::str::stream& reason)
+ MONGO_COMPILER_COLD_FUNCTION StatusWith(ErrorCodes::Error code, const str::stream& reason)
: _status(code, reason) {}
/**
diff --git a/src/mongo/base/validate_locale.cpp b/src/mongo/base/validate_locale.cpp
index 76b9948f2a7..6159764ba7a 100644
--- a/src/mongo/base/validate_locale.cpp
+++ b/src/mongo/base/validate_locale.cpp
@@ -34,7 +34,7 @@
#include <locale>
#include "mongo/base/init.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/bson/bsonelement.cpp b/src/mongo/bson/bsonelement.cpp
index 35ad1e76391..5bef012b292 100644
--- a/src/mongo/bson/bsonelement.cpp
+++ b/src/mongo/bson/bsonelement.cpp
@@ -43,14 +43,13 @@
#include "mongo/util/duration.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"
#include "mongo/util/string_map.h"
#include "mongo/util/stringutils.h"
#include "mongo/util/uuid.h"
namespace mongo {
-namespace str = mongoutils::str;
using std::dec;
using std::hex;
diff --git a/src/mongo/bson/bsonobj.cpp b/src/mongo/bson/bsonobj.cpp
index 376e32016ee..bae36f39544 100644
--- a/src/mongo/bson/bsonobj.cpp
+++ b/src/mongo/bson/bsonobj.cpp
@@ -38,7 +38,7 @@
#include "mongo/util/allocator.h"
#include "mongo/util/hex.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include "mongo/util/stringutils.h"
namespace mongo {
@@ -622,7 +622,7 @@ void BSONObj::toString(
Status DataType::Handler<BSONObj>::store(
const BSONObj& bson, char* ptr, size_t length, size_t* advanced, std::ptrdiff_t debug_offset) {
if (bson.objsize() > static_cast<int>(length)) {
- mongoutils::str::stream ss;
+ str::stream ss;
ss << "buffer too small to write bson of size (" << bson.objsize()
<< ") at offset: " << debug_offset;
return Status(ErrorCodes::Overflow, ss);
diff --git a/src/mongo/bson/json.cpp b/src/mongo/bson/json.cpp
index 3fff510f25c..8f6587a6eff 100644
--- a/src/mongo/bson/json.cpp
+++ b/src/mongo/bson/json.cpp
@@ -40,7 +40,7 @@
#include "mongo/util/base64.h"
#include "mongo/util/hex.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/bson/mutable/algorithm.h b/src/mongo/bson/mutable/algorithm.h
index 53cedd6100c..f2d4ffd1de5 100644
--- a/src/mongo/bson/mutable/algorithm.h
+++ b/src/mongo/bson/mutable/algorithm.h
@@ -36,7 +36,7 @@
#include "mongo/base/string_data_comparator_interface.h"
#include "mongo/bson/mutable/const_element.h"
#include "mongo/bson/mutable/element.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mutablebson {
@@ -290,7 +290,7 @@ std::string getFullName(ElementType element, char delim = '.') {
curr = curr.parent();
}
- mongoutils::str::stream name;
+ str::stream name;
bool first = true;
for (std::vector<StringData>::reverse_iterator it = names.rbegin(); it != names.rend(); ++it) {
if (!first)
diff --git a/src/mongo/bson/util/bson_check.h b/src/mongo/bson/util/bson_check.h
index 46656ea9802..1ca748d88a2 100644
--- a/src/mongo/bson/util/bson_check.h
+++ b/src/mongo/bson/util/bson_check.h
@@ -33,7 +33,7 @@
#include "mongo/db/command_generic_argument.h"
#include "mongo/db/commands.h"
#include "mongo/db/jsobj.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/bson/util/bson_extract.cpp b/src/mongo/bson/util/bson_extract.cpp
index 6552db87ae2..481c26df5fe 100644
--- a/src/mongo/bson/util/bson_extract.cpp
+++ b/src/mongo/bson/util/bson_extract.cpp
@@ -30,7 +30,7 @@
#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 {
@@ -52,8 +52,7 @@ Status bsonExtractFieldImpl(const BSONObj& object,
return kDefaultCase;
}
return Status(ErrorCodes::NoSuchKey,
- mongoutils::str::stream() << "Missing expected field \"" << fieldName.toString()
- << "\"");
+ str::stream() << "Missing expected field \"" << fieldName.toString() << "\"");
}
Status bsonExtractTypedFieldImpl(const BSONObj& object,
@@ -66,11 +65,10 @@ Status bsonExtractTypedFieldImpl(const BSONObj& object,
return status;
if (type != outElement->type()) {
return Status(ErrorCodes::TypeMismatch,
- mongoutils::str::stream() << "\"" << fieldName
- << "\" had the wrong type. Expected "
- << typeName(type)
- << ", found "
- << typeName(outElement->type()));
+ str::stream() << "\"" << fieldName << "\" had the wrong type. Expected "
+ << typeName(type)
+ << ", found "
+ << typeName(outElement->type()));
}
return status;
}
@@ -85,18 +83,17 @@ Status bsonExtractIntegerFieldImpl(const BSONObj& object,
return status;
if (!element.isNumber()) {
return Status(ErrorCodes::TypeMismatch,
- mongoutils::str::stream() << "Expected field \"" << fieldName
- << "\" to have numeric type, but found "
- << typeName(element.type()));
+ str::stream() << "Expected field \"" << fieldName
+ << "\" to have numeric type, but found "
+ << typeName(element.type()));
}
long long result = element.safeNumberLong();
if (result != element.numberDouble()) {
- return Status(
- ErrorCodes::BadValue,
- mongoutils::str::stream() << "Expected field \"" << fieldName
- << "\" to have a value "
- "exactly representable as a 64-bit integer, but found "
- << element);
+ return Status(ErrorCodes::BadValue,
+ str::stream() << "Expected field \"" << fieldName
+ << "\" to have a value "
+ "exactly representable as a 64-bit integer, but found "
+ << element);
}
*out = result;
return status;
@@ -112,9 +109,9 @@ Status bsonExtractDoubleFieldImpl(const BSONObj& object,
return status;
if (!element.isNumber()) {
return Status(ErrorCodes::TypeMismatch,
- mongoutils::str::stream() << "Expected field \"" << fieldName
- << "\" to have numeric type, but found "
- << typeName(element.type()));
+ str::stream() << "Expected field \"" << fieldName
+ << "\" to have numeric type, but found "
+ << typeName(element.type()));
}
*out = element.numberDouble();
return status;
@@ -157,10 +154,9 @@ Status bsonExtractBooleanFieldWithDefault(const BSONObj& object,
if (!element.isNumber() && !element.isBoolean()) {
return Status(ErrorCodes::TypeMismatch,
- mongoutils::str::stream() << "Expected boolean or number type for field \""
- << fieldName
- << "\", found "
- << typeName(element.type()));
+ str::stream() << "Expected boolean or number type for field \"" << fieldName
+ << "\", found "
+ << typeName(element.type()));
}
*out = element.trueValue();
return status;
@@ -263,11 +259,10 @@ Status bsonExtractIntegerFieldWithDefaultIf(const BSONObj& object,
return status;
}
if (!pred(*out)) {
- return Status(
- ErrorCodes::BadValue,
- mongoutils::str::stream() << "Invalid value in field \"" << fieldName << "\": " << *out
- << ": "
- << predDescription);
+ return Status(ErrorCodes::BadValue,
+ str::stream() << "Invalid value in field \"" << fieldName << "\": " << *out
+ << ": "
+ << predDescription);
}
return status;
}
diff --git a/src/mongo/client/connection_string.cpp b/src/mongo/client/connection_string.cpp
index 9cf9c96ed54..0fe85348b61 100644
--- a/src/mongo/client/connection_string.cpp
+++ b/src/mongo/client/connection_string.cpp
@@ -34,7 +34,7 @@
#include "mongo/client/connection_string.h"
#include "mongo/base/status_with.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/client/cyrus_sasl_client_session.cpp b/src/mongo/client/cyrus_sasl_client_session.cpp
index d2201be2149..36d7d588142 100644
--- a/src/mongo/client/cyrus_sasl_client_session.cpp
+++ b/src/mongo/client/cyrus_sasl_client_session.cpp
@@ -36,8 +36,8 @@
#include "mongo/util/allocator.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/concurrency/mutex.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/signal_handlers_synchronous.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace {
@@ -146,9 +146,9 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(CyrusSaslClientContext,
int result = sasl_client_init(saslClientGlobalCallbacks);
if (result != SASL_OK) {
return Status(ErrorCodes::UnknownError,
- mongoutils::str::stream() << "Could not initialize sasl client components ("
- << sasl_errstring(result, NULL, NULL)
- << ")");
+ str::stream() << "Could not initialize sasl client components ("
+ << sasl_errstring(result, NULL, NULL)
+ << ")");
}
SaslClientSession::create = createCyrusSaslClientSession;
@@ -268,7 +268,7 @@ Status CyrusSaslClientSession::initialize() {
if (SASL_OK != result) {
return Status(ErrorCodes::UnknownError,
- mongoutils::str::stream() << sasl_errstring(result, NULL, NULL));
+ str::stream() << sasl_errstring(result, NULL, NULL));
}
return Status::OK();
diff --git a/src/mongo/client/dbclient_base.h b/src/mongo/client/dbclient_base.h
index a125b0f5f68..626c64d4102 100644
--- a/src/mongo/client/dbclient_base.h
+++ b/src/mongo/client/dbclient_base.h
@@ -53,7 +53,7 @@
#include "mongo/transport/message_compressor_manager.h"
#include "mongo/transport/session.h"
#include "mongo/transport/transport_layer.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/client/dbclient_connection.h b/src/mongo/client/dbclient_connection.h
index 6b93b911fe7..13788423545 100644
--- a/src/mongo/client/dbclient_connection.h
+++ b/src/mongo/client/dbclient_connection.h
@@ -53,7 +53,7 @@
#include "mongo/transport/message_compressor_manager.h"
#include "mongo/transport/session.h"
#include "mongo/transport/transport_layer.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/client/fetcher.cpp b/src/mongo/client/fetcher.cpp
index 4878449a820..8e707c0ce02 100644
--- a/src/mongo/client/fetcher.cpp
+++ b/src/mongo/client/fetcher.cpp
@@ -41,8 +41,8 @@
#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/scopeguard.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/client/mongo_uri.cpp b/src/mongo/client/mongo_uri.cpp
index c001508b802..065da5fd016 100644
--- a/src/mongo/client/mongo_uri.cpp
+++ b/src/mongo/client/mongo_uri.cpp
@@ -49,7 +49,7 @@
#include "mongo/util/dns_name.h"
#include "mongo/util/dns_query.h"
#include "mongo/util/hex.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
using namespace std::literals::string_literals;
diff --git a/src/mongo/client/mongo_uri_connect.cpp b/src/mongo/client/mongo_uri_connect.cpp
index 9b09f066a16..e79b6271ee6 100644
--- a/src/mongo/client/mongo_uri_connect.cpp
+++ b/src/mongo/client/mongo_uri_connect.cpp
@@ -36,8 +36,8 @@
#include "mongo/client/authenticate.h"
#include "mongo/client/dbclient_base.h"
#include "mongo/db/auth/sasl_command_constants.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/password_digest.h"
+#include "mongo/util/str.h"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/classification.hpp>
diff --git a/src/mongo/client/native_sasl_client_session.cpp b/src/mongo/client/native_sasl_client_session.cpp
index 055d2443002..b7f51fa0f68 100644
--- a/src/mongo/client/native_sasl_client_session.cpp
+++ b/src/mongo/client/native_sasl_client_session.cpp
@@ -38,7 +38,7 @@
#include "mongo/client/scram_client_cache.h"
#include "mongo/crypto/sha1_block.h"
#include "mongo/crypto/sha256_block.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace {
@@ -79,8 +79,7 @@ Status NativeSaslClientSession::initialize() {
new SaslSCRAMClientConversationImpl<SHA256Block>(this, scramsha256ClientCache));
} else {
return Status(ErrorCodes::BadValue,
- mongoutils::str::stream() << "SASL mechanism " << mechanism
- << " is not supported");
+ str::stream() << "SASL mechanism " << mechanism << " is not supported");
}
return Status::OK();
@@ -89,7 +88,7 @@ Status NativeSaslClientSession::initialize() {
Status NativeSaslClientSession::step(StringData inputData, std::string* outputData) {
if (!_saslConversation) {
return Status(ErrorCodes::BadValue,
- mongoutils::str::stream()
+ str::stream()
<< "The client authentication session has not been properly initialized");
}
diff --git a/src/mongo/client/query_spec.h b/src/mongo/client/query_spec.h
index b421d6bca08..c115f50cd70 100644
--- a/src/mongo/client/query_spec.h
+++ b/src/mongo/client/query_spec.h
@@ -31,7 +31,7 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/client/query.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
/**
diff --git a/src/mongo/client/read_preference.cpp b/src/mongo/client/read_preference.cpp
index f574ad0ef0a..4391db7c388 100644
--- a/src/mongo/client/read_preference.cpp
+++ b/src/mongo/client/read_preference.cpp
@@ -40,7 +40,7 @@
#include "mongo/bson/bsontypes.h"
#include "mongo/bson/util/bson_extract.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/client/remote_command_targeter_rs.cpp b/src/mongo/client/remote_command_targeter_rs.cpp
index 3df6dca86a5..25a242c9042 100644
--- a/src/mongo/client/remote_command_targeter_rs.cpp
+++ b/src/mongo/client/remote_command_targeter_rs.cpp
@@ -40,8 +40,8 @@
#include "mongo/db/operation_context.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/hostandport.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/client/sasl_client_authenticate.cpp b/src/mongo/client/sasl_client_authenticate.cpp
index 6120b310678..aafc6523494 100644
--- a/src/mongo/client/sasl_client_authenticate.cpp
+++ b/src/mongo/client/sasl_client_authenticate.cpp
@@ -35,12 +35,10 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/auth/sasl_command_constants.h"
#include "mongo/util/base64.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
-using namespace mongoutils;
-
Future<void> (*saslClientAuthenticate)(auth::RunCommandHook runCommand,
const HostAndPort& hostname,
const BSONObj& saslParameters) = nullptr;
diff --git a/src/mongo/client/sasl_client_session.cpp b/src/mongo/client/sasl_client_session.cpp
index 03988c19548..4c92134a094 100644
--- a/src/mongo/client/sasl_client_session.cpp
+++ b/src/mongo/client/sasl_client_session.cpp
@@ -33,8 +33,8 @@
#include "mongo/util/allocator.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/concurrency/mutex.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/signal_handlers_synchronous.h"
+#include "mongo/util/str.h"
namespace mongo {
SaslClientSession::SaslClientSessionFactoryFn SaslClientSession::create;
diff --git a/src/mongo/client/sasl_scram_client_conversation.cpp b/src/mongo/client/sasl_scram_client_conversation.cpp
index 079b348518f..c5a4b788f32 100644
--- a/src/mongo/client/sasl_scram_client_conversation.cpp
+++ b/src/mongo/client/sasl_scram_client_conversation.cpp
@@ -37,8 +37,8 @@
#include "mongo/client/scram_client_cache.h"
#include "mongo/platform/random.h"
#include "mongo/util/base64.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/password_digest.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
namespace mongo {
@@ -57,9 +57,9 @@ StatusWith<bool> SaslSCRAMClientConversation::step(StringData inputData, std::st
case 3:
return _thirdStep(inputData, outputData);
default:
- return StatusWith<bool>(
- ErrorCodes::AuthenticationFailed,
- mongoutils::str::stream() << "Invalid SCRAM authentication step: " << _step);
+ return StatusWith<bool>(ErrorCodes::AuthenticationFailed,
+ str::stream() << "Invalid SCRAM authentication step: "
+ << _step);
}
}
diff --git a/src/mongo/client/sasl_sspi.cpp b/src/mongo/client/sasl_sspi.cpp
index 64ecf494d53..fa011a458a0 100644
--- a/src/mongo/client/sasl_sspi.cpp
+++ b/src/mongo/client/sasl_sspi.cpp
@@ -40,8 +40,8 @@
#include "mongo/base/status.h"
#include "mongo/client/sasl_sspi_options.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/text.h"
extern "C" int plain_client_plug_init(const sasl_utils_t* utils,
@@ -98,7 +98,7 @@ void HandleLastError(const sasl_utils_t* utils, DWORD errCode, const char* msg)
return;
}
- std::string buffer(mongoutils::str::stream() << "SSPI: " << msg << ": " << err);
+ std::string buffer(str::stream() << "SSPI: " << msg << ": " << err);
saslSetError(utils, buffer);
LocalFree(err);
}
@@ -481,10 +481,9 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(SaslSspiClientPlugin,
int ret = sasl_client_add_plugin(sspiPluginName, sspiClientPluginInit);
if (SASL_OK != ret) {
return Status(ErrorCodes::UnknownError,
- mongoutils::str::stream() << "could not add SASL Client SSPI plugin "
- << sspiPluginName
- << ": "
- << sasl_errstring(ret, NULL, NULL));
+ str::stream() << "could not add SASL Client SSPI plugin " << sspiPluginName
+ << ": "
+ << sasl_errstring(ret, NULL, NULL));
}
return Status::OK();
@@ -496,10 +495,9 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(SaslPlainClientPlugin,
int ret = sasl_client_add_plugin("PLAIN", plain_client_plug_init);
if (SASL_OK != ret) {
return Status(ErrorCodes::UnknownError,
- mongoutils::str::stream() << "Could not add SASL Client PLAIN plugin "
- << sspiPluginName
- << ": "
- << sasl_errstring(ret, NULL, NULL));
+ str::stream() << "Could not add SASL Client PLAIN plugin " << sspiPluginName
+ << ": "
+ << sasl_errstring(ret, NULL, NULL));
}
return Status::OK();
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 {
diff --git a/src/mongo/dbtests/mock/mock_remote_db_server.cpp b/src/mongo/dbtests/mock/mock_remote_db_server.cpp
index bac628d0755..5b6a884ba8d 100644
--- a/src/mongo/dbtests/mock/mock_remote_db_server.cpp
+++ b/src/mongo/dbtests/mock/mock_remote_db_server.cpp
@@ -38,8 +38,8 @@
#include "mongo/rpc/op_msg_rpc_impls.h"
#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/socket_exception.h"
+#include "mongo/util/str.h"
#include "mongo/util/time_support.h"
using std::string;
diff --git a/src/mongo/dbtests/multikey_paths_test.cpp b/src/mongo/dbtests/multikey_paths_test.cpp
index 0887c8e751b..df0e290fcc5 100644
--- a/src/mongo/dbtests/multikey_paths_test.cpp
+++ b/src/mongo/dbtests/multikey_paths_test.cpp
@@ -40,7 +40,7 @@
#include "mongo/db/service_context.h"
#include "mongo/dbtests/dbtests.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/dbtests/query_stage_and.cpp b/src/mongo/dbtests/query_stage_and.cpp
index 257ada87409..95a287182dd 100644
--- a/src/mongo/dbtests/query_stage_and.cpp
+++ b/src/mongo/dbtests/query_stage_and.cpp
@@ -52,7 +52,7 @@
#include "mongo/db/matcher/expression_parser.h"
#include "mongo/dbtests/dbtests.h"
#include "mongo/stdx/memory.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace QueryStageAnd {
@@ -77,7 +77,7 @@ public:
std::vector<const IndexDescriptor*> indexes;
coll->getIndexCatalog()->findIndexesByKeyPattern(&_opCtx, obj, false, &indexes);
if (indexes.empty()) {
- FAIL(mongoutils::str::stream() << "Unable to find index with key pattern " << obj);
+ FAIL(str::stream() << "Unable to find index with key pattern " << obj);
}
return indexes[0];
}
diff --git a/src/mongo/dbtests/query_stage_update.cpp b/src/mongo/dbtests/query_stage_update.cpp
index 7b8eea90d0b..c9bfa01d9f5 100644
--- a/src/mongo/dbtests/query_stage_update.cpp
+++ b/src/mongo/dbtests/query_stage_update.cpp
@@ -58,7 +58,7 @@
try { \
EXPRESSION; \
} catch (const AssertionException& e) { \
- ::mongoutils::str::stream err; \
+ ::str::stream err; \
err << "Threw an exception incorrectly: " << e.toString(); \
::mongo::unittest::TestAssertionFailure(__FILE__, __LINE__, err).stream(); \
}
diff --git a/src/mongo/embedded/api_common.h b/src/mongo/embedded/api_common.h
index a220d04846b..ae022eb9ccd 100644
--- a/src/mongo/embedded/api_common.h
+++ b/src/mongo/embedded/api_common.h
@@ -30,7 +30,7 @@
#include <string>
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
@@ -127,7 +127,7 @@ private:
public:
ReentrancyGuard() {
uassert(ErrorCodes::ReentrancyNotAllowed,
- mongoutils::str::stream() << "Reentry into library is not allowed",
+ str::stream() << "Reentry into library is not allowed",
!inLibrary());
inLibrary() = true;
}
diff --git a/src/mongo/embedded/index_builds_coordinator_embedded.cpp b/src/mongo/embedded/index_builds_coordinator_embedded.cpp
index 9609bb7d32b..f6fb6544017 100644
--- a/src/mongo/embedded/index_builds_coordinator_embedded.cpp
+++ b/src/mongo/embedded/index_builds_coordinator_embedded.cpp
@@ -37,7 +37,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/executor/network_interface_mock.cpp b/src/mongo/executor/network_interface_mock.cpp
index b3da62db96d..c702647214f 100644
--- a/src/mongo/executor/network_interface_mock.cpp
+++ b/src/mongo/executor/network_interface_mock.cpp
@@ -40,7 +40,7 @@
#include "mongo/executor/connection_pool_stats.h"
#include "mongo/stdx/functional.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/executor/remote_command_request.cpp b/src/mongo/executor/remote_command_request.cpp
index f4ef9d3d90e..65cbb3686e2 100644
--- a/src/mongo/executor/remote_command_request.cpp
+++ b/src/mongo/executor/remote_command_request.cpp
@@ -35,7 +35,7 @@
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/platform/atomic_word.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace executor {
diff --git a/src/mongo/executor/remote_command_response.cpp b/src/mongo/executor/remote_command_response.cpp
index 6432708532f..cfe23390805 100644
--- a/src/mongo/executor/remote_command_response.cpp
+++ b/src/mongo/executor/remote_command_response.cpp
@@ -33,7 +33,7 @@
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/rpc/reply_interface.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace executor {
diff --git a/src/mongo/executor/task_executor_test_common.cpp b/src/mongo/executor/task_executor_test_common.cpp
index 9f886247e98..3d2324e849e 100644
--- a/src/mongo/executor/task_executor_test_common.cpp
+++ b/src/mongo/executor/task_executor_test_common.cpp
@@ -46,7 +46,7 @@
#include "mongo/unittest/unittest.h"
#include "mongo/util/clock_source_mock.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace executor {
@@ -147,14 +147,13 @@ auto makeSetStatusOnRemoteCommandCompletionClosure(const RemoteCommandRequest* e
return [=](const TaskExecutor::RemoteCommandCallbackArgs& cbData) {
if (cbData.request != *expectedRequest) {
auto desc = [](const RemoteCommandRequest& request) -> std::string {
- return mongoutils::str::stream() << "Request(" << request.target.toString() << ", "
- << request.dbname << ", " << request.cmdObj << ')';
+ return str::stream() << "Request(" << request.target.toString() << ", "
+ << request.dbname << ", " << request.cmdObj << ')';
};
*outStatus =
Status(ErrorCodes::BadValue,
- mongoutils::str::stream() << "Actual request: " << desc(cbData.request)
- << "; expected: "
- << desc(*expectedRequest));
+ str::stream() << "Actual request: " << desc(cbData.request) << "; expected: "
+ << desc(*expectedRequest));
return;
}
*outStatus = cbData.response.status;
diff --git a/src/mongo/executor/task_executor_test_fixture.cpp b/src/mongo/executor/task_executor_test_fixture.cpp
index 48f36ef9841..b1286e600d3 100644
--- a/src/mongo/executor/task_executor_test_fixture.cpp
+++ b/src/mongo/executor/task_executor_test_fixture.cpp
@@ -36,7 +36,7 @@
#include "mongo/executor/remote_command_request.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 executor {
diff --git a/src/mongo/idl/idl_parser.cpp b/src/mongo/idl/idl_parser.cpp
index a55de9283f6..c28a17c16c0 100644
--- a/src/mongo/idl/idl_parser.cpp
+++ b/src/mongo/idl/idl_parser.cpp
@@ -35,7 +35,7 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/command_generic_argument.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/logger/log_function_test.cpp b/src/mongo/logger/log_function_test.cpp
index 6fbcabd6b28..f05616161f5 100644
--- a/src/mongo/logger/log_function_test.cpp
+++ b/src/mongo/logger/log_function_test.cpp
@@ -42,7 +42,7 @@
#include "mongo/logger/log_component.h"
#include "mongo/logger/message_event_utf8_encoder.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
using namespace mongo::logger;
diff --git a/src/mongo/logger/log_test.cpp b/src/mongo/logger/log_test.cpp
index ffdf16815e5..836e82bb8ea 100644
--- a/src/mongo/logger/log_test.cpp
+++ b/src/mongo/logger/log_test.cpp
@@ -49,7 +49,7 @@
#include "mongo/unittest/unittest.h"
#include "mongo/util/concurrency/thread_name.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
using namespace mongo::logger;
diff --git a/src/mongo/logger/parse_log_component_settings.cpp b/src/mongo/logger/parse_log_component_settings.cpp
index 281fe6f07dd..5c9f1688f32 100644
--- a/src/mongo/logger/parse_log_component_settings.cpp
+++ b/src/mongo/logger/parse_log_component_settings.cpp
@@ -41,7 +41,7 @@
#include "mongo/logger/log_component.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/stringutils.h"
namespace mongo {
diff --git a/src/mongo/logger/ramlog.cpp b/src/mongo/logger/ramlog.cpp
index 80115fa236c..a1f32e26726 100644
--- a/src/mongo/logger/ramlog.cpp
+++ b/src/mongo/logger/ramlog.cpp
@@ -35,7 +35,7 @@
#include "mongo/base/status.h"
#include "mongo/logger/message_event_utf8_encoder.h"
#include "mongo/util/map_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/logger/rotatable_file_writer.cpp b/src/mongo/logger/rotatable_file_writer.cpp
index de59a408d63..fa22a7f1e4a 100644
--- a/src/mongo/logger/rotatable_file_writer.cpp
+++ b/src/mongo/logger/rotatable_file_writer.cpp
@@ -36,7 +36,7 @@
#include <fstream>
#include "mongo/base/string_data.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace logger {
@@ -211,33 +211,29 @@ Status RotatableFileWriter::Use::rotate(bool renameOnRotate, const std::string&
if (renameOnRotate) {
try {
if (boost::filesystem::exists(renameTarget)) {
- return Status(
- ErrorCodes::FileRenameFailed,
- mongoutils::str::stream() << "Renaming file " << _writer->_fileName
- << " to "
- << renameTarget
- << " failed; destination already exists");
+ return Status(ErrorCodes::FileRenameFailed,
+ str::stream() << "Renaming file " << _writer->_fileName << " to "
+ << renameTarget
+ << " failed; destination already exists");
}
} catch (const std::exception& e) {
- return Status(
- ErrorCodes::FileRenameFailed,
- mongoutils::str::stream() << "Renaming file " << _writer->_fileName << " to "
- << renameTarget
- << " failed; Cannot verify whether destination "
- "already exists: "
- << e.what());
+ return Status(ErrorCodes::FileRenameFailed,
+ str::stream() << "Renaming file " << _writer->_fileName << " to "
+ << renameTarget
+ << " failed; Cannot verify whether destination "
+ "already exists: "
+ << e.what());
}
boost::system::error_code ec;
boost::filesystem::rename(_writer->_fileName, renameTarget, ec);
if (ec) {
return Status(ErrorCodes::FileRenameFailed,
- mongoutils::str::stream() << "Failed to rename \""
- << _writer->_fileName
- << "\" to \""
- << renameTarget
- << "\": "
- << ec.message());
+ str::stream() << "Failed to rename \"" << _writer->_fileName
+ << "\" to \""
+ << renameTarget
+ << "\": "
+ << ec.message());
// TODO(schwerin): Make errnoWithDescription() available in the logger library, and
// use it here.
}
@@ -249,13 +245,11 @@ Status RotatableFileWriter::Use::rotate(bool renameOnRotate, const std::string&
Status RotatableFileWriter::Use::status() {
if (!_writer->_stream) {
return Status(ErrorCodes::FileNotOpen,
- mongoutils::str::stream() << "File \"" << _writer->_fileName
- << "\" not open");
+ str::stream() << "File \"" << _writer->_fileName << "\" not open");
}
if (_writer->_stream->fail()) {
return Status(ErrorCodes::FileStreamFailed,
- mongoutils::str::stream() << "File \"" << _writer->_fileName
- << "\" in failed state");
+ str::stream() << "File \"" << _writer->_fileName << "\" in failed state");
}
return Status::OK();
}
diff --git a/src/mongo/platform/shared_library_posix.cpp b/src/mongo/platform/shared_library_posix.cpp
index 2dad1c2a4da..16728da3d12 100644
--- a/src/mongo/platform/shared_library_posix.cpp
+++ b/src/mongo/platform/shared_library_posix.cpp
@@ -38,7 +38,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/platform/shared_library_windows.cpp b/src/mongo/platform/shared_library_windows.cpp
index ebaa37ad441..504b366ab2e 100644
--- a/src/mongo/platform/shared_library_windows.cpp
+++ b/src/mongo/platform/shared_library_windows.cpp
@@ -36,7 +36,7 @@
#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/text.h"
namespace mongo {
diff --git a/src/mongo/rpc/factory.cpp b/src/mongo/rpc/factory.cpp
index 475bcc6191e..50459f68e2a 100644
--- a/src/mongo/rpc/factory.cpp
+++ b/src/mongo/rpc/factory.cpp
@@ -40,7 +40,7 @@
#include "mongo/rpc/protocol.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 rpc {
diff --git a/src/mongo/rpc/get_status_from_command_result.cpp b/src/mongo/rpc/get_status_from_command_result.cpp
index d2474efc316..b63ae786832 100644
--- a/src/mongo/rpc/get_status_from_command_result.cpp
+++ b/src/mongo/rpc/get_status_from_command_result.cpp
@@ -36,7 +36,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/jsobj.h"
#include "mongo/rpc/write_concern_error_detail.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
@@ -55,7 +55,7 @@ Status getStatusFromCommandResult(const BSONObj& result) {
if (okElement.eoo() && dollarErrElement.eoo()) {
return Status(ErrorCodes::CommandResultSchemaViolation,
- mongoutils::str::stream() << "No \"ok\" field in command result " << result);
+ str::stream() << "No \"ok\" field in command result " << result);
}
if (okElement.trueValue()) {
return Status::OK();
diff --git a/src/mongo/rpc/legacy_reply.cpp b/src/mongo/rpc/legacy_reply.cpp
index 8a1e56ae051..75c69c16d9f 100644
--- a/src/mongo/rpc/legacy_reply.cpp
+++ b/src/mongo/rpc/legacy_reply.cpp
@@ -39,7 +39,7 @@
#include "mongo/rpc/metadata.h"
#include "mongo/rpc/object_check.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace rpc {
diff --git a/src/mongo/rpc/legacy_reply_builder.cpp b/src/mongo/rpc/legacy_reply_builder.cpp
index c0f68c0d800..9fc8ad65a8b 100644
--- a/src/mongo/rpc/legacy_reply_builder.cpp
+++ b/src/mongo/rpc/legacy_reply_builder.cpp
@@ -40,7 +40,7 @@
#include "mongo/s/stale_exception.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 rpc {
diff --git a/src/mongo/rpc/message.h b/src/mongo/rpc/message.h
index 6f7c7c5663a..3689f2b2512 100644
--- a/src/mongo/rpc/message.h
+++ b/src/mongo/rpc/message.h
@@ -35,7 +35,7 @@
#include "mongo/base/data_view.h"
#include "mongo/base/encoded_value_storage.h"
#include "mongo/base/static_assert.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/rpc/metadata/client_metadata.cpp b/src/mongo/rpc/metadata/client_metadata.cpp
index 649a3f85e0e..d2199c13016 100644
--- a/src/mongo/rpc/metadata/client_metadata.cpp
+++ b/src/mongo/rpc/metadata/client_metadata.cpp
@@ -43,8 +43,8 @@
#include "mongo/db/operation_context.h"
#include "mongo/s/is_mongos.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/processinfo.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/rpc/metadata/sharding_metadata.cpp b/src/mongo/rpc/metadata/sharding_metadata.cpp
index a7eeca768c2..9c62f4be82b 100644
--- a/src/mongo/rpc/metadata/sharding_metadata.cpp
+++ b/src/mongo/rpc/metadata/sharding_metadata.cpp
@@ -37,7 +37,7 @@
#include "mongo/db/jsobj.h"
#include "mongo/db/repl/bson_extract_optime.h"
#include "mongo/db/repl/optime.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace rpc {
diff --git a/src/mongo/rpc/protocol.cpp b/src/mongo/rpc/protocol.cpp
index 6d9359ec366..a578d342b00 100644
--- a/src/mongo/rpc/protocol.cpp
+++ b/src/mongo/rpc/protocol.cpp
@@ -38,7 +38,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/wire_version.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace rpc {
diff --git a/src/mongo/rpc/write_concern_error_detail.cpp b/src/mongo/rpc/write_concern_error_detail.cpp
index e5962000e56..aa134a9f1a0 100644
--- a/src/mongo/rpc/write_concern_error_detail.cpp
+++ b/src/mongo/rpc/write_concern_error_detail.cpp
@@ -32,7 +32,7 @@
#include "mongo/rpc/write_concern_error_detail.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/s/balancer_configuration.cpp b/src/mongo/s/balancer_configuration.cpp
index 7fe996415f5..4f863319a38 100644
--- a/src/mongo/s/balancer_configuration.cpp
+++ b/src/mongo/s/balancer_configuration.cpp
@@ -42,7 +42,7 @@
#include "mongo/s/catalog/sharding_catalog_client.h"
#include "mongo/s/grid.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/s/catalog/dist_lock_catalog_mock.cpp b/src/mongo/s/catalog/dist_lock_catalog_mock.cpp
index 3db467734bc..f2eca5abcf7 100644
--- a/src/mongo/s/catalog/dist_lock_catalog_mock.cpp
+++ b/src/mongo/s/catalog/dist_lock_catalog_mock.cpp
@@ -36,7 +36,7 @@
#include "mongo/s/catalog/type_lockpings.h"
#include "mongo/s/catalog/type_locks.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/s/catalog/dist_lock_manager_mock.cpp b/src/mongo/s/catalog/dist_lock_manager_mock.cpp
index c110b63df98..ceb0611669b 100644
--- a/src/mongo/s/catalog/dist_lock_manager_mock.cpp
+++ b/src/mongo/s/catalog/dist_lock_manager_mock.cpp
@@ -36,7 +36,7 @@
#include <algorithm>
#include "mongo/unittest/unittest.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/s/catalog/replset_dist_lock_manager.cpp b/src/mongo/s/catalog/replset_dist_lock_manager.cpp
index 91b2013541c..5c24eb292b2 100644
--- a/src/mongo/s/catalog/replset_dist_lock_manager.cpp
+++ b/src/mongo/s/catalog/replset_dist_lock_manager.cpp
@@ -48,7 +48,7 @@
#include "mongo/util/concurrency/thread_name.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"
#include "mongo/util/timer.h"
diff --git a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
index 32b352edcaf..063069922b0 100644
--- a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
@@ -69,8 +69,8 @@
#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/net/hostandport.h"
+#include "mongo/util/str.h"
#include "mongo/util/time_support.h"
namespace mongo {
diff --git a/src/mongo/s/catalog/type_changelog.cpp b/src/mongo/s/catalog/type_changelog.cpp
index b61b74a1436..01faa0396fd 100644
--- a/src/mongo/s/catalog/type_changelog.cpp
+++ b/src/mongo/s/catalog/type_changelog.cpp
@@ -36,7 +36,7 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/util/bson_extract.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/s/catalog/type_chunk.cpp b/src/mongo/s/catalog/type_chunk.cpp
index 0d7e2fe36fa..1e2d5dff754 100644
--- a/src/mongo/s/catalog/type_chunk.cpp
+++ b/src/mongo/s/catalog/type_chunk.cpp
@@ -39,7 +39,7 @@
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/bson/util/bson_extract.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/s/catalog/type_config_version.cpp b/src/mongo/s/catalog/type_config_version.cpp
index 4c7182caff7..ec777b1f9fc 100644
--- a/src/mongo/s/catalog/type_config_version.cpp
+++ b/src/mongo/s/catalog/type_config_version.cpp
@@ -35,7 +35,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/s/catalog/config_server_version.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/s/catalog/type_lockpings.cpp b/src/mongo/s/catalog/type_lockpings.cpp
index 27917d78cee..cad8bb3d597 100644
--- a/src/mongo/s/catalog/type_lockpings.cpp
+++ b/src/mongo/s/catalog/type_lockpings.cpp
@@ -33,7 +33,7 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/util/bson_extract.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
const NamespaceString LockpingsType::ConfigNS("config.lockpings");
diff --git a/src/mongo/s/catalog/type_locks.cpp b/src/mongo/s/catalog/type_locks.cpp
index 2b5358e9cdb..707487ede7a 100644
--- a/src/mongo/s/catalog/type_locks.cpp
+++ b/src/mongo/s/catalog/type_locks.cpp
@@ -36,7 +36,7 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/util/bson_extract.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
const NamespaceString LocksType::ConfigNS("config.locks");
diff --git a/src/mongo/s/catalog/type_mongos.cpp b/src/mongo/s/catalog/type_mongos.cpp
index bd65228bacb..3e910cce931 100644
--- a/src/mongo/s/catalog/type_mongos.cpp
+++ b/src/mongo/s/catalog/type_mongos.cpp
@@ -33,7 +33,7 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/util/bson_extract.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
const NamespaceString MongosType::ConfigNS("config.mongos");
diff --git a/src/mongo/s/catalog/type_shard.cpp b/src/mongo/s/catalog/type_shard.cpp
index f26e8dc3433..68fea9768eb 100644
--- a/src/mongo/s/catalog/type_shard.cpp
+++ b/src/mongo/s/catalog/type_shard.cpp
@@ -37,7 +37,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/s/grid.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/s/catalog/type_tags.cpp b/src/mongo/s/catalog/type_tags.cpp
index 31baa2d9ae3..4f949c5b754 100644
--- a/src/mongo/s/catalog/type_tags.cpp
+++ b/src/mongo/s/catalog/type_tags.cpp
@@ -37,7 +37,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/s/catalog/type_chunk.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/s/chunk.cpp b/src/mongo/s/chunk.cpp
index 3e399649c48..6524460ad41 100644
--- a/src/mongo/s/chunk.cpp
+++ b/src/mongo/s/chunk.cpp
@@ -35,7 +35,7 @@
#include "mongo/platform/random.h"
#include "mongo/s/chunk_writes_tracker.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/chunk_manager_refresh_bm.cpp b/src/mongo/s/chunk_manager_refresh_bm.cpp
index fb62dec8d12..3e02667abf6 100644
--- a/src/mongo/s/chunk_manager_refresh_bm.cpp
+++ b/src/mongo/s/chunk_manager_refresh_bm.cpp
@@ -37,7 +37,7 @@
#include "mongo/platform/random.h"
#include "mongo/s/chunk_manager.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/s/chunk_version.cpp b/src/mongo/s/chunk_version.cpp
index edac9a18481..62edcdb6404 100644
--- a/src/mongo/s/chunk_version.cpp
+++ b/src/mongo/s/chunk_version.cpp
@@ -31,7 +31,7 @@
#include "mongo/s/chunk_version.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/client/shard_registry.cpp b/src/mongo/s/client/shard_registry.cpp
index 75b14ac60e2..54b609b92f5 100644
--- a/src/mongo/s/client/shard_registry.cpp
+++ b/src/mongo/s/client/shard_registry.cpp
@@ -60,8 +60,8 @@
#include "mongo/util/concurrency/with_lock.h"
#include "mongo/util/log.h"
#include "mongo/util/map_util.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/scopeguard.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/client/shard_remote.cpp b/src/mongo/s/client/shard_remote.cpp
index 76e0a98a8c8..84275dcd102 100644
--- a/src/mongo/s/client/shard_remote.cpp
+++ b/src/mongo/s/client/shard_remote.cpp
@@ -53,7 +53,7 @@
#include "mongo/s/client/shard_remote_gen.h"
#include "mongo/s/grid.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/s/client/sharding_network_connection_hook.cpp b/src/mongo/s/client/sharding_network_connection_hook.cpp
index 5dc6dfa97ad..07251a83040 100644
--- a/src/mongo/s/client/sharding_network_connection_hook.cpp
+++ b/src/mongo/s/client/sharding_network_connection_hook.cpp
@@ -40,8 +40,8 @@
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
#include "mongo/s/request_types/set_shard_version_request.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/hostandport.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/cluster_identity_loader_test.cpp b/src/mongo/s/cluster_identity_loader_test.cpp
index 015f9676011..a1083fc9350 100644
--- a/src/mongo/s/cluster_identity_loader_test.cpp
+++ b/src/mongo/s/cluster_identity_loader_test.cpp
@@ -48,7 +48,7 @@
#include "mongo/s/sharding_router_test_fixture.h"
#include "mongo/stdx/future.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/s/cluster_last_error_info_test.cpp b/src/mongo/s/cluster_last_error_info_test.cpp
index 276377dc1d3..3822a3e913b 100644
--- a/src/mongo/s/cluster_last_error_info_test.cpp
+++ b/src/mongo/s/cluster_last_error_info_test.cpp
@@ -40,7 +40,7 @@
#include "mongo/s/sharding_router_test_fixture.h"
#include "mongo/stdx/future.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/s/commands/cluster_kill_op.cpp b/src/mongo/s/commands/cluster_kill_op.cpp
index a25dc0951e2..91cdc8f1e91 100644
--- a/src/mongo/s/commands/cluster_kill_op.cpp
+++ b/src/mongo/s/commands/cluster_kill_op.cpp
@@ -47,7 +47,7 @@
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.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/s/commands/cluster_set_feature_compatibility_version_cmd.cpp b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp
index c7242dbd692..570551c7352 100644
--- a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp
+++ b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp
@@ -37,7 +37,7 @@
#include "mongo/s/client/shard.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/commands/document_shard_key_update_util.cpp b/src/mongo/s/commands/document_shard_key_update_util.cpp
index f27c73b810e..86ae6ecf1f2 100644
--- a/src/mongo/s/commands/document_shard_key_update_util.cpp
+++ b/src/mongo/s/commands/document_shard_key_update_util.cpp
@@ -38,7 +38,7 @@
#include "mongo/s/write_ops/batched_command_response.h"
#include "mongo/s/write_ops/cluster_write.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/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp
index 9abe4ca80a0..1587c95c491 100644
--- a/src/mongo/s/commands/strategy.cpp
+++ b/src/mongo/s/commands/strategy.cpp
@@ -81,8 +81,8 @@
#include "mongo/s/transaction_router.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/timer.h"
namespace mongo {
diff --git a/src/mongo/s/mongos_options.cpp b/src/mongo/s/mongos_options.cpp
index 80b77c6dbf9..0cfa74fb7d0 100644
--- a/src/mongo/s/mongos_options.cpp
+++ b/src/mongo/s/mongos_options.cpp
@@ -45,10 +45,10 @@
#include "mongo/db/server_options_server_helpers.h"
#include "mongo/s/version_mongos.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_options.h"
#include "mongo/util/startup_test.h"
+#include "mongo/util/str.h"
#include "mongo/util/stringutils.h"
namespace mongo {
diff --git a/src/mongo/s/query/cluster_cursor_manager.cpp b/src/mongo/s/query/cluster_cursor_manager.cpp
index 7c67143a69b..b25c26946cf 100644
--- a/src/mongo/s/query/cluster_cursor_manager.cpp
+++ b/src/mongo/s/query/cluster_cursor_manager.cpp
@@ -39,7 +39,7 @@
#include "mongo/db/logical_session_cache.h"
#include "mongo/util/clock_source.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/request_types/add_shard_request_type.cpp b/src/mongo/s/request_types/add_shard_request_type.cpp
index 4b997795316..95ce8b0c8bb 100644
--- a/src/mongo/s/request_types/add_shard_request_type.cpp
+++ b/src/mongo/s/request_types/add_shard_request_type.cpp
@@ -33,7 +33,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/server_options.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/request_types/set_shard_version_request.cpp b/src/mongo/s/request_types/set_shard_version_request.cpp
index 625e8828e1e..f05fa4093f3 100644
--- a/src/mongo/s/request_types/set_shard_version_request.cpp
+++ b/src/mongo/s/request_types/set_shard_version_request.cpp
@@ -37,7 +37,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/query/query_request.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/s/request_types/update_zone_key_range_request_type.cpp b/src/mongo/s/request_types/update_zone_key_range_request_type.cpp
index 877f80b1ec8..350489aa242 100644
--- a/src/mongo/s/request_types/update_zone_key_range_request_type.cpp
+++ b/src/mongo/s/request_types/update_zone_key_range_request_type.cpp
@@ -106,12 +106,12 @@ StatusWith<UpdateZoneKeyRangeRequest> UpdateZoneKeyRangeRequest::_parseFromComma
isRemove = true;
} else {
return {ErrorCodes::TypeMismatch,
- mongoutils::str::stream() << "\"" << kZoneName << "\" had the wrong type. Expected "
- << typeName(String)
- << " or "
- << typeName(jstNULL)
- << ", found "
- << typeName(zoneElem.type())};
+ str::stream() << "\"" << kZoneName << "\" had the wrong type. Expected "
+ << typeName(String)
+ << " or "
+ << typeName(jstNULL)
+ << ", found "
+ << typeName(zoneElem.type())};
}
if (isRemove) {
diff --git a/src/mongo/s/shard_key_pattern.cpp b/src/mongo/s/shard_key_pattern.cpp
index 973fb44079c..9be98ba15b6 100644
--- a/src/mongo/s/shard_key_pattern.cpp
+++ b/src/mongo/s/shard_key_pattern.cpp
@@ -40,7 +40,7 @@
#include "mongo/db/matcher/extensions_callback_noop.h"
#include "mongo/db/query/canonical_query.h"
#include "mongo/db/update/path_support.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/s/shard_util.cpp b/src/mongo/s/shard_util.cpp
index 038881647a3..59faf424f90 100644
--- a/src/mongo/s/shard_util.cpp
+++ b/src/mongo/s/shard_util.cpp
@@ -42,7 +42,7 @@
#include "mongo/s/grid.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace shardutil {
diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp
index ed2ab869604..6982c7a4687 100644
--- a/src/mongo/s/sharding_initialization.cpp
+++ b/src/mongo/s/sharding_initialization.cpp
@@ -69,8 +69,8 @@
#include "mongo/util/concurrency/thread_pool.h"
#include "mongo/util/exit.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/socket_utils.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/sharding_uptime_reporter.cpp b/src/mongo/s/sharding_uptime_reporter.cpp
index c83c965836b..bcd18bf07e8 100644
--- a/src/mongo/s/sharding_uptime_reporter.cpp
+++ b/src/mongo/s/sharding_uptime_reporter.cpp
@@ -41,9 +41,9 @@
#include "mongo/util/concurrency/idle_thread_block.h"
#include "mongo/util/exit.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/hostname_canonicalization.h"
#include "mongo/util/net/socket_utils.h"
+#include "mongo/util/str.h"
#include "mongo/util/version.h"
namespace mongo {
diff --git a/src/mongo/s/write_ops/batched_command_response.cpp b/src/mongo/s/write_ops/batched_command_response.cpp
index c1e3d14127b..9ec01a62e61 100644
--- a/src/mongo/s/write_ops/batched_command_response.cpp
+++ b/src/mongo/s/write_ops/batched_command_response.cpp
@@ -36,14 +36,14 @@
#include "mongo/db/field_parser.h"
#include "mongo/db/repl/bson_extract_optime.h"
#include "mongo/rpc/get_status_from_command_result.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
using std::unique_ptr;
using std::string;
-using mongoutils::str::stream;
+using str::stream;
const BSONField<long long> BatchedCommandResponse::n("n", 0);
const BSONField<long long> BatchedCommandResponse::nModified("nModified", 0);
diff --git a/src/mongo/s/write_ops/batched_upsert_detail.cpp b/src/mongo/s/write_ops/batched_upsert_detail.cpp
index 15759c65d27..e455f291cbd 100644
--- a/src/mongo/s/write_ops/batched_upsert_detail.cpp
+++ b/src/mongo/s/write_ops/batched_upsert_detail.cpp
@@ -30,7 +30,7 @@
#include "mongo/s/write_ops/batched_upsert_detail.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/s/write_ops/chunk_manager_targeter.cpp b/src/mongo/s/write_ops/chunk_manager_targeter.cpp
index 8bec208263a..eb490dc6dba 100644
--- a/src/mongo/s/write_ops/chunk_manager_targeter.cpp
+++ b/src/mongo/s/write_ops/chunk_manager_targeter.cpp
@@ -41,7 +41,7 @@
#include "mongo/s/grid.h"
#include "mongo/s/shard_key_pattern.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/s/write_ops/cluster_write.cpp b/src/mongo/s/write_ops/cluster_write.cpp
index 04e1d30d002..3955cf5bce2 100644
--- a/src/mongo/s/write_ops/cluster_write.cpp
+++ b/src/mongo/s/write_ops/cluster_write.cpp
@@ -50,7 +50,7 @@
#include "mongo/s/shard_util.h"
#include "mongo/s/write_ops/chunk_manager_targeter.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/s/write_ops/write_error_detail.cpp b/src/mongo/s/write_ops/write_error_detail.cpp
index d5d46769c39..5d4e5b84cfc 100644
--- a/src/mongo/s/write_ops/write_error_detail.cpp
+++ b/src/mongo/s/write_ops/write_error_detail.cpp
@@ -32,7 +32,7 @@
#include "mongo/s/write_ops/write_error_detail.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/scripting/bson_template_evaluator.cpp b/src/mongo/scripting/bson_template_evaluator.cpp
index d361da352a7..c46015f3fe4 100644
--- a/src/mongo/scripting/bson_template_evaluator.cpp
+++ b/src/mongo/scripting/bson_template_evaluator.cpp
@@ -34,7 +34,7 @@
#include "mongo/base/static_assert.h"
#include "mongo/util/map_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/scripting/mozjs/bindata.cpp b/src/mongo/scripting/mozjs/bindata.cpp
index 80b8bed827b..46a91e1ceb3 100644
--- a/src/mongo/scripting/mozjs/bindata.cpp
+++ b/src/mongo/scripting/mozjs/bindata.cpp
@@ -43,7 +43,7 @@
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
#include "mongo/util/base64.h"
#include "mongo/util/hex.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include "mongo/util/uuid.h"
namespace mongo {
diff --git a/src/mongo/scripting/mozjs/code.cpp b/src/mongo/scripting/mozjs/code.cpp
index 21fd04fe00f..957a6e5feb9 100644
--- a/src/mongo/scripting/mozjs/code.cpp
+++ b/src/mongo/scripting/mozjs/code.cpp
@@ -37,7 +37,7 @@
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
#include "mongo/stdx/memory.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/scripting/mozjs/dbpointer.cpp b/src/mongo/scripting/mozjs/dbpointer.cpp
index 9fba4e5ca73..467ae2359b5 100644
--- a/src/mongo/scripting/mozjs/dbpointer.cpp
+++ b/src/mongo/scripting/mozjs/dbpointer.cpp
@@ -35,7 +35,7 @@
#include "mongo/scripting/mozjs/internedstring.h"
#include "mongo/scripting/mozjs/objectwrapper.h"
#include "mongo/scripting/mozjs/valuereader.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp
index 5b0d05c0d29..4bf7815e924 100644
--- a/src/mongo/scripting/mozjs/implscope.cpp
+++ b/src/mongo/scripting/mozjs/implscope.cpp
@@ -55,8 +55,6 @@
#define __has_feature(x) 0
#endif
-using namespace mongoutils;
-
namespace mongo {
// Generated symbols for JS files
diff --git a/src/mongo/scripting/mozjs/nativefunction.cpp b/src/mongo/scripting/mozjs/nativefunction.cpp
index b1c2ac1a032..a23b7174311 100644
--- a/src/mongo/scripting/mozjs/nativefunction.cpp
+++ b/src/mongo/scripting/mozjs/nativefunction.cpp
@@ -38,7 +38,7 @@
#include "mongo/scripting/mozjs/valuereader.h"
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/scripting/mozjs/numberdecimal.cpp b/src/mongo/scripting/mozjs/numberdecimal.cpp
index 89f3e98181f..58f923271f3 100644
--- a/src/mongo/scripting/mozjs/numberdecimal.cpp
+++ b/src/mongo/scripting/mozjs/numberdecimal.cpp
@@ -37,7 +37,7 @@
#include "mongo/scripting/mozjs/valuereader.h"
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
namespace mongo {
diff --git a/src/mongo/scripting/mozjs/numberint.cpp b/src/mongo/scripting/mozjs/numberint.cpp
index 62b334c91f0..97f11ed66ca 100644
--- a/src/mongo/scripting/mozjs/numberint.cpp
+++ b/src/mongo/scripting/mozjs/numberint.cpp
@@ -36,7 +36,7 @@
#include "mongo/scripting/mozjs/valuereader.h"
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/scripting/mozjs/numberlong.cpp b/src/mongo/scripting/mozjs/numberlong.cpp
index c72873ba4bf..32163e6c31e 100644
--- a/src/mongo/scripting/mozjs/numberlong.cpp
+++ b/src/mongo/scripting/mozjs/numberlong.cpp
@@ -40,8 +40,8 @@
#include "mongo/scripting/mozjs/valuereader.h"
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/represent_as.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
namespace mongo {
diff --git a/src/mongo/scripting/mozjs/oid.cpp b/src/mongo/scripting/mozjs/oid.cpp
index 8f3be548f27..f70d92265f5 100644
--- a/src/mongo/scripting/mozjs/oid.cpp
+++ b/src/mongo/scripting/mozjs/oid.cpp
@@ -37,7 +37,7 @@
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
#include "mongo/stdx/memory.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/scripting/mozjs/session.cpp b/src/mongo/scripting/mozjs/session.cpp
index 46a4ed8eff7..d1617892a4c 100644
--- a/src/mongo/scripting/mozjs/session.cpp
+++ b/src/mongo/scripting/mozjs/session.cpp
@@ -40,7 +40,7 @@
#include "mongo/scripting/mozjs/valuereader.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/scripting/mozjs/timestamp.cpp b/src/mongo/scripting/mozjs/timestamp.cpp
index 58f9c215d77..88f9331bef3 100644
--- a/src/mongo/scripting/mozjs/timestamp.cpp
+++ b/src/mongo/scripting/mozjs/timestamp.cpp
@@ -40,7 +40,7 @@
#include "mongo/scripting/mozjs/valuereader.h"
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/scripting/mozjs/uri.cpp b/src/mongo/scripting/mozjs/uri.cpp
index 81843bed885..f381eae9298 100644
--- a/src/mongo/scripting/mozjs/uri.cpp
+++ b/src/mongo/scripting/mozjs/uri.cpp
@@ -41,7 +41,7 @@
#include "mongo/scripting/mozjs/valuewriter.h"
#include "mongo/scripting/mozjs/wrapconstrainedmethod.h"
#include "mongo/stdx/memory.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace mozjs {
diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp
index 0770131246f..2b09ed443a5 100644
--- a/src/mongo/shell/bench.cpp
+++ b/src/mongo/shell/bench.cpp
@@ -779,8 +779,7 @@ void BenchRunState::waitForState(State awaitedState) {
}
break;
default:
- msgasserted(16152,
- mongoutils::str::stream() << "Cannot wait for state " << awaitedState);
+ msgasserted(16152, str::stream() << "Cannot wait for state " << awaitedState);
}
}
diff --git a/src/mongo/shell/shell_options.cpp b/src/mongo/shell/shell_options.cpp
index 857a6003ac1..bd20f6bd632 100644
--- a/src/mongo/shell/shell_options.cpp
+++ b/src/mongo/shell/shell_options.cpp
@@ -47,9 +47,9 @@
#include "mongo/shell/shell_utils.h"
#include "mongo/transport/message_compressor_registry.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_options.h"
+#include "mongo/util/str.h"
#include "mongo/util/version.h"
namespace mongo {
@@ -177,7 +177,7 @@ Status storeMongoShellOptions(const moe::Environment& params,
if (params.count("writeMode")) {
std::string mode = params["writeMode"].as<string>();
if (mode != "commands" && mode != "legacy" && mode != "compatibility") {
- uasserted(17396, mongoutils::str::stream() << "Unknown writeMode option: " << mode);
+ uasserted(17396, str::stream() << "Unknown writeMode option: " << mode);
}
shellGlobalParams.writeMode = mode;
}
@@ -185,10 +185,8 @@ Status storeMongoShellOptions(const moe::Environment& params,
std::string mode = params["readMode"].as<string>();
if (mode != "commands" && mode != "compatibility" && mode != "legacy") {
uasserted(17397,
- mongoutils::str::stream()
- << "Unknown readMode option: '"
- << mode
- << "'. Valid modes are: {commands, compatibility, legacy}");
+ str::stream() << "Unknown readMode option: '" << mode
+ << "'. Valid modes are: {commands, compatibility, legacy}");
}
shellGlobalParams.readMode = mode;
}
diff --git a/src/mongo/shell/shell_utils_extended.cpp b/src/mongo/shell/shell_utils_extended.cpp
index 1278541cec6..2db4d7713a3 100644
--- a/src/mongo/shell/shell_utils_extended.cpp
+++ b/src/mongo/shell/shell_utils_extended.cpp
@@ -45,10 +45,10 @@
#include "mongo/util/file.h"
#include "mongo/util/log.h"
#include "mongo/util/md5.hpp"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/socket_utils.h"
#include "mongo/util/password.h"
#include "mongo/util/scopeguard.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
namespace mongo {
@@ -140,7 +140,7 @@ BSONObj cd(const BSONObj& args, void* data) {
return BSONObj();
}
#endif
- uasserted(16832, mongoutils::str::stream() << "cd command failed: " << errnoWithDescription());
+ uasserted(16832, str::stream() << "cd command failed: " << errnoWithDescription());
return BSONObj();
}
diff --git a/src/mongo/tools/bridge.cpp b/src/mongo/tools/bridge.cpp
index 8daba01b9c7..4cce5d997b8 100644
--- a/src/mongo/tools/bridge.cpp
+++ b/src/mongo/tools/bridge.cpp
@@ -56,9 +56,9 @@
#include "mongo/util/assert_util.h"
#include "mongo/util/exit.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/quick_exit.h"
#include "mongo/util/signal_handlers.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
#include "mongo/util/time_support.h"
#include "mongo/util/timer.h"
diff --git a/src/mongo/tools/bridge_commands.cpp b/src/mongo/tools/bridge_commands.cpp
index 1973183e3f9..a94153904d4 100644
--- a/src/mongo/tools/bridge_commands.cpp
+++ b/src/mongo/tools/bridge_commands.cpp
@@ -36,8 +36,8 @@
#include "mongo/base/status_with.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/util/bson_extract.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/hostandport.h"
+#include "mongo/util/str.h"
#include "mongo/util/string_map.h"
namespace mongo {
diff --git a/src/mongo/tools/mongoebench_options.cpp b/src/mongo/tools/mongoebench_options.cpp
index 501966bad54..b4f25b89cf5 100644
--- a/src/mongo/tools/mongoebench_options.cpp
+++ b/src/mongo/tools/mongoebench_options.cpp
@@ -40,8 +40,8 @@
#include "mongo/db/storage/storage_options.h"
#include "mongo/platform/random.h"
#include "mongo/shell/bench.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/options_parser/startup_options.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/transport/transport_layer_asio.cpp b/src/mongo/transport/transport_layer_asio.cpp
index 1a4aeafea19..6e4c457d3c1 100644
--- a/src/mongo/transport/transport_layer_asio.cpp
+++ b/src/mongo/transport/transport_layer_asio.cpp
@@ -343,7 +343,7 @@ public:
private:
boost::optional<EndpointVector> _checkForUnixSocket(const HostAndPort& peer) {
#ifndef _WIN32
- if (mongoutils::str::contains(peer.host(), '/')) {
+ if (str::contains(peer.host(), '/')) {
asio::local::stream_protocol::endpoint ep(peer.host());
return EndpointVector{WrappedEndpoint(ep)};
}
diff --git a/src/mongo/unittest/temp_dir.cpp b/src/mongo/unittest/temp_dir.cpp
index 19ab9b5d077..a4a91fa8a90 100644
--- a/src/mongo/unittest/temp_dir.cpp
+++ b/src/mongo/unittest/temp_dir.cpp
@@ -38,9 +38,9 @@
#include "mongo/base/init.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.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 {
@@ -48,7 +48,6 @@ namespace mongo {
using std::string;
namespace unittest {
-namespace str = mongoutils::str;
namespace moe = mongo::optionenvironment;
namespace {
diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h
index 204443b9708..d00338348a9 100644
--- a/src/mongo/unittest/unittest.h
+++ b/src/mongo/unittest/unittest.h
@@ -49,7 +49,7 @@
#include "mongo/unittest/bson_test_util.h"
#include "mongo/unittest/unittest_helpers.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
/**
* Fail unconditionally, reporting the given message.
@@ -206,7 +206,7 @@
std::string myString(BIG_STRING); \
std::string myContains(CONTAINS); \
if (myString.find(myContains) == std::string::npos) { \
- ::mongoutils::str::stream err; \
+ ::mongo::str::stream err; \
err << "Expected to find " #CONTAINS " (" << myContains << ") in " #BIG_STRING " (" \
<< myString << ")"; \
::mongo::unittest::TestAssertionFailure(__FILE__, __LINE__, err).stream(); \
diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp
index 648a1a67607..2167b2849ec 100644
--- a/src/mongo/util/assert_util.cpp
+++ b/src/mongo/util/assert_util.cpp
@@ -47,9 +47,9 @@
#include "mongo/util/debugger.h"
#include "mongo/util/exit.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/quick_exit.h"
#include "mongo/util/stacktrace.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/assert_util_test.cpp b/src/mongo/util/assert_util_test.cpp
index 7b159493333..25516602071 100644
--- a/src/mongo/util/assert_util_test.cpp
+++ b/src/mongo/util/assert_util_test.cpp
@@ -38,7 +38,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 mongo {
namespace {
diff --git a/src/mongo/util/background.cpp b/src/mongo/util/background.cpp
index 93bb11ec1c2..3627a413f1b 100644
--- a/src/mongo/util/background.cpp
+++ b/src/mongo/util/background.cpp
@@ -44,7 +44,7 @@
#include "mongo/util/concurrency/thread_name.h"
#include "mongo/util/debug_util.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include "mongo/util/timer.h"
namespace mongo {
@@ -165,7 +165,7 @@ void BackgroundJob::jobBody() {
void BackgroundJob::go() {
stdx::unique_lock<stdx::mutex> l(_status->mutex);
massert(17234,
- mongoutils::str::stream() << "backgroundJob already running: " << name(),
+ str::stream() << "backgroundJob already running: " << name(),
_status->state != Running);
// If the job is already 'done', for instance because it was cancelled or already
diff --git a/src/mongo/util/cmdline_utils/censor_cmdline.cpp b/src/mongo/util/cmdline_utils/censor_cmdline.cpp
index 50c17bcae18..746daf24b2d 100644
--- a/src/mongo/util/cmdline_utils/censor_cmdline.cpp
+++ b/src/mongo/util/cmdline_utils/censor_cmdline.cpp
@@ -32,17 +32,18 @@
#include <set>
#include <string>
-#include "mongo/util/mongoutils/str.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 {
namespace cmdline_utils {
namespace {
+
struct InsensitiveCompare {
bool operator()(const std::string& a, const std::string& b) const {
- return strcasecmp(a.c_str(), b.c_str()) < 0;
+ return str::caseInsensitiveCompare(a.c_str(), b.c_str()) < 0;
}
};
diff --git a/src/mongo/util/concurrency/thread_name.cpp b/src/mongo/util/concurrency/thread_name.cpp
index 26cfdc04076..7aa58a3b6f4 100644
--- a/src/mongo/util/concurrency/thread_name.cpp
+++ b/src/mongo/util/concurrency/thread_name.cpp
@@ -53,7 +53,7 @@
#include "mongo/config.h"
#include "mongo/platform/atomic_word.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/concurrency/thread_pool.cpp b/src/mongo/util/concurrency/thread_pool.cpp
index 5f732c1a1ed..69e4e0f64b3 100644
--- a/src/mongo/util/concurrency/thread_pool.cpp
+++ b/src/mongo/util/concurrency/thread_pool.cpp
@@ -39,7 +39,7 @@
#include "mongo/util/concurrency/idle_thread_block.h"
#include "mongo/util/concurrency/thread_name.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/concurrency/ticketholder.cpp b/src/mongo/util/concurrency/ticketholder.cpp
index 4b61cf96e37..d836f977b67 100644
--- a/src/mongo/util/concurrency/ticketholder.cpp
+++ b/src/mongo/util/concurrency/ticketholder.cpp
@@ -36,7 +36,7 @@
#include <iostream>
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/descriptive_stats-inl.h b/src/mongo/util/descriptive_stats-inl.h
index bd30229b337..1b7239a3cbf 100644
--- a/src/mongo/util/descriptive_stats-inl.h
+++ b/src/mongo/util/descriptive_stats-inl.h
@@ -32,7 +32,7 @@
#include <algorithm>
#include <limits>
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
@@ -189,8 +189,7 @@ BSONObj SummaryEstimators<Sample, NumQuantiles>::statisticSummaryToBSONObj() con
for (size_t i = 1; i <= NumQuantiles; i++) {
const double probability = this->DistributionEstimators<NumQuantiles>::probability(i);
const double quantile = this->DistributionEstimators<NumQuantiles>::quantile(i);
- quantilesBuilder.append(std::string(mongoutils::str::stream() << probability),
- quantile);
+ quantilesBuilder.append(std::string(str::stream() << probability), quantile);
}
quantilesBuilder.doneFast();
}
diff --git a/src/mongo/util/dns_name.h b/src/mongo/util/dns_name.h
index 772948b7d35..023bee10516 100644
--- a/src/mongo/util/dns_name.h
+++ b/src/mongo/util/dns_name.h
@@ -41,7 +41,7 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/util/builder.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace dns {
diff --git a/src/mongo/util/duration.h b/src/mongo/util/duration.h
index 4564104f7b4..5cf82336aa6 100644
--- a/src/mongo/util/duration.h
+++ b/src/mongo/util/duration.h
@@ -39,7 +39,7 @@
#include "mongo/stdx/chrono.h"
#include "mongo/stdx/type_traits.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/util/errno_util.cpp b/src/mongo/util/errno_util.cpp
index 29a76013aca..eb9359c0e15 100644
--- a/src/mongo/util/errno_util.cpp
+++ b/src/mongo/util/errno_util.cpp
@@ -38,8 +38,8 @@
#include <errno.h> // For errno
#endif
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/scopeguard.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
namespace mongo {
diff --git a/src/mongo/util/fail_point.cpp b/src/mongo/util/fail_point.cpp
index ca70ecd7afd..9aac1298b07 100644
--- a/src/mongo/util/fail_point.cpp
+++ b/src/mongo/util/fail_point.cpp
@@ -37,7 +37,7 @@
#include "mongo/stdx/thread.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/util/fail_point_registry.cpp b/src/mongo/util/fail_point_registry.cpp
index 351cbe2d0da..158d6ab8023 100644
--- a/src/mongo/util/fail_point_registry.cpp
+++ b/src/mongo/util/fail_point_registry.cpp
@@ -33,7 +33,7 @@
#include "mongo/util/fail_point_server_parameter_gen.h"
#include "mongo/util/fail_point_service.h"
#include "mongo/util/map_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/file.cpp b/src/mongo/util/file.cpp
index 1aa2133e5e8..6cb07dcba9b 100644
--- a/src/mongo/util/file.cpp
+++ b/src/mongo/util/file.cpp
@@ -47,7 +47,7 @@
#include "mongo/util/allocator.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/text.h"
namespace mongo {
@@ -138,14 +138,13 @@ void File::read(fileofs o, char* data, unsigned len) {
} else if (bytesRead != len) {
_bad = true;
msgasserted(10438,
- mongoutils::str::stream() << "In File::read(), ReadFile for '" << _name
- << "' read "
- << bytesRead
- << " bytes while trying to read "
- << len
- << " bytes starting at offset "
- << o
- << ", truncated file?");
+ str::stream() << "In File::read(), ReadFile for '" << _name << "' read "
+ << bytesRead
+ << " bytes while trying to read "
+ << len
+ << " bytes starting at offset "
+ << o
+ << ", truncated file?");
}
}
@@ -264,14 +263,13 @@ void File::read(fileofs o, char* data, unsigned len) {
} else if (bytesRead != static_cast<ssize_t>(len)) {
_bad = true;
msgasserted(16569,
- mongoutils::str::stream() << "In File::read(), ::pread for '" << _name
- << "' read "
- << bytesRead
- << " bytes while trying to read "
- << len
- << " bytes starting at offset "
- << o
- << ", truncated file?");
+ str::stream() << "In File::read(), ::pread for '" << _name << "' read "
+ << bytesRead
+ << " bytes while trying to read "
+ << len
+ << " bytes starting at offset "
+ << o
+ << ", truncated file?");
}
}
diff --git a/src/mongo/util/hex.h b/src/mongo/util/hex.h
index 37deef904a8..d58364fe54f 100644
--- a/src/mongo/util/hex.h
+++ b/src/mongo/util/hex.h
@@ -35,7 +35,7 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/util/builder.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
// can't use hex namespace because it conflicts with hex iostream function
diff --git a/src/mongo/util/icu.cpp b/src/mongo/util/icu.cpp
index 14f7c174ee3..ea4961f31aa 100644
--- a/src/mongo/util/icu.cpp
+++ b/src/mongo/util/icu.cpp
@@ -42,7 +42,7 @@
#include <vector>
#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/util/intrusive_counter.cpp b/src/mongo/util/intrusive_counter.cpp
index 92eeb0b4bb8..59b177a1fc3 100644
--- a/src/mongo/util/intrusive_counter.cpp
+++ b/src/mongo/util/intrusive_counter.cpp
@@ -31,11 +31,10 @@
#include "mongo/util/intrusive_counter.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
using boost::intrusive_ptr;
-using namespace mongoutils;
intrusive_ptr<const RCString> RCString::create(StringData s) {
uassert(16493,
diff --git a/src/mongo/util/net/hostandport.cpp b/src/mongo/util/net/hostandport.cpp
index 6eab3a7aa7d..19786d0f375 100644
--- a/src/mongo/util/net/hostandport.cpp
+++ b/src/mongo/util/net/hostandport.cpp
@@ -39,7 +39,7 @@
#include "mongo/bson/util/builder.h"
#include "mongo/db/server_options.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 {
diff --git a/src/mongo/util/net/http_client_winhttp.cpp b/src/mongo/util/net/http_client_winhttp.cpp
index 27a5da5cb66..4ddab8046aa 100644
--- a/src/mongo/util/net/http_client_winhttp.cpp
+++ b/src/mongo/util/net/http_client_winhttp.cpp
@@ -50,9 +50,9 @@
#include "mongo/util/assert_util.h"
#include "mongo/util/errno_util.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/http_client.h"
#include "mongo/util/scopeguard.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
#include "mongo/util/winutil.h"
diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp
index f56a0a31778..6d7b2d1e8f7 100644
--- a/src/mongo/util/net/sock.cpp
+++ b/src/mongo/util/net/sock.cpp
@@ -63,11 +63,11 @@
#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/net/private/socket_poll.h"
#include "mongo/util/net/socket_exception.h"
#include "mongo/util/net/socket_utils.h"
#include "mongo/util/net/ssl_manager.h"
+#include "mongo/util/str.h"
#include "mongo/util/winutil.h"
namespace mongo {
diff --git a/src/mongo/util/net/sockaddr.cpp b/src/mongo/util/net/sockaddr.cpp
index 819702ddca3..be88e9c206e 100644
--- a/src/mongo/util/net/sockaddr.cpp
+++ b/src/mongo/util/net/sockaddr.cpp
@@ -134,7 +134,7 @@ SockAddr::SockAddr(StringData target, int port, sa_family_t familyHint)
_hostOrIp = "127.0.0.1";
}
- if (mongoutils::str::contains(_hostOrIp, '/') || familyHint == AF_UNIX) {
+ if (str::contains(_hostOrIp, '/') || familyHint == AF_UNIX) {
initUnixDomainSocket(_hostOrIp, port);
return;
}
@@ -165,7 +165,7 @@ SockAddr::SockAddr(StringData target, int port, sa_family_t familyHint)
std::vector<SockAddr> SockAddr::createAll(StringData target, int port, sa_family_t familyHint) {
std::string hostOrIp = target.toString();
- if (mongoutils::str::contains(hostOrIp, '/')) {
+ if (str::contains(hostOrIp, '/')) {
std::vector<SockAddr> ret = {SockAddr()};
ret[0].initUnixDomainSocket(hostOrIp, port);
// Currently, this is always valid since initUnixDomainSocket()
@@ -281,9 +281,8 @@ std::string SockAddr::getAddr() const {
const int buflen = 128;
char buffer[buflen];
int ret = getnameinfo(raw(), addressSize, buffer, buflen, NULL, 0, NI_NUMERICHOST);
- massert(13082,
- mongoutils::str::stream() << "getnameinfo error " << getAddrInfoStrError(ret),
- ret == 0);
+ massert(
+ 13082, str::stream() << "getnameinfo error " << getAddrInfoStrError(ret), ret == 0);
return buffer;
}
diff --git a/src/mongo/util/net/socket_exception.cpp b/src/mongo/util/net/socket_exception.cpp
index eaf83cdf04b..29b3cdf038f 100644
--- a/src/mongo/util/net/socket_exception.cpp
+++ b/src/mongo/util/net/socket_exception.cpp
@@ -31,7 +31,7 @@
#include "mongo/util/net/socket_exception.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/net/socket_utils.cpp b/src/mongo/util/net/socket_utils.cpp
index 556d41edb8c..f58ff484ec7 100644
--- a/src/mongo/util/net/socket_utils.cpp
+++ b/src/mongo/util/net/socket_utils.cpp
@@ -57,9 +57,9 @@
#include "mongo/util/concurrency/value.h"
#include "mongo/util/errno_util.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/sockaddr.h"
#include "mongo/util/quick_exit.h"
+#include "mongo/util/str.h"
#include "mongo/util/winutil.h"
namespace mongo {
@@ -175,7 +175,7 @@ void setSocketKeepAliveParams(int sock,
}
std::string makeUnixSockPath(int port) {
- return mongoutils::str::stream() << serverGlobalParams.socket << "/mongodb-" << port << ".sock";
+ return str::stream() << serverGlobalParams.socket << "/mongodb-" << port << ".sock";
}
// If an ip address is passed in, just return that. If a hostname is passed
diff --git a/src/mongo/util/net/ssl/detail/impl/engine_apple.ipp b/src/mongo/util/net/ssl/detail/impl/engine_apple.ipp
index 798db875256..a78460e8d97 100644
--- a/src/mongo/util/net/ssl/detail/impl/engine_apple.ipp
+++ b/src/mongo/util/net/ssl/detail/impl/engine_apple.ipp
@@ -39,11 +39,11 @@
#include "asio/error.hpp"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/ssl/apple.hpp"
#include "mongo/util/net/ssl/detail/engine.hpp"
#include "mongo/util/net/ssl/detail/stream_core.hpp"
#include "mongo/util/net/ssl/error.hpp"
+#include "mongo/util/str.h"
namespace asio {
namespace ssl {
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index d1b0cfe96df..3e69faa8437 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -47,9 +47,9 @@
#include "mongo/util/hex.h"
#include "mongo/util/icu.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/ssl_options.h"
#include "mongo/util/net/ssl_parameters_gen.h"
+#include "mongo/util/str.h"
#include "mongo/util/synchronized_value.h"
#include "mongo/util/text.h"
@@ -298,9 +298,9 @@ void canonicalizeClusterDN(std::vector<std::string>* dn) {
for (size_t i = 0; i < dn->size(); i++) {
std::string& comp = dn->at(i);
boost::algorithm::trim(comp);
- if (!mongoutils::str::startsWith(comp.c_str(), "DC=") &&
- !mongoutils::str::startsWith(comp.c_str(), "O=") &&
- !mongoutils::str::startsWith(comp.c_str(), "OU=")) {
+ if (!str::startsWith(comp.c_str(), "DC=") && //
+ !str::startsWith(comp.c_str(), "O=") && //
+ !str::startsWith(comp.c_str(), "OU=")) {
dn->erase(dn->begin() + i);
i--;
}
@@ -1158,10 +1158,8 @@ SSLManagerInterface* getSSLManager() {
return theSSLManager;
}
-} // namespace mongo
-
// TODO SERVER-11601 Use NFC Unicode canonicalization
-bool mongo::hostNameMatchForX509Certificates(std::string nameToMatch, std::string certHostName) {
+bool hostNameMatchForX509Certificates(std::string nameToMatch, std::string certHostName) {
nameToMatch = removeFQDNRoot(std::move(nameToMatch));
certHostName = removeFQDNRoot(std::move(certHostName));
@@ -1173,8 +1171,10 @@ bool mongo::hostNameMatchForX509Certificates(std::string nameToMatch, std::strin
if (certHostName[0] == '*' && certHostName[1] == '.') {
// allow name.example.com if the cert is *.example.com, '*' does not match '.'
const char* subName = strchr(nameToMatch.c_str(), '.');
- return subName && !strcasecmp(certHostName.c_str() + 1, subName);
+ return subName && !str::caseInsensitiveCompare(certHostName.c_str() + 1, subName);
} else {
- return !strcasecmp(nameToMatch.c_str(), certHostName.c_str());
+ return !str::caseInsensitiveCompare(nameToMatch.c_str(), certHostName.c_str());
}
}
+
+} // namespace mongo
diff --git a/src/mongo/util/net/ssl_manager_openssl.cpp b/src/mongo/util/net/ssl_manager_openssl.cpp
index 09336136a47..8ebdf5158ef 100644
--- a/src/mongo/util/net/ssl_manager_openssl.cpp
+++ b/src/mongo/util/net/ssl_manager_openssl.cpp
@@ -54,7 +54,6 @@
#include "mongo/util/debug_util.h"
#include "mongo/util/exit.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/cidr.h"
#include "mongo/util/net/dh_openssl.h"
#include "mongo/util/net/private/ssl_expiration.h"
@@ -62,6 +61,7 @@
#include "mongo/util/net/ssl_options.h"
#include "mongo/util/net/ssl_types.h"
#include "mongo/util/scopeguard.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
#ifndef _WIN32
diff --git a/src/mongo/util/net/ssl_manager_windows.cpp b/src/mongo/util/net/ssl_manager_windows.cpp
index a7d350400fa..95b5bda7bd8 100644
--- a/src/mongo/util/net/ssl_manager_windows.cpp
+++ b/src/mongo/util/net/ssl_manager_windows.cpp
@@ -53,13 +53,13 @@
#include "mongo/util/exit.h"
#include "mongo/util/hex.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/private/ssl_expiration.h"
#include "mongo/util/net/sockaddr.h"
#include "mongo/util/net/socket_exception.h"
#include "mongo/util/net/ssl.hpp"
#include "mongo/util/net/ssl_options.h"
#include "mongo/util/net/ssl_types.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
#include "mongo/util/uuid.h"
diff --git a/src/mongo/util/ntservice.cpp b/src/mongo/util/ntservice.cpp
index d58f22203a2..be93b6588c1 100644
--- a/src/mongo/util/ntservice.cpp
+++ b/src/mongo/util/ntservice.cpp
@@ -246,7 +246,7 @@ std::vector<std::string> constructServiceArgv(const std::vector<std::string>& in
std::string name;
std::string value;
- bool foundEqualSign = mongoutils::str::splitOn(*iter, '=', name, value);
+ bool foundEqualSign = str::splitOn(*iter, '=', name, value);
if (!foundEqualSign)
name = *iter;
if (optionsWithArgumentsToStripEnd !=
diff --git a/src/mongo/util/options_parser/options_parser.cpp b/src/mongo/util/options_parser/options_parser.cpp
index 62a053ee3a4..6627250c329 100644
--- a/src/mongo/util/options_parser/options_parser.cpp
+++ b/src/mongo/util/options_parser/options_parser.cpp
@@ -46,7 +46,6 @@
#include "mongo/db/json.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/hostandport.h"
#include "mongo/util/net/http_client.h"
#include "mongo/util/options_parser/constraints.h"
@@ -55,6 +54,7 @@
#include "mongo/util/options_parser/option_section.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/shell_exec.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
namespace mongo {
@@ -724,7 +724,7 @@ Status checkLongName(const po::variables_map& vm,
++keyValueVectorIt) {
std::string key;
std::string value;
- if (!mongoutils::str::splitOn(*keyValueVectorIt, '=', key, value)) {
+ if (!str::splitOn(*keyValueVectorIt, '=', key, value)) {
StringBuilder sb;
sb << "Illegal option assignment: \"" << *keyValueVectorIt << "\"";
return Status(ErrorCodes::BadValue, sb.str());
diff --git a/src/mongo/util/perfctr_collect.cpp b/src/mongo/util/perfctr_collect.cpp
index 8ac2c9590c6..5ff3ed41e8b 100644
--- a/src/mongo/util/perfctr_collect.cpp
+++ b/src/mongo/util/perfctr_collect.cpp
@@ -36,8 +36,8 @@
#include "mongo/base/init.h"
#include "mongo/bson/bsonobjbuilder.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/text.h"
namespace mongo {
diff --git a/src/mongo/util/processinfo_solaris.cpp b/src/mongo/util/processinfo_solaris.cpp
index 3a75aeb6f92..e65357b9ae4 100644
--- a/src/mongo/util/processinfo_solaris.cpp
+++ b/src/mongo/util/processinfo_solaris.cpp
@@ -47,9 +47,9 @@
#include "mongo/util/file.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"
#include "mongo/util/stringutils.h"
namespace mongo {
@@ -70,15 +70,14 @@ struct ProcPsinfo {
ProcPsinfo() {
FILE* f = fopen("/proc/self/psinfo", "r");
massert(16846,
- mongoutils::str::stream() << "couldn't open \"/proc/self/psinfo\": "
- << errnoWithDescription(),
+ str::stream() << "couldn't open \"/proc/self/psinfo\": " << errnoWithDescription(),
f);
size_t num = fread(&psinfo, sizeof(psinfo), 1, f);
int err = errno;
fclose(f);
massert(16847,
- mongoutils::str::stream() << "couldn't read from \"/proc/self/psinfo\": "
- << errnoWithDescription(err),
+ str::stream() << "couldn't read from \"/proc/self/psinfo\": "
+ << errnoWithDescription(err),
num == 1);
}
psinfo_t psinfo;
@@ -88,15 +87,14 @@ struct ProcUsage {
ProcUsage() {
FILE* f = fopen("/proc/self/usage", "r");
massert(16848,
- mongoutils::str::stream() << "couldn't open \"/proc/self/usage\": "
- << errnoWithDescription(),
+ str::stream() << "couldn't open \"/proc/self/usage\": " << errnoWithDescription(),
f);
size_t num = fread(&prusage, sizeof(prusage), 1, f);
int err = errno;
fclose(f);
massert(16849,
- mongoutils::str::stream() << "couldn't read from \"/proc/self/usage\": "
- << errnoWithDescription(err),
+ str::stream() << "couldn't read from \"/proc/self/usage\": "
+ << errnoWithDescription(err),
num == 1);
}
prusage_t prusage;
@@ -149,13 +147,13 @@ void ProcessInfo::SystemInfo::collectSystemInfo() {
char buf_native[32];
if (sysinfo(SI_ARCHITECTURE_64, buf_64, sizeof(buf_64)) != -1 &&
sysinfo(SI_ARCHITECTURE_NATIVE, buf_native, sizeof(buf_native)) != -1) {
- addrSize = mongoutils::str::equals(buf_64, buf_native) ? 64 : 32;
+ addrSize = str::equals(buf_64, buf_native) ? 64 : 32;
} else {
log() << "Unable to determine system architecture: " << strerror(errno);
}
osType = unameData.sysname;
- osName = mongoutils::str::ltrim(readLineFromFile("/etc/release"));
+ osName = str::ltrim(readLineFromFile("/etc/release"));
osVersion = unameData.version;
pageSize = static_cast<unsigned long long>(sysconf(_SC_PAGESIZE));
memSize = pageSize * static_cast<unsigned long long>(sysconf(_SC_PHYS_PAGES));
@@ -169,7 +167,7 @@ void ProcessInfo::SystemInfo::collectSystemInfo() {
// 2. Illumos kernel releases (which is all non Oracle Solaris releases)
preferMsyncOverFSync = false;
- if (mongoutils::str::startsWith(osName, "Oracle Solaris")) {
+ if (str::startsWith(osName, "Oracle Solaris")) {
std::vector<std::string> versionComponents;
splitStringDelim(osVersion, &versionComponents, '.');
diff --git a/src/mongo/util/procparser.cpp b/src/mongo/util/procparser.cpp
index 0aec03be8b3..8e6b203da12 100644
--- a/src/mongo/util/procparser.cpp
+++ b/src/mongo/util/procparser.cpp
@@ -51,8 +51,8 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/bsonobjbuilder.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/text.h"
namespace mongo {
diff --git a/src/mongo/util/regex_util.cpp b/src/mongo/util/regex_util.cpp
index c60a7dc8847..e22cb2b1a97 100644
--- a/src/mongo/util/regex_util.cpp
+++ b/src/mongo/util/regex_util.cpp
@@ -31,7 +31,7 @@
#include "mongo/util/regex_util.h"
#include "mongo/base/error_codes.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace regex_util {
diff --git a/src/mongo/util/shell_exec.cpp b/src/mongo/util/shell_exec.cpp
index 09cf48cad34..1adc02dbd4f 100644
--- a/src/mongo/util/shell_exec.cpp
+++ b/src/mongo/util/shell_exec.cpp
@@ -42,7 +42,7 @@
#endif
#include "mongo/util/errno_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include "mongo/util/text.h"
#include "mongo/util/time_support.h"
diff --git a/src/mongo/util/signal_win32.cpp b/src/mongo/util/signal_win32.cpp
index 132c71fc018..3f4163c514a 100644
--- a/src/mongo/util/signal_win32.cpp
+++ b/src/mongo/util/signal_win32.cpp
@@ -29,7 +29,7 @@
#include "mongo/platform/basic.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#include <string>
namespace mongo {
@@ -39,7 +39,7 @@ namespace mongo {
std::string getShutdownSignalName(int processId) {
const char* strEventNamePrefix = "Global\\Mongo_";
- return mongoutils::str::stream() << strEventNamePrefix << processId;
+ return str::stream() << strEventNamePrefix << processId;
}
#endif
}
diff --git a/src/mongo/util/mongoutils/str.h b/src/mongo/util/str.h
index b26b16f8e01..f7b5c2925f0 100644
--- a/src/mongo/util/mongoutils/str.h
+++ b/src/mongo/util/str.h
@@ -33,7 +33,6 @@
* String utilities.
*
* TODO: De-inline.
- * TODO: Retire the mongoutils namespace, and move str under the mongo namespace.
*/
#include <sstream>
@@ -42,9 +41,7 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/util/builder.h"
-namespace mongoutils {
-
-namespace str {
+namespace mongo::str {
/** the idea here is to make one liners easy. e.g.:
@@ -269,17 +266,12 @@ inline size_t lengthInUTF8CodePoints(mongo::StringData str) {
return strLen;
}
-} // namespace str
-
-} // namespace mongoutils
-
-namespace mongo {
-using namespace mongoutils;
-
+inline int caseInsensitiveCompare(const char* s1, const char* s2) {
#if defined(_WIN32)
-inline int strcasecmp(const char* s1, const char* s2) {
return _stricmp(s1, s2);
-}
+#else
+ return strcasecmp(s1, s2);
#endif
+}
-} // namespace mongo
+} // namespace mongo::str
diff --git a/src/mongo/util/stringutils.h b/src/mongo/util/stringutils.h
index 52ef1675e2a..dc9110fc112 100644
--- a/src/mongo/util/stringutils.h
+++ b/src/mongo/util/stringutils.h
@@ -40,7 +40,7 @@
namespace mongo {
-// see also mongoutils/str.h - perhaps move these there?
+// see also mongo/util/str.h - perhaps move these there?
// see also text.h
void splitStringDelim(const std::string& str, std::vector<std::string>* res, char delim);
diff --git a/src/mongo/util/tcmalloc_set_parameter.cpp b/src/mongo/util/tcmalloc_set_parameter.cpp
index 179d717fafa..8fa4a5f0c37 100644
--- a/src/mongo/util/tcmalloc_set_parameter.cpp
+++ b/src/mongo/util/tcmalloc_set_parameter.cpp
@@ -42,8 +42,8 @@
#include "mongo/base/status.h"
#include "mongo/base/status_with.h"
#include "mongo/db/jsobj.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/processinfo.h"
+#include "mongo/util/str.h"
#include "mongo/util/tcmalloc_parameters_gen.h"
namespace mongo {
diff --git a/src/mongo/util/text.cpp b/src/mongo/util/text.cpp
index 67340215814..df084ac1bae 100644
--- a/src/mongo/util/text.cpp
+++ b/src/mongo/util/text.cpp
@@ -43,7 +43,7 @@
#include "mongo/platform/basic.h"
#include "mongo/util/allocator.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
@@ -173,7 +173,7 @@ std::string toUtf8String(const std::wstring& wide) {
}
}
- msgasserted(16091, mongoutils::str::stream() << "can't wstring to utf8: " << ::GetLastError());
+ msgasserted(16091, str::stream() << "can't wstring to utf8: " << ::GetLastError());
return "";
}
diff --git a/src/mongo/util/time_support.cpp b/src/mongo/util/time_support.cpp
index 4f34ecab195..079f72fa741 100644
--- a/src/mongo/util/time_support.cpp
+++ b/src/mongo/util/time_support.cpp
@@ -41,7 +41,7 @@
#include "mongo/bson/util/builder.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
#if defined(_WIN32)
#include "mongo/util/concurrency/mutex.h"
diff --git a/src/third_party/s2/base/logging.cc b/src/third_party/s2/base/logging.cc
index bbf060e8237..238afb0eb6d 100755
--- a/src/third_party/s2/base/logging.cc
+++ b/src/third_party/s2/base/logging.cc
@@ -19,13 +19,13 @@
#include "mongo/util/assert_util.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
using ::mongo::logger::LogstreamBuilder;
LogMessageBase::LogMessageBase(LogstreamBuilder builder, const char* file, int line) :
_lsb(std::move(builder)) {
- _lsb.setBaseMessage(mongoutils::str::stream() << file << ':' << line << ": ");
+ _lsb.setBaseMessage(::mongo::str::stream() << file << ':' << line << ": ");
}
LogMessageBase::LogMessageBase(LogstreamBuilder builder) : _lsb(std::move(builder)) { }
diff --git a/src/third_party/s2/s2loop.cc b/src/third_party/s2/s2loop.cc
index 4f20733e19f..d4087fab971 100644
--- a/src/third_party/s2/s2loop.cc
+++ b/src/third_party/s2/s2loop.cc
@@ -29,8 +29,8 @@ using std::make_pair;
#include "s2cell.h"
#include "s2edgeindex.h"
-#include "mongo/util/mongoutils/str.h"
-using mongoutils::str::stream;
+#include "mongo/util/str.h"
+using mongo::str::stream;
static const unsigned char kCurrentEncodingVersionNumber = 1;
diff --git a/src/third_party/s2/s2polygon.cc b/src/third_party/s2/s2polygon.cc
index a4a1e51dd3e..afd18467c63 100644
--- a/src/third_party/s2/s2polygon.cc
+++ b/src/third_party/s2/s2polygon.cc
@@ -29,8 +29,8 @@ using std::vector;
#include "s2polygonbuilder.h"
#include "s2polyline.h"
-#include "mongo/util/mongoutils/str.h"
-using mongoutils::str::stream;
+#include "mongo/util/str.h"
+using mongo::str::stream;
static const unsigned char kCurrentEncodingVersionNumber = 1;
diff --git a/src/third_party/s2/s2polyline.cc b/src/third_party/s2/s2polyline.cc
index 5cf44a2a115..08769555e4a 100644
--- a/src/third_party/s2/s2polyline.cc
+++ b/src/third_party/s2/s2polyline.cc
@@ -18,8 +18,8 @@ using std::vector;
#include "s2latlng.h"
#include "s2edgeutil.h"
-#include "mongo/util/mongoutils/str.h"
-using mongoutils::str::stream;
+#include "mongo/util/str.h"
+using mongo::str::stream;
static const unsigned char kCurrentEncodingVersionNumber = 1;