Files
poco/Foundation/samples/URI/src/URI.cpp
Roger Meier b0581433a7 LICENSE: add info about SPDX-License-Identifier usage and use it
fix: remove executable flag and change back to 100644 (was 100755)

Signed-off-by: Roger Meier <r.meier@siemens.com>
2014-05-14 08:38:09 +02:00

41 lines
923 B
C++

//
// URI.cpp
//
// $Id: //poco/1.4/Foundation/samples/URI/src/URI.cpp#1 $
//
// This sample demonstrates the URI class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/URI.h"
#include <iostream>
using Poco::URI;
int main(int argc, char** argv)
{
URI uri1("http://www.appinf.com:81/sample?example-query#somewhere");
std::cout << "Scheme: " << uri1.getScheme() << std::endl
<< "Authority: " << uri1.getAuthority() << std::endl
<< "Path: " << uri1.getPath() << std::endl
<< "Query: " << uri1.getQuery() << std::endl
<< "Fragment: " << uri1.getFragment() << std::endl;
URI uri2;
uri2.setScheme("https");
uri2.setAuthority("www.appinf.com");
uri2.setPath("/another sample");
std::cout << uri2.toString() << std::endl;
return 0;
}