GNU CommonC++
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Related Functions | List of all members
ost::URLStream Class Reference

A URL processing version of TCPStream. More...

#include <url.h>

Inheritance diagram for ost::URLStream:
ost::TCPStream ost::Socket

Public Types

enum  Error {
  errSuccess = 0, errUnreachable, errMissing, errDenied,
  errInvalid, errForbidden, errUnauthorized, errRelocated,
  errFailure, errTimeout, errInterface
}
 Return error for url fetch. More...
 
enum  Authentication { authAnonymous = 0, authBasic }
 Type of authentication. More...
 
enum  Encoding { encodingBinary = 0, encodingChunked }
 Encoding used in transfer. More...
 
enum  Method {
  methodHttpGet, methodHttpPut, methodHttpPost, methodHttpPostMultipart,
  methodFtpGet, methodFtpPut, methodFileGet, methodFilePut
}
 Type of fetch. More...
 
enum  Protocol { protocolHttp1_0, protocolHttp1_1 }
 http protocol version More...
 
- Public Types inherited from ost::Socket
enum  Family { IPV6 = AF_INET6, IPV4 = AF_INET }
 
enum  Error {
  errSuccess = 0, errCreateFailed, errCopyFailed, errInput,
  errInputInterrupt, errResourceFailure, errOutput, errOutputInterrupt,
  errNotConnected, errConnectRefused, errConnectRejected, errConnectTimeout,
  errConnectFailed, errConnectInvalid, errConnectBusy, errConnectNoRoute,
  errBindingFailed, errBroadcastDenied, errRoutingDenied, errKeepaliveDenied,
  errServiceDenied, errServiceUnavailable, errMulticastDisabled, errTimeout,
  errNoDelay, errExtended, errLookupFail, errSearchErr,
  errInvalidValue
}
 
enum  Tos {
  tosLowDelay = 0, tosThroughput, tosReliability, tosMinCost,
  tosInvalid
}
 
enum  Pending { pendingInput, pendingOutput, pendingError }
 
typedef enum Family Family
 
typedef enum Error Error
 
typedef enum Tos Tos
 
typedef enum Pending Pending
 

Public Member Functions

 URLStream (Family family=IPV4, timeout_t timer=0)
 Construct an instance of URL stream. More...
 
URLStreamgetline (char *buffer, size_t len)
 Line parsing with conversion. More...
 
Error get (const char *url, size_t buffer=512)
 Get URL data from a named stream of a known buffer size. More...
 
Error get (size_t buffer=512)
 Get URL data from a named stream of a known buffer size. More...
 
Error submit (const char *url, const char **vars, size_t buffer=512)
 Submit URL with vars passed as argument array. More...
 
Error post (const char *url, const char **vars, size_t buffer=512)
 Post URL vars with post method. More...
 
Error post (const char *url, MIMEMultipartForm &form, size_t buffer=512)
 Post URL with MIME multipart form. More...
 
Error head (const char *url, size_t buffer=512)
 Used to fetch header information for a resource. More...
 
void close ()
 Close the URL stream for a new connection. More...
 
void setReferer (const char *str)
 Set the referer url. More...
 
void setHost (const char *str)
 Set the host for the url. More...
 
void setAddress (const char *str)
 Set the address for the url. More...
 
void setCookie (const char *str)
 Set the cookie to pass. More...
 
void setUser (const char *str)
 Set user id for the url. More...
 
void setPassword (const char *str)
 Set password for the url. More...
 
void setAuthentication (Authentication a, const char *str=NULL)
 Set authentication type for the url. More...
 
void setProxyUser (const char *str)
 Set proxy user id for the url. More...
 
void setProxyPassword (const char *str)
 Set proxy password for the url. More...
 
void setProxyAuthentication (Authentication a, const char *str=NULL)
 Set proxy authentication type for the url. More...
 
void setPragma (const char *str)
 Set the pragmas. More...
 
