PLCnext API Documentation 25.0.2.69
Url.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/PimplPtr.hxx"
9
10namespace Arp::Base::Commons::Net
11{
12
24class ARP_EXPORT Url
25{
26public: // Impl forward declaration
27 class Impl;
28
29public: // construction
30 Url(void);
31 explicit Url(const String& ipcAppName);
32 Url(const String& host, int port, bool encrypt);
33 Url(const String& host, int port, const char* scheme);
34
35 // canonical construction/destruction/assignment
36 Url(const Url& arg);
37 Url(Url&& arg)noexcept;
38 Url& operator=(const Url& arg);
39 Url& operator=(Url&& arg)noexcept;
40 ~Url(void);
41
42public: // static operations
43 static Url GetEmpty(void);
44 static Url Parse(const String& input);
45 static bool TryParse(const String& input, Url& result);
46
47public: // setter/getter operations
48 bool IsEmpty(void)const;
49 bool IsEncrypted(void)const;
50 bool HasScheme(void)const;
51 bool HasIpcScheme(void)const;
52 bool HasTcpScheme(void)const;
53 bool HasTlsScheme(void)const;
54 const String& GetScheme(void)const;
55 const String& GetHost(void)const;
56 const String& GetPath(void)const;
57 int GetPort(void)const;
58 // IpAddress GetHostIpAddress(void)const;
59
60public: // operations
61 void Clear(void);
62 String ToString(void)const;
63
64public: // internal operations
65 Impl& GetImpl(void);
66 const Impl& GetImpl(void)const;
67
68private: // Impl usings
70
71private: // Impl fields
72 Pimpl pimpl;
73};
74
76// Declarations of global functions of class Url
77ARP_EXPORT std::ostream& operator<<(std::ostream& os, const Url& value);
78ARP_EXPORT std::istream& operator>>(std::istream& is, Url& url);
79
80} // end of namespace Arp::Base::Commons::Net
81
83// template specialization of Url formatter
84template<> struct fmt::formatter<Arp::Base::Commons::Net::Url> : public fmt::ostream_formatter {};
85
This class implements represents a Uniform Resource Locator.
Definition: Url.hpp:25
Url & operator=(Url &&arg) noexcept
The default move-assignment operator.
~Url(void)
The default destructor.
Url & operator=(const Url &arg)
The default copy-assignment operator.
Url(const Url &arg)
The default copy constructor.
Url(Url &&arg) noexcept
The default move constructor.
Url(void)
The default constructor.
Adapter class to implement PImpl idiom.
Definition: PimplPtr.hxx:15
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
Root namespace for the PLCnext API