Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
txBufferingHandler.cpp File Reference
#include "txBufferingHandler.h"

Go to the source code of this file.

Classes

class  txOutputTransaction
class  txCharacterTransaction
class  txCommentTransaction
class  txPITransaction
class  txElementTransaction
class  txAttributeTransaction
struct  Holder

Functions

 deleteTransaction (void *aElement, void *aData)
 flushTransaction (void *aElement, void *aData)

Class Documentation

struct Holder

Definition at line 319 of file txBufferingHandler.cpp.

Collaboration diagram for Holder:
Class Members
txAXMLEventHandler ** mHandler
const_char_iterator mIter

Function Documentation

deleteTransaction ( void aElement,
void aData 
)

Definition at line 299 of file txBufferingHandler.cpp.

{
    delete NS_STATIC_CAST(txOutputTransaction*, aElement);
    return PR_TRUE;
}

Here is the caller graph for this function:

flushTransaction ( void aElement,
void aData 
)

Definition at line 326 of file txBufferingHandler.cpp.

{
    Holder* holder = NS_STATIC_CAST(Holder*, aData);
    txAXMLEventHandler* handler = *holder->mHandler;
    txOutputTransaction* transaction =
        NS_STATIC_CAST(txOutputTransaction*, aElement);

    switch (transaction->mType) {
        case txOutputTransaction::eAttributeTransaction:
        {
            txAttributeTransaction* attrTransaction =
                NS_STATIC_CAST(txAttributeTransaction*, aElement);
            handler->attribute(attrTransaction->mName,
                               attrTransaction->mNsID,
                               attrTransaction->mValue);
            break;
        }
        case txOutputTransaction::eCharacterTransaction:
        case txOutputTransaction::eCharacterNoOETransaction:
        {
            txCharacterTransaction* charTransaction =
                NS_STATIC_CAST(txCharacterTransaction*, aElement);
            nsAFlatString::const_char_iterator& start =
                NS_STATIC_CAST(Holder*, aData)->mIter;
            nsAFlatString::const_char_iterator end =
                start + charTransaction->mLength;
            handler->characters(Substring(start, end),
                                transaction->mType ==
                                txOutputTransaction::eCharacterNoOETransaction);
            start = end;
            break;
        }
        case txOutputTransaction::eCommentTransaction:
        {
            txCommentTransaction* commentTransaction =
                NS_STATIC_CAST(txCommentTransaction*, aElement);
            handler->comment(commentTransaction->mValue);
            break;
        }
        case txOutputTransaction::eEndElementTransaction:
        {
            txElementTransaction* elementTransaction =
                NS_STATIC_CAST(txElementTransaction*, aElement);
            handler->endElement(elementTransaction->mName,
                                elementTransaction->mNsID);
            break;
        }
        case txOutputTransaction::ePITransaction:
        {
            txPITransaction* piTransaction =
                NS_STATIC_CAST(txPITransaction*, aElement);
            handler->processingInstruction(piTransaction->mTarget,
                                           piTransaction->mData);
            break;
        }
        case txOutputTransaction::eStartDocumentTransaction:
        {
            handler->startDocument();
            break;
        }
        case txOutputTransaction::eStartElementTransaction:
        {
            txElementTransaction* elementTransaction =
                NS_STATIC_CAST(txElementTransaction*, aElement);
            handler->startElement(elementTransaction->mName,
                                  elementTransaction->mNsID);
            break;
        }
    }

    return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function: