Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
nsPluginManifestLineReader Class Reference

#include <nsPluginManifestLineReader.h>

List of all members.

Public Member Functions

 nsPluginManifestLineReader ()
 ~nsPluginManifestLineReader ()
char * Init (PRUint32 flen)
PRBool NextLine ()
int ParseLine (char **chunks, int maxChunks)
char * LinePtr ()
PRUint32 LineLength ()
PRBool IsEOL (char c)

Public Attributes

char * mBase

Private Attributes

char * mCur
PRUint32 mLength
char * mNext
char * mLimit

Detailed Description

Definition at line 52 of file nsPluginManifestLineReader.h.


Constructor & Destructor Documentation

Definition at line 55 of file nsPluginManifestLineReader.h.

{mBase = mCur = mNext = mLimit = 0;} 

Definition at line 56 of file nsPluginManifestLineReader.h.

{ if (mBase) delete[] mBase; mBase=0;}

Member Function Documentation

char* nsPluginManifestLineReader::Init ( PRUint32  flen) [inline]

Definition at line 58 of file nsPluginManifestLineReader.h.

    {
        mBase = mCur = mNext = new char[flen+1];
        if (mBase) {
          mLimit = mBase + flen;
          *mLimit = 0;
        }
        mLength = 0;
        return mBase;
    }

Here is the caller graph for this function:

Definition at line 128 of file nsPluginManifestLineReader.h.

{return c == '\n' || c == '\r';}

Here is the caller graph for this function:

Definition at line 126 of file nsPluginManifestLineReader.h.

{return mLength;}    

Here is the caller graph for this function:

Definition at line 125 of file nsPluginManifestLineReader.h.

{return mCur;}    

Here is the caller graph for this function:

Definition at line 69 of file nsPluginManifestLineReader.h.

    {
        if(mNext >= mLimit)
            return PR_FALSE;
        
        mCur = mNext;
        mLength = 0;
        
        char *lastDelimiter = 0;
        while(mNext < mLimit)
        {
            if(IsEOL(*mNext))
            {
                if(lastDelimiter)
                {
                    if(lastDelimiter && *(mNext - 1) != PLUGIN_REGISTRY_END_OF_LINE_MARKER)
                        return PR_FALSE;
                    *lastDelimiter = '\0';
                } else
                    *mNext = '\0';

                for(++mNext; mNext < mLimit; ++mNext)
                    if(!IsEOL(*mNext))
                        break;
                return PR_TRUE;
            }
            if(*mNext == PLUGIN_REGISTRY_FIELD_DELIMITER)
                lastDelimiter = mNext;
            ++mNext;
            ++mLength;
        }
        return PR_FALSE;        
    }

Here is the call graph for this function:

Here is the caller graph for this function:

int nsPluginManifestLineReader::ParseLine ( char **  chunks,
int  maxChunks 
) [inline]

Definition at line 103 of file nsPluginManifestLineReader.h.

    {
        NS_ASSERTION(mCur && maxChunks && chunks, "bad call to ParseLine");
        int found = 0;
        chunks[found++] = mCur;
        
        if(found < maxChunks)
        {
            for(char* cur = mCur; *cur; cur++)
            {
                if(*cur == PLUGIN_REGISTRY_FIELD_DELIMITER)
                {
                    *cur = 0;
                    chunks[found++] = cur+1;
                    if(found == maxChunks)
                        break;
                }
            }
        }
        return found;
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 130 of file nsPluginManifestLineReader.h.

Definition at line 132 of file nsPluginManifestLineReader.h.

Definition at line 133 of file nsPluginManifestLineReader.h.

Definition at line 135 of file nsPluginManifestLineReader.h.

Definition at line 134 of file nsPluginManifestLineReader.h.


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