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/Optional.h"
13 #include "llvm/ADT/StringRef.h"
14 
15 namespace lldb_private {
16 
17 struct URI {
18  llvm::StringRef scheme;
19  llvm::StringRef hostname;
20  llvm::Optional<uint16_t> port;
21  llvm::StringRef path;
22 
23  bool operator==(const URI &R) const {
24  return port == R.port && scheme == R.scheme && hostname == R.hostname &&
25  path == R.path;
26  }
27 
28  static llvm::Optional<URI> Parse(llvm::StringRef uri);
29 };
30 
31 llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const URI &U);
32 
33 } // namespace lldb_private
34 
35 #endif // LLDB_UTILITY_URIPARSER_H
lldb_private::URI::port
llvm::Optional< uint16_t > port
Definition: UriParser.h:20
lldb_private::URI::Parse
static llvm::Optional< URI > Parse(llvm::StringRef uri)
Definition: UriParser.cpp:27
lldb_private::URI::scheme
llvm::StringRef scheme
Definition: UriParser.h:18
lldb_private::URI
Definition: UriParser.h:17
lldb_private::URI::path
llvm::StringRef path
Definition: UriParser.h:21
lldb_private::URI::hostname
llvm::StringRef hostname
Definition: UriParser.h:19
lldb_private::operator<<
Stream & operator<<(Stream &s, const SourceLocationSpec &loc)
Dump a SourceLocationSpec object to a stream.
Definition: SourceLocationSpec.cpp:40
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::URI::operator==
bool operator==(const URI &R) const
Definition: UriParser.h:23