diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2018-01-27 10:25:43 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2018-02-02 15:38:47 -0500 |
commit | b88f981042e73118d22a7ea1b2135d9ae2115d40 (patch) | |
tree | 4757c8a603a17f76f29892c3f210f0622c0e61a0 /src/mongo/db/namespace_string.cpp | |
parent | ed7af7cc923316749055d4be7486918d30ed8c59 (diff) | |
download | mongo-b88f981042e73118d22a7ea1b2135d9ae2115d40.tar.gz |
SERVER-32367 Pull UUID and view resolution out of db_raii
Diffstat (limited to 'src/mongo/db/namespace_string.cpp')
-rw-r--r-- | src/mongo/db/namespace_string.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp index 581409e66a8..19b35fec4cd 100644 --- a/src/mongo/db/namespace_string.cpp +++ b/src/mongo/db/namespace_string.cpp @@ -245,8 +245,19 @@ bool NamespaceString::isReplicated() const { return true; } +std::string NamespaceStringOrUUID::toString() const { + if (_nss) + return _nss->toString(); + else + return str::stream() << _dbAndUUID->dbName << ':' << _dbAndUUID->uuid.toString(); +} + std::ostream& operator<<(std::ostream& stream, const NamespaceString& nss) { return stream << nss.toString(); } +std::ostream& operator<<(std::ostream& stream, const NamespaceStringOrUUID& nsOrUUID) { + return stream << nsOrUUID.toString(); +} + } // namespace mongo |