aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee')
-rw-r--r--contrib/epee/include/net/http_client.h3
-rw-r--r--contrib/epee/include/string_tools.h12
2 files changed, 15 insertions, 0 deletions
diff --git a/contrib/epee/include/net/http_client.h b/contrib/epee/include/net/http_client.h
index 67e63f7bf..8e099e2bc 100644
--- a/contrib/epee/include/net/http_client.h
+++ b/contrib/epee/include/net/http_client.h
@@ -293,6 +293,9 @@ using namespace std;
, m_lock()
{}
+ const std::string &get_host() const { return m_host_buff; };
+ const std::string &get_port() const { return m_port; };
+
bool set_server(const std::string& address, boost::optional<login> user)
{
http::url_content parsed{};
diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h
index 258caa49e..ce7b2fb87 100644
--- a/contrib/epee/include/string_tools.h
+++ b/contrib/epee/include/string_tools.h
@@ -314,6 +314,18 @@ POP_WARNINGS
return str;
}
//----------------------------------------------------------------------------
+ inline std::string pad_string(std::string s, size_t n, char c = ' ', bool prepend = false)
+ {
+ if (s.size() < n)
+ {
+ if (prepend)
+ s = std::string(n - s.size(), c) + s;
+ else
+ s.append(n - s.size(), c);
+ }
+ return s;
+ }
+ //----------------------------------------------------------------------------
template<class t_pod_type>
std::string pod_to_hex(const t_pod_type& s)
{