Unicorn XML Toolkit
Version 1.50.00

Namespace Core
Class CUtil

class CUtil {
public:
    static int Hash(register const WCHAR *pszKey);
    static CString IntToStr(int nValue);
    static CString ULngToStr(unsigned long nValue);
    static CString Int32ToStr(CInt32 nValue);
    static CString UInt32ToStr(CInt32 nValue);
    static CString DblToStr(double dblValue);
    static bool StrToInt(
        const WCHAR *pszSource, int &nResult);
    static bool StrToDbl(
        const WCHAR *pszSource, double &dblResult);
    static double Round(double dblValue);
    };

The container for various utility functions.

Since:
1.50.00
Version:
1.50.00
Author:
Alexey Gokhberg
Function Summary
int Hash (const WCHAR *pszKey);
����������Returns a hash value of the specified string.
CString IntToStr (int nValue);
����������Converts an integer value to a character string.
CString ULngToStr (unsigned long nValue);
����������Converts an unsigned long value to a character string.
CString Int32ToStr (CInt32 nValue);
����������Converts a 32-bit integer value to a character string.
CString UInt32ToStr (CInt32 nValue);
����������Converts a 32-bit unsigned integer number to a character string.
CString DblToStr (double dblValue);
����������Converts a floating-point value to a character string.
bool StrToInt (const WCHAR *pszSource, int &nResult);
����������Converts a character string to an integer value.
bool StrToDbl (const WCHAR *pszSource, double &dblResult);
����������Converts a character string to a floating-point value.
double Round (double dblValue);
����������Rounds a floating-point value.

Function Detail

Hash

static int Hash(const WCHAR *pszKey);

Returns a hash value of the specified string.

Parameters:
pszKey - the string
Returns:
the hash value of the specified string

IntToStr

static CString IntToStr(int nValue);

Converts an integer value to a character string.

Parameters:
nValue - the value to convert
Returns:
the result of conversion

ULngToStr

static CString ULngToStr(unsigned long nValue);

Converts an unsigned long value to a character string.

Parameters:
nValue - the value to convert
Returns:
the result of conversion

Int32ToStr

static CString Int32ToStr(CInt32 nValue);

Converts a 32-bit integer value to a character string.

Parameters:
nValue - the value to convert
Returns:
the result of conversion

UInt32ToStr

static CString UInt32ToStr(CInt32 nValue);

Converts a 32-bit unsigned integer number to a character string.

Parameters:
nValue - the value to convert
Returns:
the result of conversion

DblToStr

static CString DblToStr(double dblValue);

Converts a floating-point value to a character string.

Parameters:
dblValue - the value to convert
Returns:
the result of conversion

StrToInt

static bool StrToInt(
    const WCHAR *pszSource, int &nResult);

Converts a character string to an integer value.

Parameters:
pszSource - the string to convert
nResult - on return, the result of conversion
Returns:
true if conversion secceeded; false otherwise

StrToDbl

static bool StrToDbl(
    const WCHAR *pszSource, double &dblResult);

Converts a character string to a floating-point value.

Parameters:
pszSource - the string to convert
dblResult - on return, the result of conversion
Returns:
> true if conversion secceeded; false otherwise

Round

static double Round(double dblValue);

Rounds a floating-point value.

Parameters:
dblValue - the value to round
Returns:
the rounding result

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.