void setProxy (const char *host, tpport_t port)
 Set the proxy server used. More...
 
void setAgent (const char *str)
 Set the agent. More...
 
Method getMethod (void)
 Get url method (and protocol) employed. More...
 
void setTimeout (timeout_t to)
 Set socket timeout characteristics for processing URL requests. More...
 
void setFollow (bool enable)
 Specify url following. More...
 
void setProtocol (Protocol pro)
 Specify http protocol level being used. More...
 
void setLocalInterface (const char *intf)
 Specify local interface to use. More...
 
- Public Member Functions inherited from ost::TCPStream
 TCPStream (Family family=IPV4, bool throwflag=true, timeout_t to=0)
 The constructor required for building other classes or to start an unconnected TCPStream for connect. More...
 
void disconnect (void)
 Disconnect the current session and prepare for a new one. More...
 
int getSegmentSize (void)
 Get protocol segment size. More...
 
 TCPStream (TCPSocket &server, bool throwflag=true, timeout_t timeout=0)
 Create a TCP stream by accepting a connection from a bound TCP socket acting as a server. More...
 
 TCPStream (TCPV6Socket &server, bool throwflag=true, timeout_t timeout=0)
 
void connect (TCPSocket &server)
 Accept a connection from a TCP Server. More...
 
void connect (TCPV6Socket &server)
 
 TCPStream (const IPV4Host &host, tpport_t port, unsigned mss=536, bool throwflag=true, timeout_t timeout=0)
 Create a TCP stream by connecting to a TCP socket (on a remote machine). More...
 
 TCPStream (const IPV6Host &host, tpport_t port, unsigned mss=536, bool throwflag=true, timeout_t timeout=0)
 
 TCPStream (const char *name, Family family=IPV4, unsigned mss=536, bool throwflag=false, timeout_t timer=0)
 Construct a named TCP Socket connected to a remote machine. More...
 
void setTimeout (timeout_t timer)
 Set the I/O operation timeout for socket I/O operations. More...
 
 TCPStream (const TCPStream &source)
 A copy constructor creates a new stream buffer. More...
 
virtual ~TCPStream ()
 Flush and empty all buffers, and then remove the allocated buffers. More...
 
int sync (void)
 Flushes the stream input and output buffers, writes pending output. More...
 
size_t printf (const char *format,...)
 Print content into a socket. More...
 
bool isPending (Pending pend, timeout_t timeout=TIMEOUT_INF)
 Get the status of pending stream data. More...
 
ssize_t peek (void *buf, size_t len)
 Examine contents of next waiting packet. More...
 
size_t getBufferSize (void) const
 Return the size of the current stream buffering used. More...
 
- Public Member Functions inherited from ost::Socket
virtual ~Socket ()
 The socket base class may be "thrown" as a result of an error, and the "catcher" may then choose to destroy the object. More...
 
Socketoperator= (const Socket &from)
 Sockets may also be duplicated by the assignment operator. More...
 
virtual IPV4Host getIPV4Sender (tpport_t *port=NULL) const
 May be used to examine the origin of data waiting in the socket receive queue. More...
 
IPV4Host getSender (tpport_t *port=NULL) const
 
virtual IPV6Host getIPV6Sender (tpport_t *port=NULL) const
 
IPV4Host getIPV4Peer (tpport_t *port=NULL) const
 Get the host address and port of the socket this socket is connected to. More...
 
IPV4Host getPeer (tpport_t *port=NULL) const
 
IPV6Host getIPV6Peer (tpport_t *port=NULL) const
 
IPV4Host getIPV4Local (tpport_t *port=NULL) const
 Get the local address and port number this socket is currently bound to. More...
 
IPV4Host getLocal (tpport_t *port=NULL) const
 
IPV6Host getIPV6Local (tpport_t *port=NULL) const
 
IPV4Host getIPV4NAT (tpport_t *port=NULL) const
 Perform NAT table lookup for this socket. More...
 
