aboutsummaryrefslogtreecommitdiff
path: root/src/tests/url.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-04-06 19:13:51 +0000
committerMike Buland <eichlan@xagasoft.com>2009-04-06 19:13:51 +0000
commit514721c24c7212c084ad2530e8239ff121097818 (patch)
treebfe5d346e767df47d10a5631e33a2e0540d72604 /src/tests/url.cpp
parentaaeaa599a14642e916bbd8a32a208ee96a26eaac (diff)
downloadlibbu++-514721c24c7212c084ad2530e8239ff121097818.tar.gz
libbu++-514721c24c7212c084ad2530e8239ff121097818.tar.bz2
libbu++-514721c24c7212c084ad2530e8239ff121097818.tar.xz
libbu++-514721c24c7212c084ad2530e8239ff121097818.zip
Ok, I rearranged some things, we have a tools dir now, those build by default.
Also I added a bunch of classes that I've been tinkering with that are almost ready for use, so I figured I may as well throw them in here.
Diffstat (limited to '')
-rw-r--r--src/tests/url.cpp45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/tests/url.cpp b/src/tests/url.cpp
index c9af676..4dc8c46 100644
--- a/src/tests/url.cpp
+++ b/src/tests/url.cpp
@@ -4,28 +4,31 @@
4 4
5int main( int argc, char *argv[] ) 5int main( int argc, char *argv[] )
6{ 6{
7 printf("encodede: %s\n", Bu::Url::encode( argv[1] ).getStr() ); 7 for( argc--, argv++; argc >= 0; argc--, argv++ )
8 printf("decodede: %s\n", Bu::Url::decode( argv[1] ).getStr() );
9 Bu::Url u( argv[1] );
10
11 printf("Protocol: %s\n", u.getProtocol().getStr() );
12 printf("User: %s\n", u.getUser().getStr() );
13 printf("Pass: %s\n", u.getPass().getStr() );
14 printf("Host: %s\n", u.getHost().getStr() );
15 printf("Path: %s\n", u.getPath().getStr() );
16 try
17 {
18 printf("Port: %d\n", u.getPort() );
19 } catch( Bu::ExceptionBase &e )
20 { 8 {
21 printf("Port: not set.\n"); 9 printf("encodede: %s\n", Bu::Url::encode( *argv ).getStr() );
22 } 10 printf("decodede: %s\n", Bu::Url::decode( *argv ).getStr() );
23 printf("Parameters:\n"); 11 Bu::Url u( *argv );
24 for( Bu::Url::ParamList::const_iterator i = u.getParamBegin(); i; i++ ) 12
25 { 13 printf("Protocol: %s\n", u.getProtocol().getStr() );
26 printf(" \"%s\" = \"%s\"\n", 14 printf("User: %s\n", u.getUser().getStr() );
27 (*i).sName.getStr(), (*i).sValue.getStr() 15 printf("Pass: %s\n", u.getPass().getStr() );
28 ); 16 printf("Host: %s\n", u.getHost().getStr() );
17 printf("Path: %s\n", u.getPath().getStr() );
18 try
19 {
20 printf("Port: %d\n", u.getPort() );
21 } catch( Bu::ExceptionBase &e )
22 {
23 printf("Port: not set.\n");
24 }
25 printf("Parameters:\n");
26 for( Bu::Url::ParamList::const_iterator i = u.getParamBegin(); i; i++ )
27 {
28 printf(" \"%s\" = \"%s\"\n",
29 (*i).sName.getStr(), (*i).sValue.getStr()
30 );
31 }
29 } 32 }
30 33
31 return 0; 34 return 0;