21#include "mongo/bson/util/builder.h"
22#include "mongo/platform/hash_namespace.h"
99 const std::string& host()
const {
104 bool hasPort()
const {
113MONGO_CLIENT_API std::ostream& MONGO_CLIENT_FUNC
114operator<<(std::ostream& os,
const HostAndPort& hp);
118MONGO_HASH_NAMESPACE_START
125MONGO_HASH_NAMESPACE_END
Definition sasl_client_conversation.h:28
std::stringstream deals with locale so this is a lot faster than std::stringstream for UTF8
Definition builder.h:325
the main MongoDB namespace
Definition bulk_operation_builder.h:24
MONGO_CLIENT_API Status(MONGO_CLIENT_FUNC *saslClientAuthenticate)(DBClientWithCommands *client
Attempts to authenticate "client" using the SASL protocol.
Name of a process on the network.
Definition hostandport.h:37
std::string toString() const
Returns a string representation of "host:port".
static StatusWith< HostAndPort > MONGO_CLIENT_FUNC parse(const StringData &text)
Parses "text" to produce a HostAndPort.
bool isLocalHost() const
Returns true if the hostname looks localhost-y.
HostAndPort(const StringData &text)
Constructs a HostAndPort by parsing "text" of the form hostname[:portnumber] Throws an AssertionExcep...
void append(StringBuilder &ss) const
Like toString(), above, but writes to "ss", instead.
bool empty() const
Returns true if this object represents no valid HostAndPort.
HostAndPort(const std::string &h, int p)
Constructs a HostAndPort with the hostname "h" and port "p".
Status initialize(const StringData &s)
(Re-)initializes this HostAndPort by parsing "s".
HostAndPort()
Construct an empty/invalid HostAndPort.