OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKernel
Resource


Resource_Unicode Class Reference

This class provides functions used to convert a non-ASCII C string
given in ANSI, EUC, GB or SJIS format, to a
Unicode string of extended characters, and vice versa.
.

#include <Resource_Unicode.hxx>


Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)

Static Public Member Functions

static Standard_EXPORT void ConvertSJISToUnicode (const Standard_CString fromstr, TCollection_ExtendedString &tostr)
 Converts non-ASCII CString <fromstr> in SJIS format
to Unicode ExtendedString <tostr>.
.
static Standard_EXPORT void ConvertEUCToUnicode (const Standard_CString fromstr, TCollection_ExtendedString &tostr)
 Converts non-ASCII CString <fromstr> in EUC format
to Unicode ExtendedString <tostr>.
.
static Standard_EXPORT void ConvertGBToUnicode (const Standard_CString fromstr, TCollection_ExtendedString &tostr)
 Converts non-ASCII CString <fromstr> in GB format
to Unicode ExtendedString <tostr>.
.
static Standard_EXPORT void ConvertANSIToUnicode (const Standard_CString fromstr, TCollection_ExtendedString &tostr)
 Converts non-ASCII CString <fromstr> in ANSI format
to Unicode ExtendedString <tostr>.
.
static Standard_EXPORT Standard_Boolean ConvertUnicodeToSJIS (const TCollection_ExtendedString &fromstr, Standard_PCharacter &tostr, const Standard_Integer maxsize)
 Converts Unicode ExtendedString <fromstr> to non-ASCII
CString <tostr> in SJIS format, limited to <maxsize>
characters. To translate the whole <fromstr>, use more
than twice the length of <fromstr>. Returns true if
<maxsize> has not been reached before end of conversion.
.
static Standard_EXPORT Standard_Boolean ConvertUnicodeToEUC (const TCollection_ExtendedString &fromstr, Standard_PCharacter &tostr, const Standard_Integer maxsize)
 Converts Unicode ExtendedString <fromstr> to non-ASCII
CString <tostr> in EUC format, limited to <maxsize>
characters. To translate the whole <fromstr>, use more
than twice the length of <fromstr>. Returns true if
<maxsize> has not been reached before end of conversion.
.
static Standard_EXPORT Standard_Boolean ConvertUnicodeToGB (const TCollection_ExtendedString &fromstr, Standard_PCharacter &tostr, const Standard_Integer maxsize)
 Converts Unicode ExtendedString <fromstr> to non-ASCII
CString <tostr> in GB format, limited to <maxsize>
characters. To translate the whole <fromstr>, use more
than twice the length of <fromstr>. Returns true if
<maxsize> has not been reached before end of conversion.
.
static Standard_EXPORT Standard_Boolean ConvertUnicodeToANSI (const TCollection_ExtendedString &fromstr, Standard_PCharacter &tostr, const Standard_Integer maxsize)
 Converts Unicode ExtendedString <fromstr> to non-ASCII
CString <tostr> in ANSI format, limited to <maxsize>
characters. To translate the whole <fromstr>, use more
than twice the length of <fromstr>. Returns true if
<maxsize> has not been reached before end of conversion.
.
static Standard_EXPORT void SetFormat (const Resource_FormatType typecode)
 Defines the current conversion format as typecode.
This conversion format will then be used by the
functions ConvertFormatToUnicode and
ConvertUnicodeToFormat to convert the strings.
.
static Standard_EXPORT Resource_FormatType GetFormat ()
 Returns the current conversion format (either
ANSI, EUC, GB or SJIS).
The current converting format must be defined in
advance with the SetFormat function.
.
static Standard_EXPORT void ReadFormat ()
 Reads converting format from resource "FormatType"
in Resource Manager "CharSet"
.
static Standard_EXPORT void ConvertFormatToUnicode (const Standard_CString fromstr, TCollection_ExtendedString &tostr)
 Converts the non-ASCII C string fromstr to the
Unicode string of extended characters tostr.
fromstr is translated according to the format
(either ANSI, EUC, GB or SJIS) returned by the function GetFormat.
.
static Standard_EXPORT Standard_Boolean ConvertUnicodeToFormat (const TCollection_ExtendedString &fromstr, Standard_PCharacter &tostr, const Standard_Integer maxsize)
 Converts the Unicode string of extended
characters fromstr to the non-ASCII C string
tostr according to the format (either ANSI, EUC,
GB or SJIS) returned by the function GetFormat.
maxsize limits the size of the string tostr to a
maximum number of characters. You need more
than twice the length of the string fromstr to
complete the conversion.
The function returns true if conversion is
complete, i.e. the maximum number of characters
maxsize is not reached by tostr before the end
of conversion of fromstr.
.


Member Function Documentation

static Standard_EXPORT void Resource_Unicode::ConvertANSIToUnicode const Standard_CString  fromstr,
TCollection_ExtendedString tostr
[static]
 

static Standard_EXPORT void Resource_Unicode::ConvertEUCToUnicode const Standard_CString  fromstr,
TCollection_ExtendedString tostr
[static]
 

static Standard_EXPORT void Resource_Unicode::ConvertFormatToUnicode const Standard_CString  fromstr,
TCollection_ExtendedString tostr
[static]
 

static Standard_EXPORT void Resource_Unicode::ConvertGBToUnicode const Standard_CString  fromstr,
TCollection_ExtendedString tostr
[static]
 

static Standard_EXPORT void Resource_Unicode::ConvertSJISToUnicode const Standard_CString  fromstr,
TCollection_ExtendedString tostr
[static]
 

static Standard_EXPORT Standard_Boolean Resource_Unicode::ConvertUnicodeToANSI const TCollection_ExtendedString fromstr,
Standard_PCharacter tostr,
const Standard_Integer  maxsize
[static]
 

static Standard_EXPORT Standard_Boolean Resource_Unicode::ConvertUnicodeToEUC const TCollection_ExtendedString fromstr,
Standard_PCharacter tostr,
const Standard_Integer  maxsize
[static]
 

static Standard_EXPORT Standard_Boolean Resource_Unicode::ConvertUnicodeToFormat const TCollection_ExtendedString fromstr,
Standard_PCharacter tostr,
const Standard_Integer  maxsize
[static]
 

static Standard_EXPORT Standard_Boolean Resource_Unicode::ConvertUnicodeToGB const TCollection_ExtendedString fromstr,
Standard_PCharacter tostr,
const Standard_Integer  maxsize
[static]
 

static Standard_EXPORT Standard_Boolean Resource_Unicode::ConvertUnicodeToSJIS const TCollection_ExtendedString fromstr,
Standard_PCharacter tostr,
const Standard_Integer  maxsize
[static]
 

static Standard_EXPORT Resource_FormatType Resource_Unicode::GetFormat  )  [static]
 

void Resource_Unicode::operator delete void *  anAddress  )  [inline]
 

void* Resource_Unicode::operator new size_t  size  )  [inline]
 

void* Resource_Unicode::operator new size_t  ,
void *  anAddress
[inline]
 

static Standard_EXPORT void Resource_Unicode::ReadFormat  )  [static]
 

static Standard_EXPORT void Resource_Unicode::SetFormat const Resource_FormatType  typecode  )  [static]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:13:18 2008 for OpenCASCADE by  doxygen 1.4.1