dissect.esedb.lcmapstring#

Module Contents#

Classes#

MapFlags

Support for integer-based Flags

SCRIPT

Enum where members are also (and must be) ints

CASE

Support for integer-based Flags

Functions#

map_string

Very basic Python implementation of LCMapStringEx, only supporting sorting keys.

class dissect.esedb.lcmapstring.MapFlags#

Bases: enum.IntFlag

Support for integer-based Flags

NORM_IGNORECASE = 1#
NORM_IGNORENONSPACE = 2#
NORM_IGNORESYMBOLS = 4#
LINGUISTIC_IGNORECASE = 16#
LINGUISTIC_IGNOREDIACRITIC = 32#
NORM_IGNOREKANATYPE = 65536#
NORM_IGNOREWIDTH = 131072#
NORM_LINGUISTIC_CASING = 134217728#
LCMAP_LOWERCASE = 256#
LCMAP_UPPERCASE = 512#
LCMAP_TITLECASE = 768#
LCMAP_SORTKEY = 1024#
LCMAP_BYTEREV = 2048#
LCMAP_HIRAGANA = 1048576#
LCMAP_KATAKANA = 2097152#
LCMAP_HALFWIDTH = 4194304#
LCMAP_FULLWIDTH = 8388608#
LCMAP_LINGUISTIC_CASING = 16777216#
LCMAP_SIMPLIFIED_CHINESE = 33554432#
LCMAP_TRADITIONAL_CHINESE = 67108864#
LCMAP_SORTHANDLE = 536870912#
LCMAP_HASH = 262144#
SORT_STRINGSORT = 4096#
SORT_DIGITSASNUMBERS = 8#
class dissect.esedb.lcmapstring.SCRIPT#

Bases: enum.IntEnum

Enum where members are also (and must be) ints

UNSORTABLE = 0#
NONSPACE_MARK = 1#
EXPANSION = 2#
EASTASIA_SPECIAL = 3#
JAMO_SPECIAL = 4#
EXTENSION_A = 5#
PUNCTUATION = 6#
SYMBOL_1 = 7#
SYMBOL_2 = 8#
SYMBOL_3 = 9#
SYMBOL_4 = 10#
SYMBOL_5 = 11#
SYMBOL_6 = 12#
DIGIT = 13#
LATIN = 14#
GREEK = 15#
CYRILLIC = 16#
KANA = 34#
HEBREW = 40#
ARABIC = 41#
PUA_FIRST = 169#
PUA_LAST = 175#
CJK_FIRST = 192#
CJK_LAST = 239#
class dissect.esedb.lcmapstring.CASE#

Bases: enum.IntFlag

Support for integer-based Flags

FULLWIDTH = 1#
FULLSIZE = 2#
SUBSCRIPT = 8#
UPPER = 16#
KATAKANA = 32#
COMPR_2 = 64#
COMPR_4 = 128#
COMPR_6 = 192#
dissect.esedb.lcmapstring.map_string(value: str, flags: MapFlags, locale: str) bytes#

Very basic Python implementation of LCMapStringEx, only supporting sorting keys.

Currently only supports one hardcoded sorting table (the default) and the basic character types.

Parameters:
  • value – The string to map to a sorting key.

  • flags – The flags passed to LCMapStringEx

  • locale – The locale to use for mapping.

Returns:

A sorting key of the given input that should be compatible with LCMapStringEx.

Raises:

NotImplementedError – If an unsupported flag or character is encountered.