IPV4Host getNAT (tpport_t *port) const
 
IPV6Host getIPV6NAT (tpport_t *port=NULL) const
 
void setCompletion (bool immediate)
 Used to specify blocking mode for the socket. More...
 
Error setLinger (bool linger)
 Enable lingering sockets on close. More...
 
Error setKeepAlive (bool enable)
 Set the keep-alive status of this socket and if keep-alive messages will be sent. More...
 
Error setTypeOfService (Tos service)
 Set packet scheduling on platforms which support ip quality of service conventions. More...
 
bool isConnected (void) const
 Can test to see if this socket is "connected", and hence whether a "catch" can safely call getPeer(). More...
 
bool isActive (void) const
 Test to see if the socket is at least operating or if it is mearly initialized. More...
 
bool operator! () const
 Operator based testing to see if a socket is currently active. More...
 
bool isBroadcast (void) const
 Return if broadcast has been enabled for the specified socket. More...
 
bool isRouted (void) const
 Return if socket routing is enabled. More...
 
Error getErrorNumber (void) const
 Often used by a "catch" to fetch the last error of a thrown socket. More...
 
const char * getErrorString (void) const
 Often used by a "catch" to fetch the user set error string of a thrown socket, but only if EXTENDED error codes are used. More...
 
long getSystemError (void) const
 
const char * getSystemErrorString (void) const
 

Protected Member Functions

Error sendHTTPHeader (const char *url, const char **vars, size_t bufsize)
 Send http header to server. More...
 
int underflow (void)
 Called if stream buffer needs refilling. More...
 
virtual int aRead (char *buffer, size_t len, timeout_t timer)
 Derived method for async or timed I/O function on url stream. More...
 
virtual int aWrite (char *buffer, size_t len, timeout_t timer)
 Derived method for async or timed I/O function on url stream. More...
 
virtual void httpHeader (const char *header, const char *value)
 Derived method to receive and parse http "headers". More...
 
virtual char ** extraHeader (void)
 A virtual to insert additional header info into the request. More...
 
- Protected Member Functions inherited from ost::TCPStream
void allocate (size_t size)
 Used to allocate the buffer space needed for iostream operations. More...
 
void endStream (void)
 Used to terminate the buffer space and cleanup the socket connection. More...
 
int underflow ()
 This streambuf method is used to load the input buffer through the established tcp socket connection. More...
 
int uflow ()
 This streambuf method is used for doing unbuffered reads through the establish tcp socket connection when in interactive mode. More...
 
int overflow (int ch)
 This streambuf method is used to write the output buffer through the established tcp connection. More...
 
void connect (const IPV4Host &host, tpport_t port, unsigned mss=536)
 Create a TCP stream by connecting to a TCP socket (on a remote machine). More...
 
void connect (const IPV6Host &host, tpport_t port, unsigned mss=536)
 
void connect (const char *name, unsigned mss=536)
 Connect a TCP stream to a named destination host and port number, using getaddrinfo interface if available. More...
 
std::iostream * tcp (void)
 Used in derived classes to refer to the current object via it's iostream. More...
 
- Protected Member Functions inherited from ost::Socket
Error error (Error error, const char *err=NULL, long systemError=0) const
 This service is used to throw all socket errors which usually occur during the socket constructor. More...
 
void error (const char *err) const
 This service is used to throw application defined socket errors where the application specific error code is a string. More...
 
void setError (bool enable)
 This service is used to turn the error handler on or off for "throwing" exceptions by manipulating the thrown flag. More...
 
void endSocket (void)
 Used as the default destructor for ending a socket. More...
 
Error connectError (void)
 Used as a common handler for connection failure processing. More...
 
Error sendLimit (int limit=2048)
 Set the send limit. More...
 
Error receiveLimit (int limit=1)
 Set thr receive limit. More...
 
Error sendTimeout (timeout_t timer)
 Set the send timeout for sending raw network data. More...
 
