Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsOSHelperAppService.cpp File Reference
#include "nsOSHelperAppService.h"
#include "nsISupports.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsXPIDLString.h"
#include "nsIURL.h"
#include "nsNetCID.h"
#include "nsIFileStreams.h"
#include "nsILineInputStream.h"
#include "nsILocalFile.h"
#include "nsEscape.h"
#include "nsIProcess.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsHashtable.h"
#include "nsCRT.h"
#include "prenv.h"
#include "nsMIMEInfoOS2.h"
#include "nsAutoPtr.h"
#include <stdlib.h>
#include "nsIPref.h"
#include <os2.h>

Go to the source code of this file.

Defines

#define INCL_DOSMISC
#define INCL_DOSERRORS
#define INCL_WINSHELLDATA
#define MAXINIPARAMLENGTH   1024
#define LOG(args)   PR_LOG(mLog, PR_LOG_DEBUG, args)
#define LOG_ENABLED()   PR_LOG_TEST(mLog, PR_LOG_DEBUG)

Functions

static NS_DEFINE_CID (kStandardURLCID, NS_STANDARDURL_CID)
static nsresult FindSemicolon (nsAString::const_iterator &aSemicolon_iter, const nsAString::const_iterator &aEnd_iter)
static nsresult ParseMIMEType (const nsAString::const_iterator &aStart_iter, nsAString::const_iterator &aMajorTypeStart, nsAString::const_iterator &aMajorTypeEnd, nsAString::const_iterator &aMinorTypeStart, nsAString::const_iterator &aMinorTypeEnd, const nsAString::const_iterator &aEnd_iter)
PRBool IsNetscapeFormat (const nsACString &aBuffer)

Define Documentation

Definition at line 70 of file nsOSHelperAppService.cpp.

Definition at line 69 of file nsOSHelperAppService.cpp.

Definition at line 71 of file nsOSHelperAppService.cpp.

#define LOG (   args)    PR_LOG(mLog, PR_LOG_DEBUG, args)

Definition at line 76 of file nsOSHelperAppService.cpp.

Definition at line 77 of file nsOSHelperAppService.cpp.

Definition at line 74 of file nsOSHelperAppService.cpp.


Function Documentation

static nsresult FindSemicolon ( nsAString::const_iterator &  aSemicolon_iter,
const nsAString::const_iterator &  aEnd_iter 
) [static]

Definition at line 130 of file nsOSHelperAppService.cpp.

                                                        {
  PRBool semicolonFound = PR_FALSE;
  while (aSemicolon_iter != aEnd_iter && !semicolonFound) {
    switch(*aSemicolon_iter) {
    case '\\':
      aSemicolon_iter.advance(2);
      break;
    case ';':
      semicolonFound = PR_TRUE;
      break;
    default:
      ++aSemicolon_iter;
      break;
    }
  }
  return NS_OK;
}

Here is the caller graph for this function:

PRBool IsNetscapeFormat ( const nsACString &  aBuffer) [inline]

Definition at line 316 of file nsOSHelperAppService.cpp.

                                            {
  return StringBeginsWith(aBuffer, NS_LITERAL_CSTRING("#--Netscape Communications Corporation MIME Information")) ||
         StringBeginsWith(aBuffer, NS_LITERAL_CSTRING("#--MCOM MIME Information"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kStandardURLCID  ,
NS_STANDARDURL_CID   
) [static]
static nsresult ParseMIMEType ( const nsAString::const_iterator &  aStart_iter,
nsAString::const_iterator &  aMajorTypeStart,
nsAString::const_iterator &  aMajorTypeEnd,
nsAString::const_iterator &  aMinorTypeStart,
nsAString::const_iterator &  aMinorTypeEnd,
const nsAString::const_iterator &  aEnd_iter 
) [static]

Definition at line 150 of file nsOSHelperAppService.cpp.

                                                        {
  nsAString::const_iterator iter(aStart_iter);
  
  // skip leading whitespace
  while (iter != aEnd_iter && nsCRT::IsAsciiSpace(*iter)) {
    ++iter;
  }

  if (iter == aEnd_iter) {
    return NS_ERROR_INVALID_ARG;
  }
  
  aMajorTypeStart = iter;

  // find major/minor separator ('/')
  while (iter != aEnd_iter && *iter != '/') {
    ++iter;
  }
  
  if (iter == aEnd_iter) {
    return NS_ERROR_INVALID_ARG;
  }

  aMajorTypeEnd = iter;
  
  // skip '/'
  ++iter;

  if (iter == aEnd_iter) {
    return NS_ERROR_INVALID_ARG;
  }

  aMinorTypeStart = iter;

  // find end of minor type, delimited by whitespace or ';'
  while (iter != aEnd_iter && !nsCRT::IsAsciiSpace(*iter) && *iter != ';') {
    ++iter;
  }

  aMinorTypeEnd = iter;

  return NS_OK;
}

Here is the caller graph for this function: