Vince Harron | 3218c0f | 2015-01-06 23:38:24 +0000 | [diff] [blame] | 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 | // C Includes |
| 14 | // C++ Includes |
| 15 | #include <string> |
| 16 | |
| 17 | // Other libraries and framework includes |
| 18 | // Project includes |
| 19 | |
| 20 | class UriParser |
| 21 | { |
| 22 | public: |
Vince Harron | e6c5dcf | 2015-01-15 20:57:01 +0000 | [diff] [blame] | 23 | // Parses |
| 24 | // RETURN VALUE |
| 25 | // if url is valid, function returns true and |
| 26 | // scheme/hostname/port/path are set to the parsed values |
| 27 | // port it set to -1 if it is not included in the URL |
| 28 | // |
| 29 | // if the url is invalid, function returns false and |
| 30 | // output parameters remain unchanged |
Oleksiy Vyalov | 5497185 | 2015-08-20 23:09:34 +0000 | [diff] [blame^] | 31 | static bool |
| 32 | Parse(const std::string& uri, |
| 33 | std::string& scheme, |
| 34 | std::string& hostname, |
| 35 | int& port, |
| 36 | std::string& path); |
Vince Harron | 3218c0f | 2015-01-06 23:38:24 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | #endif // utility_UriParser_h_ |