Main Page   Class Hierarchy   Compound List   File List   Header Files   Sources   Compound Members   File Members  

utypes.h

00001 /*
00002 **********************************************************************
00003 *   Copyright (C) 1996-1999, International Business Machines
00004 *   Corporation and others.  All Rights Reserved.
00005 **********************************************************************
00006 *
00007 *  FILE NAME : UTYPES.H (formerly ptypes.h)
00008 *
00009 *   Date        Name        Description
00010 *   12/11/96    helena      Creation.
00011 *   02/27/97    aliu        Added typedefs for UClassID, int8, int16, int32,
00012 *                           uint8, uint16, and uint32.
00013 *   04/01/97    aliu        Added XP_CPLUSPLUS and modified to work under C as
00014 *                            well as C++.
00015 *                           Modified to use memcpy() for uprv_arrayCopy() fns.
00016 *   04/14/97    aliu        Added TPlatformUtilities.
00017 *   05/07/97    aliu        Added import/export specifiers (replacing the old
00018 *                           broken EXT_CLASS).  Added version number for our
00019 *                           code.  Cleaned up header.
00020 *    6/20/97    helena      Java class name change.
00021 *   08/11/98    stephen     UErrorCode changed from typedef to enum
00022 *   08/12/98    erm         Changed T_ANALYTIC_PACKAGE_VERSION to 3
00023 *   08/14/98    stephen     Added uprv_arrayCopy() for int8_t, int16_t, int32_t
00024 *   12/09/98    jfitz       Added BUFFER_OVERFLOW_ERROR (bug 1100066)
00025 *   04/20/99    stephen     Cleaned up & reworked for autoconf.
00026 *                           Renamed to utypes.h.
00027 *   05/05/99    stephen     Changed to use <inttypes.h>
00028 *   12/07/99    helena      Moved copyright notice string from ucnv_bld.h here.
00029 *******************************************************************************
00030 */
00031 
00032 #ifndef UTYPES_H
00033 #define UTYPES_H
00034 
00035 #include "unicode/umachine.h"
00036 #include "unicode/utf.h"
00037 
00038 #ifndef __OS400__
00039 #include <memory.h>
00040 #endif
00041 #include <stdlib.h>
00042 
00043 /*===========================================================================*/
00044 /* char Character set family                                                 */
00045 /*===========================================================================*/
00046 
00047 /*
00048  * These definitions allow to specify the encoding of text
00049  * in the char data type as defined by the platform and the compiler.
00050  * It is enough to determine the code point values of "invariant characters",
00051  * which are the ones shared by all encodings that are in use
00052  * on a given platform.
00053  *
00054  * Those "invariant characters" should be all the uppercase and lowercase
00055  * latin letters, the digits, the space, and "basic punctuation".
00056  * Also, '\n', '\r', '\t' should be available.
00057  *
00058  * The list of "invariant characters" is:
00059  *    A-Z  a-z  0-9  SPACE  "  %  &  '  (  )  *  +  ,  -  .  /  :  ;  <  =  >  ?  _
00060  * (52 letters + 10 numbers + 20 punc/sym = 82 total)
00061  *
00062  * In other words, all the graphic characters in 7-bit ASCII should
00063  * be safely accessible except the following:
00064  * 
00065  *    '\' <backslash>
00066  *    '[' <left bracket>
00067  *    ']' <right bracket>
00068  *    '{' <left brace>
00069  *    '}' <right brace>
00070  *    '^' <circumflex>
00071  *    '~' <tilde>
00072  *    '!' <exclamation mark>
00073  *    '#' <number sign>
00074  *    '|' <vertical line>
00075  *    '$' <dollar sign>
00076  *    '@' <commercial at>
00077  *    '`' <grave accent>
00078  */
00079 
00080 #define U_ASCII_FAMILY 0
00081 #define U_EBCDIC_FAMILY 1
00082 
00083 #ifndef U_CHARSET_FAMILY
00084 #   define U_CHARSET_FAMILY 0
00085 #endif
00086 
00087 /*===========================================================================*/
00088 /* Related version information                                               */
00089 /*===========================================================================*/
00090 #define U_ICU_VERSION "1.5"
00091 
00092 #define U_MAX_VERSION_LENGTH 4
00093 #define U_VERSION_DELIMITER '.'
00094 #define U_MAX_VERSION_STRING_LENGTH 20
00095 
00096 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
00097 
00098 /* Work around the OS390 compiler issue, to be removed when the compiler 
00099 updates come out.  */
00100 #if defined(OS390) && defined(XP_CPLUSPLUS)
00101 #    define U_CALLCONV __cdecl
00102 #else
00103 #    define U_CALLCONV 
00104 #endif
00105 
00106 /* Define NULL (the wrong way, cast to void *) if it does not exist. */
00107 #ifndef NULL
00108 #ifdef XP_CPLUSPLUS
00109 #define NULL    0
00110 #else
00111 #define NULL    ((void *)0)
00112 #endif
00113 #endif
00114 
00115 /* Maximum value of a (void*) - use to indicate the limit of
00116    an 'infinite' buffer.  */
00117 #ifndef U_MAX_PTR
00118 #define U_MAX_PTR ((void*)-1)
00119 #endif
00120 
00121 /*===========================================================================*/
00122 /* Calendar/TimeZone data types                                              */
00123 /*===========================================================================*/
00124 
00131 typedef double UDate;
00132 
00133 /* Common time manipulation constants */
00134 #define U_MILLIS_PER_SECOND        (1000)
00135 #define U_MILLIS_PER_MINUTE       (60000)
00136 #define U_MILLIS_PER_HOUR       (3600000)
00137 #define U_MILLIS_PER_DAY       (86400000)
00138 
00139 
00140 /*===========================================================================*/
00141 /* UClassID-based RTTI */
00142 /*===========================================================================*/
00143 
00181 typedef void* UClassID;
00182 
00183 /*===========================================================================*/
00184 /* Shared library/DLL import-export API control                              */
00185 /*===========================================================================*/
00186 
00193 #ifdef U_COMMON_IMPLEMENTATION
00194 #define U_COMMON_API  U_EXPORT
00195 #define U_I18N_API    U_IMPORT
00196 #elif defined(U_I18N_IMPLEMENTATION)
00197 #define U_COMMON_API  U_IMPORT
00198 #define U_I18N_API    U_EXPORT
00199 #else
00200 #define U_COMMON_API  U_IMPORT
00201 #define U_I18N_API    U_IMPORT
00202 #endif
00203 /*===========================================================================*/
00204 /* UErrorCode */
00205 /*===========================================================================*/
00206 
00210 enum UErrorCode {
00211     U_ERROR_INFO_START        = -128,     /* Start of information results (semantically successful) */
00212     U_USING_FALLBACK_ERROR    = -128,
00213     U_USING_DEFAULT_ERROR     = -127,
00214     U_ERROR_INFO_LIMIT,
00215 
00217     U_ZERO_ERROR              =  0,             
00218 
00219     U_ILLEGAL_ARGUMENT_ERROR  =  1,       /* Start of codes indicating failure */
00220     U_MISSING_RESOURCE_ERROR  =  2,
00221     U_INVALID_FORMAT_ERROR    =  3,
00222     U_FILE_ACCESS_ERROR       =  4,
00223     U_INTERNAL_PROGRAM_ERROR  =  5,       /* Indicates a bug in the library code */
00224     U_MESSAGE_PARSE_ERROR     =  6,
00225     U_MEMORY_ALLOCATION_ERROR =  7,       /* Memory allocation error */
00226     U_INDEX_OUTOFBOUNDS_ERROR =  8,
00227     U_PARSE_ERROR             =  9,       /* Equivalent to Java ParseException */
00228     U_INVALID_CHAR_FOUND      = 10,       /* In the Character conversion routines: Invalid character or sequence was encountered*/
00229     U_TRUNCATED_CHAR_FOUND    = 11,       /* In the Character conversion routines: More bytes are required to complete the conversion successfully*/
00230     U_ILLEGAL_CHAR_FOUND      = 12,       /* In codeset conversion: a sequence that does NOT belong in the codepage has been encountered*/
00231     U_INVALID_TABLE_FORMAT    = 13,       /* Conversion table file found, but corrupted*/
00232     U_INVALID_TABLE_FILE      = 14,       /* Conversion table file not found*/
00233     U_BUFFER_OVERFLOW_ERROR   = 15,       /* A result would not fit in the supplied buffer */
00234     U_UNSUPPORTED_ERROR       = 16,       /* Requested operation not supported in current context */
00235     U_RESOURCE_TYPE_MISMATCH  = 17,       /* an operation is requested over a resource that does not support it*/
00236     U_ERROR_LIMIT
00237 };
00238 
00239 #ifndef XP_CPLUSPLUS
00240 typedef enum UErrorCode UErrorCode;
00241 #endif
00242 
00243 /* Use the following to determine if an UErrorCode represents */
00244 /* operational success or failure. */
00245 #ifdef XP_CPLUSPLUS
00247 inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); }
00249 inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); }
00250 #else
00252 #define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
00254 #define U_FAILURE(x) ((x)>U_ZERO_ERROR)
00255 #endif
00256 
00262 U_CAPI const char * U_EXPORT2
00263 u_errorName(UErrorCode code);
00264 
00265 /* Casting function for int32_t (backward compatibility version, here until
00266    T_INT32 is replaced) */
00267 #define T_INT32(i) ((int32_t)i)
00268 
00269 #define U_COPYRIGHT_STRING \
00270   " Copyright (C) 2000, International Business Machines Corporation and others.  All Rights Reserved. "
00271 
00272 #define U_COPYRIGHT_STRING_LENGTH  160
00273 
00274 /*===========================================================================*/
00275 /* Include header for platform utilies */
00276 /*===========================================================================*/
00277 
00278 
00279 
00280 /* Mutex data type.  INTERNAL.*/
00281 typedef void *UMTX;
00282 
00283 
00284 #include "unicode/putil.h"
00285 
00286 #endif /* _UTYPES */