Error receiveTimeout (timeout_t timer)
 Receive timeout for receiving raw network data. More...
 
Error sendBuffer (unsigned size)
 Set the protocol stack network kernel send buffer size associated with the socket. More...
 
Error receiveBuffer (unsigned size)
 Set the protocol stack network kernel receive buffer size associated with the socket. More...
 
Error bufferSize (unsigned size)
 Set the total protocol stack network kernel buffer size for both send and receive together. More...
 
Error setBroadcast (bool enable)
 Set the subnet broadcast flag for the socket. More...
 
Error setMulticastByFamily (bool enable, Family family=IPV4)
 Setting multicast binds the multicast interface used for the socket to the interface the socket itself has been implicitly bound to. More...
 
Error setLoopbackByFamily (bool enable, Family family=IPV4)
 Set the multicast loopback flag for the socket. More...
 
Error setTimeToLiveByFamily (unsigned char ttl, Family fam=IPV4)
 Set the multicast time to live for a multicast socket. More...
 
Error join (const IPV4Multicast &ia)
 Join a multicast group. More...
 
Error join (const IPV6Multicast &ia)
 
Error drop (const IPV4Multicast &ia)
 Drop membership from a multicast group. More...
 
Error drop (const IPV6Multicast &ia)
 
Error setRouting (bool enable)
 Set the socket routing to indicate if outgoing messages should bypass normal routing (set false). More...
 
Error setNoDelay (bool enable)
 Enable/disable delaying packets (Nagle algorithm) More...
 
 Socket (int domain, int type, int protocol=0)
 An unconnected socket may be created directly on the local machine. More...
 
 Socket (SOCKET fd)
 A socket object may be created from a file descriptor when that descriptor was created either through a socket() or accept() call. More...
 
 Socket ()
 Create an inactive socket object for base constructors. More...
 
 Socket (const Socket &source)
 A socket can also be constructed from an already existing Socket object. More...
 
ssize_t readLine (char *buf, size_t len, timeout_t timeout=0)
 Process a logical input line from a socket descriptor directly. More...
 
virtual ssize_t readData (void *buf, size_t len, char separator=0, timeout_t t=0)
 Read in a block of len bytes with specific separator. More...
 
virtual ssize_t writeData (const void *buf, size_t len, timeout_t t=0)
 Write a block of len bytes to socket. More...
 

Protected Attributes

ost::String m_host
 
ost::String m_address
 
- Protected Attributes inherited from ost::TCPStream
timeout_t timeout
 
size_t bufsize
 
Family family
 
char * gbuf
 
char * pbuf
 
- Protected Attributes inherited from ost::Socket
struct {
   bool   thrown: 1
 
   bool   broadcast: 1
 
   bool   route: 1
 
   bool   keepalive: 1
 
   bool   loopback: 1
 
   bool   multicast: 1
 
   bool   completion: 1
 
   bool   linger: 1
 
