| 1 | // |
|---|---|
| 2 | // URI.cpp |
| 3 | // |
| 4 | // This sample demonstrates the URI class. |
| 5 | // |
| 6 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
| 7 | // and Contributors. |
| 8 | // |
| 9 | // SPDX-License-Identifier: BSL-1.0 |
| 10 | // |
| 11 | |
| 12 | |
| 13 | #include "Poco/URI.h" |
| 14 | #include <iostream> |
| 15 | |
| 16 | |
| 17 | using Poco::URI; |
| 18 | |
| 19 | |
| 20 | int main(int argc, char** argv) |
| 21 | { |
| 22 | URI uri1("http://www.appinf.com:81/sample?example-query#somewhere"); |
| 23 | |
| 24 | std::cout << "Scheme: "<< uri1.getScheme() << std::endl |
| 25 | << "Authority: "<< uri1.getAuthority() << std::endl |
| 26 | << "Path: "<< uri1.getPath() << std::endl |
| 27 | << "Query: "<< uri1.getQuery() << std::endl |
| 28 | << "Fragment: "<< uri1.getFragment() << std::endl; |
| 29 | |
| 30 | URI uri2; |
| 31 | uri2.setScheme("https"); |
| 32 | uri2.setAuthority("www.appinf.com"); |
| 33 | uri2.setPath("/another sample"); |
| 34 | |
| 35 | std::cout << uri2.toString() << std::endl; |
| 36 | |
| 37 | return 0; |
| 38 | } |
| 39 |