OpenVPN 3 Core Library
|
Class for handling Proxy Auto-Configuration (PAC) URLs. More...
#include <capture.hpp>
Public Member Functions | |
std::string | to_string () const |
Returns the URL as a string. | |
bool | defined () const |
Checks if the URL is defined. | |
void | validate (const std::string &title) const |
Validates the URL format. | |
Json::Value | to_json () const |
Converts the URL to a JSON object. | |
void | from_json (const Json::Value &root, const std::string &title) |
Populates the URL from a JSON object. | |
Public Attributes | |
std::string | url |
Class for handling Proxy Auto-Configuration (PAC) URLs.
This class provides functionality to store, validate, and convert a Proxy Auto-Configuration URL. PAC files are JavaScript files that determine which proxy server (if any) to use for a given URL.
Definition at line 402 of file capture.hpp.
|
inline |
Checks if the URL is defined.
A URL is considered defined if it is not empty.
true
if the URL is defined, false
otherwise. Definition at line 421 of file capture.hpp.
|
inline |
Populates the URL from a JSON object.
Extracts the "url" field from the provided JSON object. Does nothing if the JSON is not an object.
root | The JSON object to extract the URL from. |
title | A descriptive string to include in error messages. |
Definition at line 468 of file capture.hpp.
|
inline |
Converts the URL to a JSON object.
Creates a JSON object with a single "url" field containing the URL string.
Definition at line 453 of file capture.hpp.
|
inline |
Returns the URL as a string.
Definition at line 411 of file capture.hpp.
|
inline |
Validates the URL format.
Attempts to parse the URL using the URL::Parse function to verify it has a valid format. Throws an exception if parsing fails.
title | A descriptive string to include in the exception message if validation fails. |
Exception | Throws an exception if the URL is invalid. |
Definition at line 434 of file capture.hpp.
std::string openvpn::TunBuilderCapture::ProxyAutoConfigURL::url |
Definition at line 405 of file capture.hpp.