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 36