Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsNewsUtils.h File Reference
#include "nsString.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define kNewsRootURILen   6
#define kNntpRootURILen   6
#define kNewsMessageRootURILen   14


nsresult nsParseNewsMessageURI (const char *uri, nsCString &messageUriWithoutKey, PRUint32 *key)
nsresult nsCreateNewsBaseMessageURI (const char *baseURI, char **baseMessageURI)


static const char kNntpRootURI [] = "nntp:/"
static const char kNewsRootURI [] = "news:/"
static const char kNewsMessageRootURI [] = "news-message:/"

Define Documentation

Definition at line 51 of file nsNewsUtils.h.

Definition at line 49 of file nsNewsUtils.h.

Definition at line 50 of file nsNewsUtils.h.

Function Documentation

nsresult nsCreateNewsBaseMessageURI ( const char *  baseURI,
char **  baseMessageURI 

Definition at line 76 of file nsNewsUtils.cpp.

              return NS_ERROR_NULL_POINTER;

       nsCAutoString tailURI(baseURI);

       // chop off mailbox:/
       if (tailURI.Find(kNewsRootURI) == 0)
              tailURI.Cut(0, PL_strlen(kNewsRootURI));
       nsCAutoString baseURIStr(kNewsMessageRootURI);
       baseURIStr += tailURI;

       *baseMessageURI = ToNewCString(baseURIStr);
              return NS_ERROR_OUT_OF_MEMORY;

       return NS_OK;

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsParseNewsMessageURI ( const char *  uri,
nsCString messageUriWithoutKey,
PRUint32 key 

Definition at line 47 of file nsNewsUtils.cpp.


       nsCAutoString uriStr(uri);
       PRInt32 keySeparator = uriStr.FindChar('#');
       if(keySeparator != -1)
    PRInt32 keyEndSeparator = uriStr.FindCharInSet("?&", 

              uriStr.Left(folderURI, keySeparator);
        folderURI.Cut(4, 8);    // cut out the -message part of news-message:

              nsCAutoString keyStr;
    if (keyEndSeparator != -1)
        uriStr.Mid(keyStr, keySeparator+1, 
        uriStr.Right(keyStr, uriStr.Length() - (keySeparator + 1));
              PRInt32 errorCode;
              *key = keyStr.ToInteger(&errorCode);

              return errorCode;
       return NS_ERROR_FAILURE;

Here is the caller graph for this function:

Variable Documentation

const char kNewsMessageRootURI[] = "news-message:/" [static]

Definition at line 47 of file nsNewsUtils.h.

const char kNewsRootURI[] = "news:/" [static]

Definition at line 46 of file nsNewsUtils.h.

const char kNntpRootURI[] = "nntp:/" [static]

Definition at line 45 of file nsNewsUtils.h.