Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
nsHttpChannel::nsContentEncodings Class Reference
Inheritance diagram for nsHttpChannel::nsContentEncodings:
Inheritance graph
Collaboration diagram for nsHttpChannel::nsContentEncodings:
Collaboration graph

List of all members.

Public Member Functions

nsContentEncodings (nsIHttpChannel *aChannel, const char *aEncodingHeader)
virtual ~nsContentEncodings ()
boolean hasMore ()
AUTF8String getNext ()

Private Member Functions

nsresult PrepareForNext (void)

Private Attributes

const char * mEncodingHeader
const char * mCurStart
const char * mCurEnd
nsCOMPtr< nsIHttpChannelmChannel
PRPackedBool mReady

Detailed Description

Definition at line 287 of file nsHttpChannel.h.

Constructor & Destructor Documentation

nsHttpChannel::nsContentEncodings::nsContentEncodings ( nsIHttpChannel aChannel,
const char *  aEncodingHeader 

Definition at line 4543 of file nsHttpChannel.cpp.

    mEncodingHeader(aEncodingHeader), mChannel(aChannel), mReady(PR_FALSE)
    mCurEnd = aEncodingHeader + strlen(aEncodingHeader);
    mCurStart = mCurEnd;

Definition at line 4551 of file nsHttpChannel.cpp.


Member Function Documentation

AUTF8String nsIUTF8StringEnumerator::getNext ( ) [inherited]

Definition at line 4640 of file nsHttpChannel.cpp.

    NS_PRECONDITION(mCurStart == mCurEnd, "Indeterminate state");
    // At this point both mCurStart and mCurEnd point to somewhere
    // past the end of the next thing we want to return
    while (mCurEnd != mEncodingHeader) {
        if (*mCurEnd != ',' && !nsCRT::IsAsciiSpace(*mCurEnd))
    if (mCurEnd == mEncodingHeader)
        return NS_ERROR_NOT_AVAILABLE; // no more encodings
    // At this point mCurEnd points to the first char _after_ the
    // header we want.  Furthermore, mCurEnd - 1 != mEncodingHeader
    mCurStart = mCurEnd - 1;
    while (mCurStart != mEncodingHeader &&
           *mCurStart != ',' && !nsCRT::IsAsciiSpace(*mCurStart))
    if (*mCurStart == ',' || nsCRT::IsAsciiSpace(*mCurStart))
        ++mCurStart; // we stopped because of a weird char, so move up one
    // At this point mCurStart and mCurEnd bracket the encoding string
    // we want.  Check that it's not "identity"
    if (Substring(mCurStart, mCurEnd).Equals("identity",
                                             nsCaseInsensitiveCStringComparator())) {
        mCurEnd = mCurStart;
        return PrepareForNext();
    mReady = PR_TRUE;
    return NS_OK;

Here is the call graph for this function:

Member Data Documentation

Definition at line 306 of file nsHttpChannel.h.

Definition at line 302 of file nsHttpChannel.h.

Definition at line 301 of file nsHttpChannel.h.

Definition at line 300 of file nsHttpChannel.h.

Definition at line 308 of file nsHttpChannel.h.

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