Back to index

lightning-sunbird  0.9+nobinonly
nsMailboxUrl.cpp File Reference
#include "msgCore.h"
#include "nsIURI.h"
#include "nsIMailboxUrl.h"
#include "nsMailboxUrl.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsEscape.h"
#include "nsCRT.h"
#include "nsLocalUtils.h"
#include "nsIMsgDatabase.h"
#include "nsMsgDBCID.h"
#include "nsMsgBaseCID.h"
#include "nsIMsgHdr.h"
#include "nsXPIDLString.h"
#include "nsIRDFService.h"
#include "rdf.h"
#include "nsIMsgFolder.h"
#include "prprf.h"
#include "nsISupportsObsolete.h"
#include "nsIMsgMailSession.h"
#include "nsCOMPtr.h"
#include "nsIMsgAccountManager.h"
#include "nsMsgUtils.h"

Go to the source code of this file.


char * extractAttributeValue (const char *searchString, const char *attributeName)

Function Documentation

char * extractAttributeValue ( const char *  searchString,
const char *  attributeName 

Definition at line 392 of file nsMailboxUrl.cpp.

  char * attributeValue = nsnull;
  if (searchString && attributeName)
    // search the string for attributeName
    PRUint32 attributeNameSize = PL_strlen(attributeName);
    char * startOfAttribute = PL_strcasestr(searchString, attributeName);
    if (startOfAttribute)
      startOfAttribute += attributeNameSize; // skip over the attributeName
      if (startOfAttribute) // is there something after the attribute name
        char * endofAttribute = startOfAttribute ? PL_strchr(startOfAttribute, '&') : nsnull;
        if (startOfAttribute && endofAttribute) // is there text after attribute value
          attributeValue = PL_strndup(startOfAttribute, endofAttribute - startOfAttribute);
        else // there is nothing left so eat up rest of line.
          attributeValue = PL_strdup(startOfAttribute);
        // now unescape the string...
        if (attributeValue)
          attributeValue = nsUnescape(attributeValue); // unescape the string...
      } // if we have a attribute value
    } // if we have a attribute name
  } // if we got non-null search string and attribute name values
  return attributeValue;

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kCMailDB  ,
) [static]