Kagome
Polkadot Runtime Engine in C++17
uri.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_COMMON_URI
7 #define KAGOME_COMMON_URI
8 
9 #include <optional>
10 #include <string>
11 #include <string_view>
12 
13 namespace kagome::common {
14 
15  struct Uri final {
16  public:
17  std::string Schema;
18  std::string Host;
19  std::string Port;
20  std::string Path;
21  std::string Query;
22  std::string Fragment;
23 
24  static Uri parse(std::string_view uri);
25 
26  std::string to_string() const;
27 
28  const std::optional<std::string_view> &error() const {
29  return error_;
30  }
31 
32  private:
33  std::optional<std::string_view> error_;
34  };
35 
36 } // namespace kagome::common
37 
38 #endif // KAGOME_COMMON_URI
std::string to_string() const
Definition: uri.cpp:12
std::string Fragment
Definition: uri.hpp:22
std::string Schema
Definition: uri.hpp:17
static Uri parse(std::string_view uri)
Definition: uri.cpp:42
std::string Query
Definition: uri.hpp:21
std::string Host
Definition: uri.hpp:18
std::optional< std::string_view > error_
Definition: uri.hpp:33
const std::optional< std::string_view > & error() const
Definition: uri.hpp:28
std::string Port
Definition: uri.hpp:19
std::string Path
Definition: uri.hpp:20