class ADataItem : public ABase | |
---|---|
This is a base class for an object that will be contained by AList (uni-directional linked list object). | |
Method | Description |
void diSetNext ( ADataItem *padiNext ) public |
Set the next ADataItem-derived object in the list. Polymorphism and dynamic_cast<> should be used when
accessing objects derived from this one. Returns: Nothing. |
ADataItem *diGetNext ( void ) public |
Access method to the next object in the linked list. Returns: A pointer to ADataItem-derived object. |
class AList : public ABase | |
---|---|
A linked list container object, that cleans itself up upon destruction. Contains ADataItem-derived objects. This object can also function as a queue or a stack with the access methods provided. | |
Method | Description |
int lIsEmpty ( void ) public |
Tests if the list is empty. Returns: Non-zero if the list contains at least one object. |
int lGetCount ( void ) public |
Items count. Returns: Number of items in the list. |
ADataItem *lGetHead ( void ) public |
Retrieves the first object in the list. Use RTTI-enabled CAST() macro to cast to your derived type. Returns: A pointer to ADataItem of the first object, or NULL if none. |
ADataItem *lGetAt ( int iIndex ) public |
Retrieves object number {iIndex} from the list. Use RTTI-enabled CAST() macro to cast to your derived type. Returns: ADataItem * of object number {iIndex} or NULL if no such object. |
ADataItem *lGetLast ( void ) public |
Retrieves the first object in the list. Use RTTI-enabled CAST() macro to cast to your derived type. Returns: A pointer to ADataItem of the first object, or NULL if none. |
void lAdd ( ADataItem *padiNew ) public |
Adds {padiNew} to the end of the list. Returns: Nothing. |
void lInsertAfter ( ADataItem *padiNew, ADataItem *padiAfter=NULL ) public |
Insert {padiNew} after {padiAfter}. If {padiAfter} is NULL, then insert at the head (a queue insert). Returns: Nothing. |
void lRemove ( ADataItem *padiRemove ) public |
Finds and removes {padiRemove} from the list. If not found, nothing happens. Returns: Nothing. |
void lRemove ( int iIndex ) public |
Removes object number {iIndex} from the list. If the index is out of bounds, nothing happens. Returns: Nothing. |
void lKill ( int iStartIndex=0x0 ) public |
Kills all objects in the list from {iStartIndex} to the end of the list. Returns: Nothing. |
class APairItem : RTTI_VIRTUAL public ABaseElement, RTTI_VIRTUAL public ADataItem | |
---|---|
A basic pair item, contains NAME=VALUE pair that is common to HTML and OS environments. ADataItem makes it an element of a list and ABaseElement gives it an ability to display contents to an AStreamOutput object. | |
Method | Description |
virtual void doOut ( AStreamOutput *pasOut ) public |
Any child of ABaseElement should override this method to customize its own output. Output: {NAME}={VALUE} Returns: Nothing. |
const char *piGetName ( void ) public |
Gets the current {NAME} of this object. Returns: Nothing. |
const char *piGetValue ( void ) public |
Gets the current {VALUE} of this object. Returns: Nothing. |
int piSet ( const char *pccName, const char *pccValue=NULL ) public |
Sets this object to {pccName} and {pccValue|NULL} specified. {VALUE} can be NULL and if it is, the output will simply contain the {NAME} without ={VALUE}. Returns: Non-zero if no errors occured and {pccName} was not NULL. |
void piSetValue ( const char *pccValue ) public |
Sets this object's {pccValue}. {VALUE} can be NULL and if it is, the output will simply contain the {NAME} without ={VALUE}. Returns: Nothing. |
void piSetValueEncoded ( const BYTE *pcbUserData, int iLength, UINT uMethod=AConverto::eat4Bit, const BYTE *pcbKey=NULL, int iKeyLength=0x0 ) public |
Once you set the {NAME} member of this object, you can use this method to set the value to an encoded version
of your {pcbUserData} of length {iLength}. The default method is 4Bit encoding. You can however specify
any encoding method and optionally an encryption method with an (|). If encryption if specified you have to
provide a key {pcbKey} of length {iKeyLength}. Call piDecodeValueAndGetUserData to undo this process,
the key used in both methods must be identical (obviously). Return: Nothing. |
const BYTE *piDecodeValueAndGetUserData
(
int &iLength, UINT uMethod=AConverto::eat4Bit, const BYTE *pcbKey=NULL, int iKeyLength=0x0 ) public |
This method undecodes (and optionally unencrypts) the {VALUE} member of this object. It essentialy undoes what
piSetValueEncoded creates, which was probably sent to a user and returned back as a submission item. This method
modifies the {iLength} variable to the actual length of the returned const BYTE * Returns: const BYTE * of the binary data encoded in the {VALUE} member. |
void piSetValueChecked
( const BYTE *pcbUserData, int iUserDataLength, DWORD dwUserID=0x0, UINT uMethod=AConverto::eat6Bit, const BYTE *pcbKey=NULL, int iKeyLength=0x0 ) public |
Works similar to piSetValueEncoded, except here {dwUserID} is embedded into the {VALUE} as well as CRC32 and a timestamp.
The encoding method is a bit more secure and if you change the 6Bit map in the global g_aCrypto object, then encoding will
also be custom to you application. Returns: Nothing. |
const BYTE *piDecodeCheckedValueAndGetUserData ( int &iUserDataLength, DWORD dwUserID=0x0, int iTimeout=-0x1, UINT uMethod=AConverto::eat6Bit, const BYTE *pcbKey=NULL, int iKeyLength=0x0 ) public |
Works similar to piDecodeValueAndGetUserData, except you can specify a {iTimeout} in seconds and {dwUserID} for comparison. Returns: A pointer to user data stored in the {VALUE} or NULL is invalid data, timed-out, or invalid {dwUserID} value. |
DWORD piIsFlag ( DWORD dwCheck ) public |
Checks in a configuration flag PI_xxx is set. So far only PI_QUOTED exists, which enables quotes around the {VALUE} during output Returns: Non-zero if the flag is set. |
void piSetFlag ( DWORD dwSet ) public |
Set a configuration flag. Returns: Nothing. |
void piClearFlag ( DWORD dwClear=0x0 ) public |
Clear a configuration flag. By default nothing is cleared. Returns: Nothing. |
class APairList : RTTI_VIRTUAL public AList, RTTI_VIRTUAL public ABaseElement | |
---|---|
This object is a container of APairItem objects. Adds methods for easily manipulating paired items as well as searching ability by {NAME}. | |
Method | Description |
virtual void doOut ( AStreamOutput *pasOut ) public |
Displays all pair items {NAME}={VALUE}, unquoted and separated by a space ' '. Output is to AStreamOutput-derived object. Calls doPairs method. Returns: Nothing. |
void doPairs ( AStreamOutput *pasOut, char cSeparator=' ', int iItemsPerLine=INT_MAX, int iQuoted=0x0, int iURLEncode=0x0 ) public |
Method used for formatting output of the pair items contained in the list. {cSeparator} character is put after each pair.
{iItemsPerLine} is pairs before end-of-line. {iQuoted} is to set quotes around the {VALUE} member. If {iURLEndode} is set
URL encoding is done on the {VALUE}. Returns: Nothing. |
const char *plGetValueByName ( const char *pccName, APairItem *ppiStart=NULL, BYTE bPartial=0x0, BYTE bAnywhere=0x0 ) public |
Searched the list for the {VALUE} associated to the {pccName}. You can specify the item to start searching at, which
can be useful when many items with same {NAME} exist. {bPartial} will match {NAME} that constains {pcName} from start of
the string. {bAnywhere} will allow you to search {pccName} anywhere in the {NAME}. {bPartial} and {bAnywhere} can be combined. Returns: const char * to the {VALUE}, NULL is none found. |
APairItem *plGetItemByName ( const char *pccName, APairItem *ppiStart=NULL, BYTE bPartial=0x0, BYTE bAnywhere=0x0 ) public |
Works just like plGetValueByName, except it returns the pointer to the APairItem object. Returns: Pointer to the APairItem that matches the search, NULL if none found. |
APairItem *plCreateNewItem ( const char *pccName, const char *pccValue=NULL ) public |
Creates a new APairItem but does not add it to the list. Does not check for duplicates. Returns: Pointer to the new object that was added, NULL if it could not be added. |
APairItem *plAddItem ( const char *pccName, const char *pccValue=NULL, int iReplace=0x1 ) public |
Adds APairItem to the end of the list. If {iReplace} is set, then the first {NAME} that matches {pccName} is replaced. Returns: Pointer to an APairItem object that was either added or existed in the list. |
void plRemoveItemByName ( const char *pccName, int iRemoveAllSameName=0x1 ) public |
Removes item(s) where {NAME} matches {pccName}. If {iRemoveAllSameName} is set, all such items are removed. Returns: Nothing. |