LLDB mainline
UriParser.h
Go to the documentation of this file.
1//===-- UriParser.h ---------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_UTILITY_URIPARSER_H
10#define LLDB_UTILITY_URIPARSER_H
11
12#include "llvm/ADT/StringRef.h"
13#include <optional>
14
15namespace llvm {
16class raw_ostream;
17} // namespace llvm
18
19namespace lldb_private {
20
21struct URI {
22 llvm::StringRef scheme;
23 llvm::StringRef hostname;
24 std::optional<uint16_t> port;
25 llvm::StringRef path;
26
27 bool operator==(const URI &R) const {
28 return port == R.port && scheme == R.scheme && hostname == R.hostname &&
29 path == R.path;
30 }
31
32 static std::optional<URI> Parse(llvm::StringRef uri);
33};
34
35llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const URI &U);
36
37} // namespace lldb_private
38
39#endif // LLDB_UTILITY_URIPARSER_H
A class that represents a running process on the host machine.
Stream & operator<<(Stream &s, const Mangled &obj)
Definition: Debugger.h:54
llvm::StringRef hostname
Definition: UriParser.h:23
llvm::StringRef scheme
Definition: UriParser.h:22
static std::optional< URI > Parse(llvm::StringRef uri)
Definition: UriParser.cpp:28
bool operator==(const URI &R) const
Definition: UriParser.h:27
llvm::StringRef path
Definition: UriParser.h:25
std::optional< uint16_t > port
Definition: UriParser.h:24