#include<iostream>
#include<typeinfo>
#include<Poco/Path.h>
#include <Poco/DirectoryIterator.h>
#include <Poco/URI.h>
using namespace std;
using namespace Poco; int main(){
string s("/media/ygy/YGY");
Path my_path (s);
cout<< Path::current()<<endl; URI uri(s);
cout<<uri.toString()<<endl; uri.setFragment("ygy");
uri.setAuthority("Authority"); uri.setHost("Host");
uri.setPath(s);
//uri.setPathEtc("pathEtc");
uri.setPort();
uri.setQuery("query");
uri.setRawQuery("RawQuery");
uri.setScheme("scheme");
uri.setUserInfo("userInfo");
cout <<uri.getFragment()<<endl;
cout<<uri.getHost()<<endl;
cout<<uri.getPath()<<endl;
cout<<uri.getPathAndQuery()<<endl;
cout<<uri.getPathEtc()<<endl;
cout <<uri.getPort()<<endl;
cout <<uri.getQuery()<<endl;
cout<<uri.getRawQuery()<<endl;
cout <<uri.getScheme()<<endl;
cout<<uri.getUserInfo()<<endl;
cout<<"------"<<endl;
cout<<uri.toString()<<endl;
} root@goodjob:~/work/poco/path# ./test
/home/ygy/work/poco/path/
/media/ygy/YGY
ygy
Host
/media/ygy/YGY
/media/ygy/YGY?RawQuery
/media/ygy/YGY?RawQuery#ygy
80
RawQuery
RawQuery
scheme
userInfo
------
scheme://userInfo@Host:80/media/ygy/YGY?RawQuery#ygy

Poco::URI的更多相关文章

  1. c++ poco库https调用

    #include "Poco\File.h"#include "Poco\FileStream.h"#include "Poco\Process.h& ...

  2. Poco C++——HTTP的post请求和get请求

    两种请求都需要包含头文件: #include <iostream> #include <string> #include "Poco/Net/HTTPClientSe ...

  3. Poco之ftp目录切换与创建

    TEMPLATE = app QT += qml quick widgets#LIBS += -lPocoFoundation -lPocoXML -lPocoNetSOURCES += main.c ...

  4. [poco] HttpRequest之post方法

    转自 http://www.cnblogs.com/yuanxiaoping_21cn_com/archive/2012/06/10/2544032.html #import <iostream ...

  5. 【转】Poco 1.4.2 HTTPClientSession/HTTPRequest 使用使用代理(proxy)需要注意的一点

    Poco 1.4.2 HTTPClientSession/HTTPClientSession 在使用代理的时候,request的URI不能包含协议和主机.否则会出错. 不使用代理的时候,以下代码能正常 ...

  6. 使用POCO发送HTTP(S)请求

    POCO GitHub地址https://github.com/pocoproject/poco http_example.cpp #include <iostream> #include ...

  7. MongoDB地理空间数据存储及检索

    目录 1.存入地理数据 GeoJSON数据存入 1.Ponit 点数据 2.LineString 线数据(多段线) 3. Polygon 多边形数据 4.MultiPoint多点.MultiLineS ...

  8. android开发-c++代码调用so库

    Android项目的CMakeLists.txt代码如下,so文件放在项目的$Project/app/src/main/jniLibs/$arch下,$arch替换为arm64-v8a armv7a等 ...

  9. C++写动态站点之HelloWorld!

    演示样例源码下载地址:Fetch_Platform.7z 更复杂的代码可參考本博客BBS的实现 简单的说.动态站点就是能够动态变更的站点.动态变化的内容通常来自后端数据库.例如以下省略万字(动态站点) ...

随机推荐

  1. Spring Cloud(十):服务网关 Zuul(路由)【Finchley 版】

    Spring Cloud(十):服务网关 Zuul(路由)[Finchley 版]  发表于 2018-04-23 |  更新于 2018-05-09 |  通过之前几篇 Spring Cloud 中 ...

  2. RL_Learning

    Key Concepts in RL 标签(空格分隔): RL_learning OpenAI Spinning Up原址 states and observations (状态和观测) action ...

  3. kvm虚拟化操作

    本节演示如何使用 virt-manager 启动 KVM 虚机. 首先通过命令 virt-manager 启动图形界面 # virt-manager 点上面的图标创建虚机 给虚机命名为 kvm1,这里 ...

  4. hibernate 异常a different object with the same identifier value was already associated with the session

    在使用hibernate的时候发现了一个问题,记录一下解决方案. 前提开启了事务和事务间并无commit,进行两次save,第二次的时候爆出下面的异常a different object with t ...

  5. 第一课——从main到WinMain

    一.Visual C++6.0 由微软公司推出的基于Windows系统的可视化集成开发环境(IDE) 微软公司为其开发了功能强大的MFC(Microsoft Foundation Class,微软基础 ...

  6. c++反射概念-简单介绍

    C++ 反射机制的简单实现 C++并不支持反射机制,只能自己实现. 如果需要实现字字符串到函数到映射,一定要使用到函数指针. 简单实现反射机制,根据字符串来构造相应到类.主要有以下几点: (1) 可以 ...

  7. C#语言使用redis

    文章:Redis总结(二)C#中如何使用redis 文章:Redis总结(三)Redis 的主从复制 文章:Redis总结(四)Redis 的持久化

  8. LintCode-54.转换字符串到整数

    转换字符串到整数 实现atoi这个函数,将一个字符串转换为整数.如果没有合法的整数,返回0.如果整数超出了32位整数的范围,返回INT_MAX(2147483647)如果是正整数,或者INT_MIN( ...

  9. Javascript动态方法调用与参数修改的问题

    Javascript中可以对所传参数在函数内进行修改,如下 ? 1 2 3 4 5 function func1(name) {     name = 'lily';     alert(name); ...

  10. iOS- <项目笔记>UI控件常见属性总结

    1.UIView // 如果userInteractionEnabled=NO,不能跟用户交互 @property(nonatomic,getter=isUserInteractionEnabled) ...