PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBWebUtil
Wrapper Class for the IWebUtil interface.
#include <SFBWebUtil.h.hpp>
class SFBWebUtil : public SFBQuery;
SFMTYPEDEFWRAPPER(SFBWebUtil)

Inheritance diagram

 Inheritance diagram of SFBWebUtilClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IWebUtil

Member

Public Functions
SInt32 DecodeBase64( VoidConstPtr in , VoidPtr out )
Decode a base64-encoded string into a buffer.
SInt32 DecodeBase64( SFXBufferConstRef in , SFXBufferPtr out )
Decode a base64-encoded string into a buffer.
ACharPtr EncodeBase64( VoidConstPtr in , SInt32 length , VoidPtr out )
Encode a buffer with base64
Void EncodeBase64( SFXBufferConstRef in , SFXBufferPtr out )
Encode a buffer with base64
SFXBuffer EncodeBase64( SFXBufferConstRef in )
Encode a buffer with base64
SInt32 MakeUrl( ACharConstPtr base , ACharConstPtr relative , ACharPtr result , SInt32 resultLength )
Construct a full URL from a base URL and a relative URL, according to RFC2396
SInt32 MakeUrl( SFXAnsiStringConstRef base , SFXAnsiStringConstRef relative , SFXAnsiStringPtr result )
Construct a full URL from a base URL and a relative URL, according to RFC2396
SFXAnsiString MakeUrl( SFXAnsiStringConstRef base , SFXAnsiStringConstRef relative )
Construct a full URL from a base URL and a relative URL, according to RFC2396
static
SFBWebUtilSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBWebUtil instance.
static
SFBWebUtilSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBWebUtil instance.
SInt32 ParseFormFields( ACharHandle in , WebFormField* fields , SInt32 maxFields , UInt32 flags )
Parse the form fields.
SFCError ParseUrl( ACharConstPtr url , UrlParts* parts )
Parse a null-terminated URL string into its constituent parts.
SFCError ParseUrl( SFXAnsiStringConstRef url , UrlParts* parts )
Parse a null-terminated URL string into its constituent parts.
ACharPtr UrlDecode( ACharConstPtr in , SInt32Ptr inLength , ACharPtr out , SInt32Ptr outLength )
Decode characters in a URL-encoded string.
Void UrlDecode( SFXAnsiStringConstRef in , SInt32Ptr inLength , SFXAnsiStringPtr out , SInt32Ptr outLength )
Decode characters in a URL-encoded string.
ACharPtr UrlEncode( ACharConstPtr in , SInt32Ptr inLength , ACharPtr out , SInt32Ptr outLength )
Encode characters in a string for inclusion in a in a URL, according to RFC2936.
Void UrlEncode( SFXAnsiStringConstRef in , SInt32Ptr inLength , SFXAnsiStringPtr out , SInt32Ptr outLength )
Encode characters in a string for inclusion in a in a URL, according to RFC2936.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBWebUtil::DecodeBase64
Decode a base64-encoded string into a buffer.
[ public ]
SInt32 DecodeBase64(
    VoidConstPtr in   // input, base64 encoded, null-terminated 
    VoidPtr out       // output buffer 
);
[ public ]
SInt32 DecodeBase64(
    SFXBufferConstRef in   // input, base64 encoded, null-terminated
    SFXBufferPtr out       // output buffer 
		// if null, do nothing and return -2
);

Reference

BREW API IWEBUTIL_DecodeBase64 | SFBWebUtil::EncodeBase64


SFBWebUtil::EncodeBase64
Encode a buffer with base64
[ public ]
ACharPtr EncodeBase64(
    VoidConstPtr in   // input
    SInt32 length     // length of in
    VoidPtr out       // output buffer 
);
[ public ]
Void EncodeBase64(
    SFXBufferConstRef in   // input
    SFXBufferPtr out       // output buffer 
                           // if null, do nothing and terminate
);
[ public ]
SFXBuffer EncodeBase64(
    SFXBufferConstRef in   // input
);

Reference

BREW API IWEBUTIL_EncodeBase64 | SFBWebUtil::DecodeBase64


SFBWebUtil::MakeUrl
Construct a full URL from a base URL and a relative URL, according to RFC2396
[ public ]
SInt32 MakeUrl(
    ACharConstPtr base       // the null-terminated base URL (may be null) 
    ACharConstPtr relative   // the null-terminated relative URL (may be null) 
    ACharPtr result          // where to put the full URL (may be null) 
    SInt32 resultLength      // size (in bytes) of result 
);
[ public ]
SInt32 MakeUrl(
    SFXAnsiStringConstRef base       // the null-terminated base URL (may be null) 
    SFXAnsiStringConstRef relative   // the null-terminated relative URL (may be null) 
    SFXAnsiStringPtr result          // where to put the full URL (may be null) 
);
[ public ]
SFXAnsiString MakeUrl(
    SFXAnsiStringConstRef base       // the null-terminated base URL (may be null) 
    SFXAnsiStringConstRef relative   // the null-terminated relative URL (may be null) 
);