Generated at Mon Jun 5 12:53:09 2000 for ICU1.5 by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999
b>Parameters:
converter   the converter object to be deleted
See also:
ucnv_open() , ucnv_openU() , ucnv_openCCSID()
Stable:

U_CAPI void U_EXPORT2 ucnv_getSubstChars (const UConverter * converter, char * subChars, int8_t * len, UErrorCode * err)

Fills in the output parameter, subChars, with the substitution characters as multiple bytes.

Parameters:
converter:   the Unicode converter
subChars:   the subsitution characters
len:   on input the capacity of subChars, on output the number of bytes copied to it
err:   the outgoing error status code. If the substitution character array is too small, an U_INDEX_OUTOFBOUNDS_ERROR will be returned.
See also:
ucnv_setSubstChars()
Stable:

U_CAPI void U_EXPORT2 ucnv_setSubstChars (UConverter * converter, const char * subChars, int8_t len, UErrorCode * err)

Sets the substitution chars when converting from unicode to a codepage.

The substitution is specified as a string of 1-4 bytes, and may contain NULL byte. The fill-in parameter err will get the error status on return.

Parameters:
Returns:
A default TimeZone. Clients are responsible for deleting the time zone object returned.
Stable:

converter   the Unicode converter
subChars   the substitution character byte sequence we want set
len   the number of bytes in subChars
err   the error status code. U_INDEX_OUTOFBOUNDS_ERROR if len is bigger than the maximum number of bytes allowed in subchars
void TimeZone::adoptDefault (TimeZone * zone) [static]