   unsigned   ttl: 8
 
flags
 
SOCKET volatile so
 the actual socket descriptor, in Windows, unlike posix it cannot be used as an file descriptor that way madness lies – jfc More...
 
State volatile state
 

Related Functions

(Note that these are not member functions.)

__EXPORT char * urlDecode (char *source, char *dest=NULL)
 
__EXPORT char * urlEncode (const char *source, char *dest, size_t size)
 
__EXPORT char * b64Decode (char *src, char *dest=NULL)
 
__EXPORT char * b64Encode (const char *source, char *dest, size_t size)
 
__EXPORT size_t b64Encode (const unsigned char *src, size_t srcsize, char *dst, size_t dstsize)
 
__EXPORT size_t b64Decode (const char *src, unsigned char *dst, size_t dstsize)
 
__EXPORT String b64Encode (const String &src)
 
__EXPORT String b64Decode (const String &src)
 
__EXPORT String b64Encode (const unsigned char *src, size_t srcsize)
 
__EXPORT size_t b64Decode (const String &src, unsigned char *dst, size_t dstsize)
 

Additional Inherited Members

- Static Public Member Functions inherited from ost::Socket
static bool check (Family fam)
 See if a specific protocol family is available in the current runtime environment. More...
 
- Protected Types inherited from ost::Socket
enum  State {
  INITIAL, AVAILABLE, BOUND, CONNECTED,
  CONNECTING, STREAM
}
 
typedef enum State State
 
- Static Protected Attributes inherited from ost::Socket
static Mutex mutex
 

Detailed Description

A URL processing version of TCPStream.

Author
David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m

C++ url processing stream class.

Examples
urlfetch.cpp, and xmlfetch.cpp.

Member Enumeration Documentation

◆ Authentication

Type of authentication.

Enumerator
authAnonymous 
authBasic 

◆ Encoding

Encoding used in transfer.

Enumerator
encodingBinary 
encodingChunked 

◆ Error

Return error for url fetch.

Enumerator
errSuccess 
errUnreachable 
errMissing 
errDenied 
errInvalid 
errForbidden 
errUnauthorized 
errRelocated 
errFailure 
errTimeout 
errInterface 

◆ Method

Type of fetch.

Enumerator
methodHttpGet 
methodHttpPut 
methodHttpPost 
methodHttpPostMultipart 
methodFtpGet 
methodFtpPut 
methodFileGet 
methodFilePut 

◆ Protocol

http protocol version

Enumerator
protocolHttp1_0 
protocolHttp1_1 

Constructor & Destructor Documentation

◆ URLStream()

ost::URLStream::URLStream ( Family  family = IPV4,
timeout_t  timer = 0 
)

Construct an instance of URL stream.

Parameters
familyprotocol to use.
timerfor default timeout on I/O operations.

Member Function Documentation

◆ aRead()

virtual int ost::URLStream::aRead ( char *  buffer,
size_t  len,
timeout_t  timer 
)
protectedvirtual

Derived method for async or timed I/O function on url stream.

Returns
number of bytes read or < 0 for error.
Parameters
bufferto read stream data into.
lenof bytes to read from stream.
timerto wait for data in milliseconds.

◆ aWrite()

virtual int ost::URLStream::aWrite ( char *  buffer,
size_t  len,
timeout_t  timer 
)
protectedvirtual

Derived method for async or timed I/O function on url stream.

Returns
number of bytes written or < 0 for error.
Parameters
bufferto write stream data from.
lenof bytes to write to stream.
timerto wait for data in milliseconds.

◆ close()

void ost::URLStream::close ( )

Close the URL stream for a new connection.

◆ extraHeader()

virtual char** ost::URLStream::extraHeader ( void  )
protectedvirtual

A virtual to insert additional header info into the request.

Returns
array of header attributes to add.

◆ get() [1/2]

Error ost::URLStream::get ( const char *  url,
size_t  buffer = 512 
)

Get URL data from a named stream of a known buffer size.

Returns
url error code.
Parameters
urlname of resource.
buffersize of buffer.

◆ get() [2/2]

Error ost::URLStream::get ( size_t  buffer = 512)

Get URL data from a named stream of a known buffer size.

Requesting URL defined in previous calls of setAddress() and setHost() functions.

Returns
url error code.
Parameters
buffersize of buffer.

◆ getline()

URLStream& ost::URLStream::getline ( char *  buffer,
size_t  len 
)

Line parsing with conversion.

Returns
URLStream object reference.
Parameters
bufferto store.
lenmaximum buffer size.

◆ getMethod()

Method ost::URLStream::getMethod ( void  )
inline

Get url method (and protocol) employed.

Returns
url method in effect.

◆ head()

Error ost::URLStream::head ( const char *  url,
size_t  buffer = 512 
)

Used to fetch header information for a resource.

Returns
url error code.
Parameters
urlname of resource.
buffersize of buffer.

◆ httpHeader()

virtual void ost::URLStream::httpHeader ( const char *  header,
const char *  value 
)
protectedvirtual

Derived method to receive and parse http "headers".

Parameters
headerkeyword.
valueheader keyword value.

◆ post() [1/2]

Error ost::URLStream::post ( const char *  url,
const char **  vars,
size_t  buffer = 512 
)

Post URL vars with post method.

Returns
success or error code.
Parameters
urlname of resource being posted.
varsto set in post.
buffersize of buffer.

◆ post() [2/2]

Error ost::URLStream::post ( const char *  url,
MIMEMultipartForm form,
size_t  buffer = 512 
)

Post URL with MIME multipart form.

Returns
success or error code.
Parameters
urlname of resource being posted.
formmulti-part resource.
buffersize to use.

◆ sendHTTPHeader()

Error ost::URLStream::sendHTTPHeader ( const char *  url,
const char **  vars,
size_t  bufsize 
)
protected

Send http header to server.

Parameters
urlbase to send header to
varsto post or use in get method
bufsizeof stream buffering to use
Returns
success or class error

◆ setAddress()

void ost::URLStream::setAddress ( const char *  str)
inline

Set the address for the url.

Parameters
straddress in the URL.

◆ setAgent()

void ost::URLStream::setAgent ( const char *  str)
inline

Set the agent.

Parameters
stragent value.

◆ setAuthentication()

void ost::URLStream::setAuthentication ( Authentication  a,
const char *  str = NULL 
)

Set authentication type for the url.

Parameters
aauthentication.
strstring.

◆ setCookie()

void ost::URLStream::setCookie ( const char *  str)
inline

Set the cookie to pass.

Parameters
strcookie string.

◆ setFollow()

void ost::URLStream::setFollow ( bool  enable)
inline

Specify url following.

Set to false to disable following of relocation requests.

Parameters
enabletrue to enable following.

◆ setHost()

void ost::URLStream::setHost ( const char *  str)
inline

Set the host for the url.

Parameters
strhost address.

◆ setLocalInterface()

void ost::URLStream::setLocalInterface ( const char *  intf)
inline

Specify local interface to use.

Parameters
intfLocal interface name

◆ setPassword()

void ost::URLStream::setPassword ( const char *  str)
inline

Set password for the url.

Parameters
strpassword.

◆ setPragma()

void ost::URLStream::setPragma ( const char *  str)
inline

Set the pragmas.

Parameters
strpragma setting.

◆ setProtocol()

void ost::URLStream::setProtocol ( Protocol  pro)
inline

Specify http protocol level being used.

Parameters
proprotocol level.

◆ setProxy()

void ost::URLStream::setProxy ( const char *  host,
tpport_t  port 
)

Set the proxy server used.

Parameters
hostproxy host.
portproxy port.

◆ setProxyAuthentication()

void ost::URLStream::setProxyAuthentication ( Authentication  a,
const char *  str = NULL 
)

Set proxy authentication type for the url.

Parameters
aauthentication.
strstring.

◆ setProxyPassword()

void ost::URLStream::setProxyPassword ( const char *  str)
inline

Set proxy password for the url.

Parameters
strpassword.

◆ setProxyUser()

void ost::URLStream::setProxyUser ( const char *  str)
inline

Set proxy user id for the url.

Parameters
struser id.

◆ setReferer()

void ost::URLStream::setReferer ( const char *  str)

Set the referer url.

Parameters
strreferer string.

◆ setTimeout()

void ost::URLStream::setTimeout ( timeout_t  to)
inline

Set socket timeout characteristics for processing URL requests.

Set to 0 for no default timeouts.

Parameters
totimeout to set.

◆ setUser()

void ost::URLStream::setUser ( const char *  str)
inline

Set user id for the url.

Parameters
struser id.

◆ submit()

Error ost::URLStream::submit ( const char *  url,
const char **  vars,
size_t  buffer = 512 
)

Submit URL with vars passed as argument array.

This submit assumes "GET" method. Use "post" member to perform post.

Returns
url error code.
Parameters
urlname of resource.
varsto set.
buffersize of buffer.

◆ underflow()

int ost::URLStream::underflow ( void  )
protected

Called if stream buffer needs refilling.

Returns
number of bytes refilled or error if < 0

Friends And Related Function Documentation

◆ b64Decode() [1/4]

__EXPORT char * b64Decode ( char *  src,
char *  dest = NULL 
)
related

Decode a string using base64 coding. Destination size should be at least strlen(src)+1. Destination will be a string, so is always terminated . This function is deprecated, base64 can use binary source, not only string use overloaded b64Decode.

Returns
string coded
Parameters
srcsource buffer
destdestination buffer. If NULL src is used

◆ b64Decode() [2/4]

__EXPORT size_t b64Decode ( const char *  src,
unsigned char *  dst,
size_t  dstsize 
)
related

Decode a string using base64 coding. Destination size should be at least strlen(src)/4*3. Destination are not string terminated (It's just a octet stream).

Returns
number of octets written into destination buffer
Parameters
srcsource string
dstdestination octet buffer
dstsizedestination buffer size

◆ b64Decode() [3/4]

__EXPORT String b64Decode ( const String src)
related

Decode a STL string using base64 coding into an STL String. Destination size should be at least strlen(src)/4*3. Destination are not string terminated (It's just a octet stream).

Returns
decoded string
Parameters
srcsource string

◆ b64Decode() [4/4]

__EXPORT size_t b64Decode ( const String src,
unsigned char *  dst,
size_t  dstsize 
)
related

Decode a string using base64 coding. Destination size should be at least strlen(src)/4*3. Destination are not string terminated (It's just a octet stream).

Returns
number of octets written into destination buffer
Parameters
srcsource string
dstdestination octet buffer
dstsizedestination buffer size

◆ b64Encode() [1/4]

__EXPORT char * b64Encode ( const char *  source,
char *  dest,
size_t  size 
)
related

Encode a string using base64 coding. Destination size should be at least strlen(src)/4*3+1. Destination is string terminated. This function is deprecated, coded stream can contain terminator character use overloaded b64Encode instead.

Returns
destination buffer
Parameters
sourcesource string
destdestination octet buffer
sizedestination buffer size

◆ b64Encode() [2/4]

__EXPORT String b64Encode ( const String src)
related

Encode a STL string using base64 coding into a STL string

Returns
base 64 encoded string
Parameters
srcsource string

◆ b64Encode() [3/4]

__EXPORT String b64Encode ( const unsigned char *  src,
size_t  srcsize 
)
related

Encode a octet stream using base64 coding into a STL string

Returns
base 64 encoded string
Parameters
srcsource buffer
srcsizesource buffer size

◆ b64Encode() [4/4]

__EXPORT size_t b64Encode ( const unsigned char *  src,
size_t  srcsize,
char *  dst,
size_t  dstsize 
)
related

Encode a octet stream using base64 coding. Destination size should be at least (srcsize+2)/3*4+1. Destination will be a string, so is always terminated (unless you pass dstsize == 0).

Returns
size of string written not counting terminator
Parameters
srcsource buffer
srcsizesource buffer size
dstdestination buffer
dstsizedestination buffer size

◆ urlDecode()

__EXPORT char * urlDecode ( char *  source,
char *  dest = NULL 
)
related

Decode an url parameter (ie "\%20" -> " ")

Parameters
sourcestring
destdestination buffer. If NULL source is used

◆ urlEncode()

__EXPORT char * urlEncode ( const char *  source,
char *  dest,
size_t  size 
)
related

Encode an url parameter (ie " " -> "+")

Parameters
sourcestring
destdestination buffer. Do not overlap with source
sizedestination buffer size.

Member Data Documentation

◆ m_address

ost::String ost::URLStream::m_address
protected

◆ m_host

ost::String ost::URLStream::m_host
protected

The documentation for this class was generated from the following file: