]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Utility/UriParser.h
MFV r336851:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Utility / UriParser.h
1 //===-- UriParser.h ---------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef utility_UriParser_h_
11 #define utility_UriParser_h_
12
13 #include "llvm/ADT/StringRef.h"
14
15 namespace lldb_private {
16 class UriParser {
17 public:
18   // Parses
19   // RETURN VALUE
20   //   if url is valid, function returns true and
21   //   scheme/hostname/port/path are set to the parsed values
22   //   port it set to -1 if it is not included in the URL
23   //
24   //   if the url is invalid, function returns false and
25   //   output parameters remain unchanged
26   static bool Parse(llvm::StringRef uri, llvm::StringRef &scheme,
27                     llvm::StringRef &hostname, int &port,
28                     llvm::StringRef &path);
29 };
30 }
31
32 #endif // utility_UriParser_h_