1317027Sdim//===-- UriParser.h ---------------------------------------------*- C++ -*-===//
2317027Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6317027Sdim//
7317027Sdim//===----------------------------------------------------------------------===//
8317027Sdim
9317027Sdim#ifndef utility_UriParser_h_
10317027Sdim#define utility_UriParser_h_
11317027Sdim
12317027Sdim#include "llvm/ADT/StringRef.h"
13317027Sdim
14317027Sdimnamespace lldb_private {
15317027Sdimclass UriParser {
16317027Sdimpublic:
17317027Sdim  // Parses
18317027Sdim  // RETURN VALUE
19317027Sdim  //   if url is valid, function returns true and
20317027Sdim  //   scheme/hostname/port/path are set to the parsed values
21317027Sdim  //   port it set to -1 if it is not included in the URL
22317027Sdim  //
23317027Sdim  //   if the url is invalid, function returns false and
24317027Sdim  //   output parameters remain unchanged
25317027Sdim  static bool Parse(llvm::StringRef uri, llvm::StringRef &scheme,
26317027Sdim                    llvm::StringRef &hostname, int &port,
27317027Sdim                    llvm::StringRef &path);
28317027Sdim};
29317027Sdim}
30317027Sdim
31317027Sdim#endif // utility_UriParser_h_
32