LicenseSpring C++ SDK
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
LicenseSpring::ProxySettings Class Reference

Class for storing settings when using a proxy server. More...

#include <LicenseSpring/ExtendedOptions.h>

Public Member Functions

 ProxySettings ()=default
 Default constructor for proxy settings.
 
 ProxySettings (const std::string &proxy, const std::string &user, const std::string &password)
 Constructor for proxy settings.
 
 ~ProxySettings ()
 Destructor for proxy settings.
 
bool fetchProxySettings (const std::string &serviceURL, const std::string &credentialTarget, bool throwExceptions=false)
 Automatically fetch proxy URI and credentials.
 
void setProxyUri (const std::string &uri)
 Setter for proxy URI.
 
const std::string & getProxyUri () const
 Getter for proxy URI.
 
void setUser (const std::string &user)
 Setter for proxy user.
 
const std::string & getUser () const
 Getter for proxy user.
 
void setPassword (const std::string &password)
 Setter for password.
 
const std::string & getPassword () const
 Getter for password.
 
bool isValid () const
 Checker for if proxy URI is specified (i.e. not empty).
 

Detailed Description

Class for storing settings when using a proxy server.

Definition at line 59 of file ExtendedOptions.h.

Constructor & Destructor Documentation

◆ ProxySettings() [1/2]

LicenseSpring::ProxySettings::ProxySettings ( )
default

Default constructor for proxy settings.

◆ ProxySettings() [2/2]

LicenseSpring::ProxySettings::ProxySettings ( const std::string &  proxy,
const std::string &  user,
const std::string &  password 
)

Constructor for proxy settings.

Parameters
proxyString of proxy URI
userString of user
passwordString of password

◆ ~ProxySettings()

LicenseSpring::ProxySettings::~ProxySettings ( )

Destructor for proxy settings.

Member Function Documentation

◆ fetchProxySettings()

bool LicenseSpring::ProxySettings::fetchProxySettings ( const std::string &  serviceURL,
const std::string &  credentialTarget,
bool  throwExceptions = false 
)

Automatically fetch proxy URI and credentials.

Usable only on Windows.
Tries to automatically fetch PAC file and proxy settings specific to the LicenseSpring API URL. Otherwise fetches default WinHTTP proxy.
Also tries to fetch credential data through Windows Credential Manager.

Parameters
serviceURLLicense API URL
credentialTargetProxy credentials name in Windows Credential Manager
throwExceptionsIndicates whether this method should throw exceptions
Exceptions
LicenseSpringExceptionIf proxy is not set up or credentials don't exist
Returns
True if fetching proxy settings is successful and false otherwise.

◆ setProxyUri()

void LicenseSpring::ProxySettings::setProxyUri ( const std::string &  uri)

Setter for proxy URI.

Parameters
uriString of proxy URI

◆ getProxyUri()

const std::string & LicenseSpring::ProxySettings::getProxyUri ( ) const

Getter for proxy URI.

Returns
String of proxy URI.

◆ setUser()

void LicenseSpring::ProxySettings::setUser ( const std::string &  user)

Setter for proxy user.

Parameters
userString for proxy user

◆ getUser()

const std::string & LicenseSpring::ProxySettings::getUser ( ) const

Getter for proxy user.

Returns
String of proxy user.

◆ setPassword()

void LicenseSpring::ProxySettings::setPassword ( const std::string &  password)

Setter for password.

Parameters
passwordString for password

◆ getPassword()

const std::string & LicenseSpring::ProxySettings::getPassword ( ) const

Getter for password.

Returns
String of password.

◆ isValid()

bool LicenseSpring::ProxySettings::isValid ( ) const

Checker for if proxy URI is specified (i.e. not empty).

Returns
True if specified, false if empty.

The documentation for this class was generated from the following file: