Back to index

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

#include <nsOutlookCompose.h>

List of all members.

Public Member Functions

 SimpleBufferTonyRCopiedTwice ()
 ~SimpleBufferTonyRCopiedTwice ()
PRBool Allocate (PRInt32 sz)
PRBool Grow (PRInt32 newSize)
PRBool ReAllocate (PRInt32 newSize)
PRBool Write (PRInt32 offset, const char *pData, PRInt32 len, PRInt32 *pWritten)
PRBool Write (const char *pData, PRInt32 len)
PRBool SpecialMemCpy (PRInt32 offset, const char *pData, PRInt32 len, PRInt32 *pWritten)

Public Attributes

PRBool m_convertCRs
char * m_pBuffer
PRInt32 m_bytesInBuf
PRInt32 m_size
PRInt32 m_growBy
PRInt32 m_writeOffset

Detailed Description

Definition at line 69 of file nsOutlookCompose.h.


Constructor & Destructor Documentation

Definition at line 71 of file nsOutlookCompose.h.

Definition at line 73 of file nsOutlookCompose.h.

{ if (m_pBuffer) delete [] m_pBuffer;}

Member Function Documentation

Definition at line 75 of file nsOutlookCompose.h.

                                    { 
              if (m_pBuffer) delete [] m_pBuffer; 
              m_pBuffer = new char[sz]; 
              if (m_pBuffer) { m_size = sz; return( PR_TRUE); }
              else { m_size = 0; return( PR_FALSE);}
       }

Here is the caller graph for this function:

Definition at line 82 of file nsOutlookCompose.h.

{ if (newSize > m_size) return( ReAllocate( newSize)); else return( PR_TRUE);}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 83 of file nsOutlookCompose.h.

                                           {
              if (newSize <= m_size) return( PR_TRUE);
              char *pOldBuffer = m_pBuffer;
              PRInt32       oldSize = m_size;
              m_pBuffer = nsnull;
              while (m_size < newSize) m_size += m_growBy;
              if (Allocate( m_size)) {
                     if (pOldBuffer) { memcpy( m_pBuffer, pOldBuffer, oldSize); delete [] pOldBuffer;}
                     return( PR_TRUE);
              }
              else { m_pBuffer = pOldBuffer; m_size = oldSize; return( PR_FALSE);}
       }

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool SimpleBufferTonyRCopiedTwice::SpecialMemCpy ( PRInt32  offset,
const char *  pData,
PRInt32  len,
PRInt32 pWritten 
)

Definition at line 744 of file nsOutlookCompose.cpp.

{
       // Arg!!!!!  Mozilla can't handle plain CRs in any mail messages.  Particularly a 
       // problem with Eudora since it doesn't give a rats a**
       *pWritten = len;
       PRInt32       sz = offset + len;
       if (offset) {
              if ((m_pBuffer[offset - 1] == 0x0D) && (*pData != 0x0A)) {
                     sz++;
                     if (!Grow( sz)) return( PR_FALSE);
                     m_pBuffer[offset] = 0x0A;
                     offset++;
                     (*pWritten)++;
              }
       }
       while (len > 0) {
              if ((*pData == 0x0D) && (*(pData + 1) != 0x0A)) {
                     sz++;
                     if (!Grow( sz)) return( PR_FALSE);
                     m_pBuffer[offset] = 0x0D;
                     offset++;
                     m_pBuffer[offset] = 0x0A;                                                    
                     (*pWritten)++;
              }
              else {
                     m_pBuffer[offset] = *pData;
              }
              offset++;
              pData++;
              len--;
       }
       
       return( PR_TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool SimpleBufferTonyRCopiedTwice::Write ( PRInt32  offset,
const char *  pData,
PRInt32  len,
PRInt32 pWritten 
) [inline]

Definition at line 96 of file nsOutlookCompose.h.

                                                                                        {
              *pWritten = len;
              if (!len) return( PR_TRUE);
              if (!Grow( offset + len)) return( PR_FALSE);
              if (m_convertCRs)
                     return( SpecialMemCpy( offset, pData, len, pWritten));
              memcpy( m_pBuffer + offset, pData, len);
              return( PR_TRUE);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool SimpleBufferTonyRCopiedTwice::Write ( const char *  pData,
PRInt32  len 
) [inline]

Definition at line 106 of file nsOutlookCompose.h.

                                                     { 
              PRInt32 written;
              if (Write( m_writeOffset, pData, len, &written)) { m_writeOffset += written; return( PR_TRUE);}
              else return( PR_FALSE);
       }

Here is the call graph for this function:


Member Data Documentation

Definition at line 116 of file nsOutlookCompose.h.

Definition at line 114 of file nsOutlookCompose.h.

Definition at line 118 of file nsOutlookCompose.h.

Definition at line 115 of file nsOutlookCompose.h.

Definition at line 117 of file nsOutlookCompose.h.

Definition at line 119 of file nsOutlookCompose.h.


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