Sets the default time zone (i.e., what's returned by getDefault()) to be the specified time zone.

If NULL is specified for the time zone, the default time zone is set to the default host time zone. This call adopts the TimeZone object passed in; the clent is no longer responsible for deleting it.

Parameters:
zone   A pointer to the new TimeZone object to use as the default.
Stable:

void TimeZone::setDefault (const TimeZone & zone) [static]

Same as adoptDefault(), except that the TimeZone object passed in is NOT adopted; the caller remains responsible for deleting it.

Parameters:
zone   The given timezone.
System:

UClassID TimeZone::getStaticClassID (void) [inline, static]

Return the class ID for this class.

This is useful only for comparing to a return value from getDynamicClassID(). For example:

 .   Base* polymorphic_pointer = createPolymorphicObject();
 .   if (polymorphic_pointer->getDynamicClassID() ==
 .       Derived::getStaticClassID()) ...
 
Returns:
The class ID for all objects of this class.
Stable:

Reimplemented in SimpleTimeZone.

Definition at line 428 of file timezone.h.

TimeZone::TimeZone () [protected]

Default constructor.

ID is initialized to the empty string.

Stable:

TimeZone::TimeZone (const TimeZone & source) [protected]

Copy constructor.

Stable:

TimeZone & TimeZone::operator= (const TimeZone & right) [protected]

Default assignment operator.

Stable:

Member Data Documentation

const TimeZone* TimeZone::GMT [static]

The GMT zone has a raw offset of zero and does not use daylight savings time.

Definition at line 123 of file timezone.h.


The documentation for this class was generated from the following file:
Generated at Mon Jun 5 12:53:23 2000 for ICU1.5 by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999
dy> rmat.html#a63">kDateOffset, kNone, kDateTime, FULL, LONG, MEDIUM, SHORT, DEFAULT, DATE_OFFSET, NONE, DATE_TIME } Constants for various style patterns. More...

virtual ~DateFormat () Destructor. More...

virtual UBool operator== (const Format&) const Equality operator. More...

virtual UnicodeStringformat (const Formattable& obj, UnicodeString& toAppendTo, FieldPosition& pos, UErrorCode& status) const Format an object to produce a string. More...

virtual UnicodeStringformat ( The string will be the same as the name of the error code constant in the enum above.


Generated at Mon Jun 5 12:53:01 2000 for ICU1.5 by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999