typedef enum ucd_property_ | typedef enum ucd_property_ | ||||
{ | { | ||||
UCD_PROPERTY_WHITE_SPACE = 0x0001, /**< @brief White_Space */ | UCD_PROPERTY_WHITE_SPACE = 0x0001, /**< @brief White_Space */ | ||||
UCD_PROPERTY_NO_BREAK = 0x0002, /**< @brief <noBreak> */ | |||||
} ucd_property; | } ucd_property; | ||||
/** @brief Return the properties of the specified codepoint. | /** @brief Return the properties of the specified codepoint. | ||||
enum property | enum property | ||||
{ | { | ||||
White_Space = UCD_PROPERTY_WHITE_SPACE, /**< @brief White_Space */ | White_Space = UCD_PROPERTY_WHITE_SPACE, /**< @brief White_Space */ | ||||
noBreak = UCD_PROPERTY_NO_BREAK, /**< @brief <noBreak> */ | |||||
}; | }; | ||||
/** @brief Return the properties of the specified codepoint. | /** @brief Return the properties of the specified codepoint. |
return UCD_PROPERTY_WHITE_SPACE; | return UCD_PROPERTY_WHITE_SPACE; | ||||
} | } | ||||
return 0; | return 0; | ||||
case UCD_CATEGORY_Pd: | |||||
if (c == 0x2011) // NON-BREAKING HYPHEN | |||||
return UCD_PROPERTY_NO_BREAK; | |||||
return 0; | |||||
case UCD_CATEGORY_Po: | |||||
if (c == 0x0F0C) // TIBETAN MARK DELIMITER TSHEG BSTAR | |||||
return UCD_PROPERTY_NO_BREAK; | |||||
return 0; | |||||
case UCD_CATEGORY_Zl: | case UCD_CATEGORY_Zl: | ||||
case UCD_CATEGORY_Zp: | case UCD_CATEGORY_Zp: | ||||
return UCD_PROPERTY_WHITE_SPACE; | |||||
case UCD_CATEGORY_Zs: | case UCD_CATEGORY_Zs: | ||||
switch (c) | |||||
{ | |||||
case 0x00A0: // NO-BREAK SPACE | |||||
case 0x2007: // FIGURE SPACE | |||||
case 0x202F: // NARROW NO-BREAK SPACE | |||||
return UCD_PROPERTY_WHITE_SPACE | UCD_PROPERTY_NO_BREAK; | |||||
} | |||||
return UCD_PROPERTY_WHITE_SPACE; | return UCD_PROPERTY_WHITE_SPACE; | ||||
default: | default: | ||||
return 0; | return 0; |