• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
14 namespace lldb_private {
15 class UriParser {
16 public:
17   // Parses
18   // RETURN VALUE
19   //   if url is valid, function returns true and
20   //   scheme/hostname/port/path are set to the parsed values
21   //   port it set to -1 if it is not included in the URL
22   //
23   //   if the url is invalid, function returns false and
24   //   output parameters remain unchanged
25   static bool Parse(llvm::StringRef uri, llvm::StringRef &scheme,
26                     llvm::StringRef &hostname, int &port,
27                     llvm::StringRef &path);
28 };
29 }
30 
31 #endif // LLDB_UTILITY_URIPARSER_H
32