Public Types | Static Public Member Functions

nsCRT Class Reference

This is a wrapper class around all the C runtime functions. More...

#include <nsCRT.h>

List of all members.

Public Types

enum  { LF = '\n', VTAB = '\v', CR = '\r' }

Static Public Member Functions

static PRUint32 strlen (const char *s)
 Compute the string length of s.
static PRInt32 strcmp (const char *s1, const char *s2)
 Compare s1 and s2.
static PRInt32 strncmp (const char *s1, const char *s2, PRUint32 aMaxLen)
static PRInt32 strcasecmp (const char *s1, const char *s2)
 Case-insensitive string comparison.
static PRInt32 strncasecmp (const char *s1, const char *s2, PRUint32 aMaxLen)
 Case-insensitive string comparison with length.
static PRInt32 strncmp (const char *s1, const char *s2, PRInt32 aMaxLen)
static char * strdup (const char *str)
static char * strndup (const char *str, PRUint32 len)
static void free (char *str)
static char * strtok (char *str, const char *delims, char **newStr)
 How to use this fancy (thread-safe) version of strtok:
static PRUint32 strlen (const PRUnichar *s)
static PRInt32 strcmp (const PRUnichar *s1, const PRUnichar *s2)
 Like strcmp except for ucs2 strings.
static PRInt32 strncmp (const PRUnichar *s1, const PRUnichar *s2, PRUint32 aMaxLen)
 Like strcmp except for ucs2 strings.
static PRUnicharstrdup (const PRUnichar *str)
static PRUnicharstrndup (const PRUnichar *str, PRUint32 len)
static void free (PRUnichar *str)
static PRUint32 HashCode (const char *str, PRUint32 *resultingStrLen=0)
static PRUint32 HashCode (const char *start, PRUint32 length)
static PRUint32 HashCode (const PRUnichar *str, PRUint32 *resultingStrLen=0)
static PRUint32 HashCodeAsUTF8 (const PRUnichar *start, PRUint32 length)
static PRUint32 BufferHashCode (const PRUnichar *str, PRUint32 strLen)
static PRInt64 atoll (const char *str)
static char ToUpper (char aChar)
static char ToLower (char aChar)
static PRBool IsUpper (char aChar)
static PRBool IsLower (char aChar)
static PRBool IsAscii (PRUnichar aChar)
static PRBool IsAscii (const PRUnichar *aString)
static PRBool IsAsciiAlpha (PRUnichar aChar)
static PRBool IsAsciiDigit (PRUnichar aChar)
static PRBool IsAsciiSpace (PRUnichar aChar)
static PRBool IsAscii (const char *aString)
static PRBool IsAscii (const char *aString, PRUint32 aLength)

Detailed Description

This is a wrapper class around all the C runtime functions.


Member Enumeration Documentation

anonymous enum
Enumerator:
LF 
VTAB 
CR 

Member Function Documentation

static PRInt64 nsCRT::atoll ( const char *  str  )  [static]
static PRUint32 nsCRT::BufferHashCode ( const PRUnichar str,
PRUint32  strLen 
) [static]
static void nsCRT::free ( char *  str  )  [inline, static]
static void nsCRT::free ( PRUnichar str  )  [inline, static]
static PRUint32 nsCRT::HashCode ( const char *  str,
PRUint32 *  resultingStrLen = 0 
) [static]
static PRUint32 nsCRT::HashCode ( const char *  start,
PRUint32  length 
) [static]
static PRUint32 nsCRT::HashCode ( const PRUnichar str,
PRUint32 *  resultingStrLen = 0 
) [static]
static PRUint32 nsCRT::HashCodeAsUTF8 ( const PRUnichar start,
PRUint32  length 
) [static]
static PRBool nsCRT::IsAscii ( const char *  aString  )  [inline, static]
static PRBool nsCRT::IsAscii ( const char *  aString,
PRUint32  aLength 
) [inline, static]
static PRBool nsCRT::IsAscii ( PRUnichar  aChar  )  [inline, static]
static PRBool nsCRT::IsAscii ( const PRUnichar aString  )  [inline, static]
static PRBool nsCRT::IsAsciiAlpha ( PRUnichar  aChar  )  [inline, static]
static PRBool nsCRT::IsAsciiDigit ( PRUnichar  aChar  )  [inline, static]
static PRBool nsCRT::IsAsciiSpace ( PRUnichar  aChar  )  [inline, static]
static PRBool nsCRT::IsLower ( char  aChar  )  [inline, static]
static PRBool nsCRT::IsUpper ( char  aChar  )  [inline, static]
static PRInt32 nsCRT::strcasecmp ( const char *  s1,
const char *  s2 
) [inline, static]

Case-insensitive string comparison.

static PRInt32 nsCRT::strcmp ( const PRUnichar s1,
const PRUnichar s2 
) [static]

Like strcmp except for ucs2 strings.

static PRInt32 nsCRT::strcmp ( const char *  s1,
const char *  s2 
) [inline, static]

Compare s1 and s2.

static PRUnichar* nsCRT::strdup ( const PRUnichar str  )  [static]
static char* nsCRT::strdup ( const char *  str  )  [inline, static]
static PRUint32 nsCRT::strlen ( const char *  s  )  [inline, static]

Compute the string length of s.

Parameters:
s the string in question
Returns:
the length of s
static PRUint32 nsCRT::strlen ( const PRUnichar s  )  [inline, static]
static PRInt32 nsCRT::strncasecmp ( const char *  s1,
const char *  s2,
PRUint32  aMaxLen 
) [inline, static]

Case-insensitive string comparison with length.

static PRInt32 nsCRT::strncmp ( const char *  s1,
const char *  s2,
PRInt32  aMaxLen 
) [inline, static]
static PRInt32 nsCRT::strncmp ( const PRUnichar s1,
const PRUnichar s2,
PRUint32  aMaxLen 
) [static]

Like strcmp except for ucs2 strings.

static PRInt32 nsCRT::strncmp ( const char *  s1,
const char *  s2,
PRUint32  aMaxLen 
) [inline, static]
static PRUnichar* nsCRT::strndup ( const PRUnichar str,
PRUint32  len 
) [static]
static char* nsCRT::strndup ( const char *  str,
PRUint32  len 
) [inline, static]
static char* nsCRT::strtok ( char *  str,
const char *  delims,
char **  newStr 
) [static]

How to use this fancy (thread-safe) version of strtok:

void main(void) { printf("%s\n\nTokens:\n", string); Establish string and get the first token: char* newStr; token = nsCRT::strtok(string, seps, &newStr); while (token != NULL) { While there are tokens in "string" printf(" %s\n", token); Get next token: token = nsCRT::strtok(newStr, seps, &newStr); } } WARNING - STRTOK WHACKS str THE FIRST TIME IT IS CALLED * MAKE A COPY OF str IF YOU NEED TO USE IT AFTER strtok() *

static char nsCRT::ToLower ( char  aChar  )  [inline, static]
static char nsCRT::ToUpper ( char  aChar  )  [inline, static]

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