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 utility_UriParser_h_ 10#define utility_UriParser_h_ 11 12#include "llvm/ADT/StringRef.h" 13 14namespace lldb_private { 15class UriParser { 16public: 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 // utility_UriParser_h_ 32