#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(80);
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