diff options
Diffstat (limited to 'src/mongo/db/matcher/match_details.cpp')
-rw-r--r-- | src/mongo/db/matcher/match_details.cpp | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/src/mongo/db/matcher/match_details.cpp b/src/mongo/db/matcher/match_details.cpp index 6adcfcdd910..6675bf08e15 100644 --- a/src/mongo/db/matcher/match_details.cpp +++ b/src/mongo/db/matcher/match_details.cpp @@ -36,39 +36,37 @@ namespace mongo { - using std::string; +using std::string; - MatchDetails::MatchDetails() : - _elemMatchKeyRequested() { - resetOutput(); - } - - void MatchDetails::resetOutput() { - _loadedRecord = false; - _elemMatchKey.reset(); - } +MatchDetails::MatchDetails() : _elemMatchKeyRequested() { + resetOutput(); +} - bool MatchDetails::hasElemMatchKey() const { - return _elemMatchKey.get(); - } +void MatchDetails::resetOutput() { + _loadedRecord = false; + _elemMatchKey.reset(); +} - std::string MatchDetails::elemMatchKey() const { - verify( hasElemMatchKey() ); - return *(_elemMatchKey.get()); - } +bool MatchDetails::hasElemMatchKey() const { + return _elemMatchKey.get(); +} - void MatchDetails::setElemMatchKey( const std::string &elemMatchKey ) { - if ( _elemMatchKeyRequested ) { - _elemMatchKey.reset( new std::string( elemMatchKey ) ); - } - } +std::string MatchDetails::elemMatchKey() const { + verify(hasElemMatchKey()); + return *(_elemMatchKey.get()); +} - string MatchDetails::toString() const { - std::stringstream ss; - ss << "loadedRecord: " << _loadedRecord << " "; - ss << "elemMatchKeyRequested: " << _elemMatchKeyRequested << " "; - ss << "elemMatchKey: " << ( _elemMatchKey ? _elemMatchKey->c_str() : "NONE" ) << " "; - return ss.str(); +void MatchDetails::setElemMatchKey(const std::string& elemMatchKey) { + if (_elemMatchKeyRequested) { + _elemMatchKey.reset(new std::string(elemMatchKey)); } +} +string MatchDetails::toString() const { + std::stringstream ss; + ss << "loadedRecord: " << _loadedRecord << " "; + ss << "elemMatchKeyRequested: " << _elemMatchKeyRequested << " "; + ss << "elemMatchKey: " << (_elemMatchKey ? _elemMatchKey->c_str() : "NONE") << " "; + return ss.str(); +} } |