Logo Search packages:      
Sourcecode: icu version File versions

ucnvsel.cpp File Reference


Detailed Description

This is an implementation of an encoding selector. The goal is, given a unicode string, find the encodings this string can be mapped to. To make processing faster a trie is built when you call ucnvsel_open() that stores all encodings a codepoint can map to

Definition in file ucnvsel.cpp.

#include "unicode/ucnvsel.h"
#include <string.h>
#include "unicode/uchar.h"
#include "unicode/uniset.h"
#include "unicode/ucnv.h"
#include "unicode/ustring.h"
#include "unicode/uchriter.h"
#include "utrie2.h"
#include "propsvec.h"
#include "uassert.h"
#include "ucmndata.h"
#include "uenumimp.h"
#include "cmemory.h"
#include "cstring.h"

Go to the source code of this file.

Classes

struct  Enumerator
struct  UConverterSelector

Enumerations

enum  {
  UCNVSEL_INDEX_TRIE_SIZE, UCNVSEL_INDEX_PV_COUNT, UCNVSEL_INDEX_NAMES_COUNT, UCNVSEL_INDEX_NAMES_LENGTH,
  UCNVSEL_INDEX_SIZE = 15, UCNVSEL_INDEX_COUNT = 16
}

Functions

int16_t countOnes (uint32_t *mask, int32_t len)
static void generateSelectorData (UConverterSelector *result, UPropsVectors *upvec, const USet *excludedCodePoints, const UConverterUnicodeSet whichSet, UErrorCode *status)
UBool intersectMasks (uint32_t *dest, const uint32_t *source1, int32_t len)
static UEnumerationselectForMask (const UConverterSelector *sel, uint32_t *mask, UErrorCode *status)
U_CAPI void U_EXPORT2 ucnvsel_close (UConverterSelector *sel)
static U_CDECL_BEGIN void
U_CALLCONV 
ucnvsel_close_selector_iterator (UEnumeration *enumerator)
static int32_t U_CALLCONV ucnvsel_count_encodings (UEnumeration *enumerator, UErrorCode *status)
static const char *U_CALLCONV ucnvsel_next_encoding (UEnumeration *enumerator, int32_t *resultLength, UErrorCode *status)
U_CAPI UConverterSelector
*U_EXPORT2 
ucnvsel_open (const char *const *converterList, int32_t converterListSize, const USet *excludedCodePoints, const UConverterUnicodeSet whichSet, UErrorCode *status)
U_CAPI UConverterSelector
*U_EXPORT2 
ucnvsel_openFromSerialized (const void *buffer, int32_t length, UErrorCode *status)
static void U_CALLCONV ucnvsel_reset_iterator (UEnumeration *enumerator, UErrorCode *status)
U_CAPI UEnumeration *U_EXPORT2 ucnvsel_selectForString (const UConverterSelector *sel, const UChar *s, int32_t length, UErrorCode *status)
U_CAPI UEnumeration *U_EXPORT2 ucnvsel_selectForUTF8 (const UConverterSelector *sel, const char *s, int32_t length, UErrorCode *status)
U_CAPI int32_t U_EXPORT2 ucnvsel_serialize (const UConverterSelector *sel, void *buffer, int32_t bufferCapacity, UErrorCode *status)
static int32_t ucnvsel_swap (const UDataSwapper *ds, const void *inData, int32_t length, void *outData, UErrorCode *status)

Variables

static const UDataInfo dataInfo
static U_CDECL_END const
UEnumeration 
defaultEncodings


Generated by  Doxygen 1.6.0   Back to index