Reference

BREW API IWEBUTIL_MakeUrl


SFBWebUtil::NewInstance
Create a new SFBWebUtil instance.
[ public, static ]
SFBWebUtilSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBWebUtilSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBWebUtil::ParseFormFields
Parse the form fields.
[ public ]
SInt32 ParseFormFields(
    ACharHandle in         // input/output, pointer to the x-www-urlencoded list of name value pairs, 
                           // on return it is set to the beginning of the next form field. 
                           // neither In nor *In may be null
    WebFormField* fields   // array of WebFormFields to be filled once parsed, may be null
    SInt32 maxFields       // number of the elements in awff
    UInt32 flags           // either 0 or a logical OR of:
                           // WEBUTIL_PFFF_NODECODE - suppress URL decoding of name and value, 
                           // awff will be filled with raw, but null-terminated values. 
                           / this can be useful if you expect binary data in your form fields (since nulls may be encoded as %00) 
                           // WEBUTIL_PFFF_NOMUTATE - suppress URL decoding _and_ null-termination, 
                           // awff will be filled with pointers into *In, any further parsing must be undertaken by the caller. 
                           // in will be set to the next form field, but the memory pointed to by *ppszIn will not be modified
);

Description

Parse the next nMaxFields form fields out of the x-www-urlencoded string *In, store the pointers to the beginnings of each name and value in sequential elements of awff, and advance In to the beginning of the next unparsed form field.

Reference

BREW API IWEBUTIL_ParseFormFields | SFBWebUtil::UrlDecode | WebFormField


SFBWebUtil::ParseUrl
Parse a null-terminated URL string into its constituent parts.
[ public ]
SFCError ParseUrl(
    ACharConstPtr url   // the null-terminated string to parse
    UrlParts* parts     // pointer to UrlParts struct to fill out 
);
[ public ]
SFCError ParseUrl(
    SFXAnsiStringConstRef url   // the null-terminated string to parse
    UrlParts* parts             // pointer to UrlParts struct to fill out 
);

Reference

BREW API IWEBUTIL_ParseUrl | WebRespInfo


SFBWebUtil::UrlDecode
Decode characters in a URL-encoded string.
[ public ]
ACharPtr UrlDecode(
    ACharConstPtr in      // pointer to bytes to decode 
    SInt32Ptr inLength    //  sizeof In, on return set to number of bytes consumed 
    ACharPtr out          // where to decode to 
    SInt32Ptr outLength   // on entry, this provides the maximum number of bytes to write into Out[].
                          // on exit, this holds the number of bytes written to Out[]. 
                          // when Out == null, this input value is ignored and the value on exit 
                          // will be the number of bytes required to hold the decoded string
);
[ public ]
Void UrlDecode(
    SFXAnsiStringConstRef in   // pointer to bytes to decode 
    SInt32Ptr inLength         // sizeof In, on return set to number of bytes consumed
    SFXAnsiStringPtr out       // where to decode to 
    SInt32Ptr outLength        // on entry, this provides the maximum number of bytes to write into Out[].
                               // on exit, this holds the number of bytes written to Out[]. 
                               // when Out == null, this input value is ignored and the value on exit 
                               // will be the number of bytes required to hold the decoded string
);

Reference

BREW API IWEBUTIL_UrlDecode


SFBWebUtil::UrlEncode
Encode characters in a string for inclusion in a in a URL, according to RFC2936.
[ public ]
ACharPtr UrlEncode(
    ACharConstPtr in      // pointer to string to be encoded 
    SInt32Ptr inLength    // pointer to the length of In, set on return to number of bytes successfully encoded 
    ACharPtr out          // where to write encoded bytes, may be null, for counting 
    SInt32Ptr outLength   // on entry, this provides the maximum number of bytes to write into Out[].
		// on exit, this holds the number of bytes written to Out[].
		// when Out == null, this input value is ignored and the value on exit will be the number 
		// of bytes required to hold the encoded string
);
[ public ]
Void UrlEncode(
    SFXAnsiStringConstRef in   // pointer to string to be encoded 
    SInt32Ptr inLength         // pointer to the length of In, set on return to number of bytes successfully encoded 
    SFXAnsiStringPtr out       // where to write encoded bytes, may be null, for counting 
    SInt32Ptr outLength        // on entry, this provides the maximum number of bytes to write into Out[].
		// on exit, this holds the number of bytes written to Out[].
		// when Out == null, this input value is ignored and the value on exit will be the number 
		// of bytes required to hold the encoded string
);

Reference

BREW API IWEBUTIL_UrlEncode