MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetAuthority

Method GetAuthority

lib/remote/url.cpp:79–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79String Url::GetAuthority() const
80{
81 if (m_Host.IsEmpty())
82 return "";
83
84 String auth;
85 if (!m_Username.IsEmpty()) {
86 auth = m_Username;
87 if (!m_Password.IsEmpty())
88 auth += ":" + m_Password;
89 auth += "@";
90 }
91
92 auth += m_Host;
93
94 if (!m_Port.IsEmpty())
95 auth += ":" + m_Port;
96
97 return auth;
98}
99
100String Url::GetUsername() const
101{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 1

IsEmptyMethod · 0.45

Tested by

no test coverage detected