summaryrefslogtreecommitdiff
path: root/src/url.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 02:14:08 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 02:14:08 +0000
commitf5aca1a1b402bd7ebc944dc6e6fe65828d863365 (patch)
tree4a0fdd8e166d5c4b03543279d332b9a858ef62df /src/url.h
parent10c557562e1d67c55314c212371ea9cb7f802863 (diff)
downloadlibbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.tar.gz
libbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.tar.bz2
libbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.tar.xz
libbu++-f5aca1a1b402bd7ebc944dc6e6fe65828d863365.zip
Bu::FString is now String, and there's a shell script to fix any other programs
that were using fstring, I hope.
Diffstat (limited to '')
-rw-r--r--src/url.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/url.h b/src/url.h
index ea761ef..13a918e 100644
--- a/src/url.h
+++ b/src/url.h
@@ -8,7 +8,7 @@
8#ifndef BU_URL_H 8#ifndef BU_URL_H
9#define BU_URL_H 9#define BU_URL_H
10 10
11#include "bu/fstring.h" 11#include "bu/string.h"
12#include "bu/atom.h" 12#include "bu/atom.h"
13 13
14namespace Bu 14namespace Bu
@@ -20,61 +20,61 @@ namespace Bu
20 { 20 {
21 Param() { } 21 Param() { }
22 Param( const Param &r ) : sName( r.sName ), sValue( r.sValue ) { } 22 Param( const Param &r ) : sName( r.sName ), sValue( r.sValue ) { }
23 Param( const Bu::FString &n, const Bu::FString &v ) : 23 Param( const Bu::String &n, const Bu::String &v ) :
24 sName( n ), sValue( v ) { } 24 sName( n ), sValue( v ) { }
25 Bu::FString sName; 25 Bu::String sName;
26 Bu::FString sValue; 26 Bu::String sValue;
27 } Param; 27 } Param;
28 typedef Bu::List<Param> ParamList; 28 typedef Bu::List<Param> ParamList;
29 29
30 public: 30 public:
31 Url(); 31 Url();
32 Url( const Bu::FString &sUrl ); 32 Url( const Bu::String &sUrl );
33 virtual ~Url(); 33 virtual ~Url();
34 34
35 void parseUrl( const Bu::FString &sUrl ); 35 void parseUrl( const Bu::String &sUrl );
36 void parseParams( const Bu::FString &sQuery ); 36 void parseParams( const Bu::String &sQuery );
37 void parseParams( Bu::FString::const_iterator &i ); 37 void parseParams( Bu::String::const_iterator &i );
38 void parsePath( const Bu::FString &sPath ); 38 void parsePath( const Bu::String &sPath );
39 void parsePath( Bu::FString::const_iterator &i ); 39 void parsePath( Bu::String::const_iterator &i );
40 void clear(); 40 void clear();
41 41
42 Bu::FString getUrl() const; 42 Bu::String getUrl() const;
43 Bu::FString getFullPath() const; 43 Bu::String getFullPath() const;
44 44
45 const Bu::FString &getProtocol() const { return sProtocol; } 45 const Bu::String &getProtocol() const { return sProtocol; }
46 const Bu::FString &getUser() const { return sUser; } 46 const Bu::String &getUser() const { return sUser; }
47 const Bu::FString &getPass() const { return sPass; } 47 const Bu::String &getPass() const { return sPass; }
48 const Bu::FString &getHost() const { return sHost; } 48 const Bu::String &getHost() const { return sHost; }
49 const Bu::FString &getPath() const { return sPath; } 49 const Bu::String &getPath() const { return sPath; }
50 int getPort() const { return iPort; } 50 int getPort() const { return iPort; }
51 ParamList::const_iterator getParamBegin() const 51 ParamList::const_iterator getParamBegin() const
52 { return lParam.begin(); } 52 { return lParam.begin(); }
53 53
54 void setProtocol( const Bu::FString &sNewHost, bool bAutoSetPort=true ); 54 void setProtocol( const Bu::String &sNewHost, bool bAutoSetPort=true );
55 void setUser( const Bu::FString &s ) { sUser = s; } 55 void setUser( const Bu::String &s ) { sUser = s; }
56 void setPass( const Bu::FString &s ) { sPass = s; } 56 void setPass( const Bu::String &s ) { sPass = s; }
57 void setHost( const Bu::FString &s ) { sHost = s; } 57 void setHost( const Bu::String &s ) { sHost = s; }
58 void setPath( const Bu::FString &s ) { sPath = s; } 58 void setPath( const Bu::String &s ) { sPath = s; }
59 void setPort( int i ) { iPort = i; } 59 void setPort( int i ) { iPort = i; }
60 void addParam( const Bu::FString &n, const Bu::FString &v ); 60 void addParam( const Bu::String &n, const Bu::String &v );
61 61
62 bool hasPort() const { return iPort.has(); } 62 bool hasPort() const { return iPort.has(); }
63 63
64 static Bu::FString decode( const Bu::FString &sStr ); 64 static Bu::String decode( const Bu::String &sStr );
65 static Bu::FString encode( const Bu::FString &sStr ); 65 static Bu::String encode( const Bu::String &sStr );
66 66
67 private: // Parsing code 67 private: // Parsing code
68 void parseProtocol( Bu::FString::const_iterator &i ); 68 void parseProtocol( Bu::String::const_iterator &i );
69 void parseUserPass( Bu::FString::const_iterator &i ); 69 void parseUserPass( Bu::String::const_iterator &i );
70 void parseHost( Bu::FString::const_iterator &i ); 70 void parseHost( Bu::String::const_iterator &i );
71 71
72 private: 72 private:
73 Bu::FString sProtocol; 73 Bu::String sProtocol;
74 Bu::FString sUser; 74 Bu::String sUser;
75 Bu::FString sPass; 75 Bu::String sPass;
76 Bu::FString sHost; 76 Bu::String sHost;
77 Bu::FString sPath; 77 Bu::String sPath;
78 Bu::Atom<int> iPort; 78 Bu::Atom<int> iPort;
79 ParamList lParam; 79 ParamList lParam;
80 80