Mantid
Loading...
Searching...
No Matches
Framework
Kernel
src
ProxyInfo.cpp
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#include "
MantidKernel/ProxyInfo.h
"
8
#include <stdexcept>
9
10
namespace
Mantid::Kernel
{
11
12
//----------------------------------------------------------------------------------------------
15
ProxyInfo::ProxyInfo
() : m_host(
""
), m_port(0), m_isHttpProxy(false), m_isEmptyProxy(true) {}
16
23
ProxyInfo::ProxyInfo
(
const
std::string &host,
const
int
port,
const
bool
isHttpProxy)
24
: m_host(host), m_port(port), m_isHttpProxy(isHttpProxy), m_isEmptyProxy(false) {
25
if
(
host
.empty() ||
port
== 0) {
26
m_isEmptyProxy
=
true
;
27
}
28
}
29
34
std::string
ProxyInfo::host
()
const
{
35
if
(
m_isEmptyProxy
) {
36
throw
std::logic_error(
"Calling host on an undefined proxy"
);
37
}
38
return
m_host
;
39
}
40
45
int
ProxyInfo::port
()
const
{
46
if
(
m_isEmptyProxy
) {
47
throw
std::logic_error(
"Calling port on an undefined proxy"
);
48
}
49
return
m_port
;
50
}
51
56
bool
ProxyInfo::isHttpProxy
()
const
{
return
m_isHttpProxy
; }
57
62
bool
ProxyInfo::emptyProxy
()
const
{
return
m_isEmptyProxy
; }
63
64
}
// namespace Mantid::Kernel
ProxyInfo.h
Mantid::Kernel::ProxyInfo::ProxyInfo
ProxyInfo()
Constructor.
Definition:
ProxyInfo.cpp:15
Mantid::Kernel::ProxyInfo::emptyProxy
bool emptyProxy() const
Definition:
ProxyInfo.cpp:62
Mantid::Kernel::ProxyInfo::port
int port() const
Port Number.
Definition:
ProxyInfo.cpp:45
Mantid::Kernel::ProxyInfo::m_isHttpProxy
bool m_isHttpProxy
Definition:
ProxyInfo.h:21
Mantid::Kernel::ProxyInfo::m_isEmptyProxy
bool m_isEmptyProxy
Definition:
ProxyInfo.h:22
Mantid::Kernel::ProxyInfo::host
std::string host() const
Host url.
Definition:
ProxyInfo.cpp:34
Mantid::Kernel::ProxyInfo::m_host
std::string m_host
Definition:
ProxyInfo.h:19
Mantid::Kernel::ProxyInfo::m_port
int m_port
Definition:
ProxyInfo.h:20
Mantid::Kernel::ProxyInfo::isHttpProxy
bool isHttpProxy() const
Is this a http proxy.
Definition:
ProxyInfo.cpp:56
Mantid::Kernel
Definition:
AnnularRingAbsorption.h:15
Generated on Tue Jan 3 2023 11:57:51 for Mantid by
1.9.5