Beispiel #1
0
 /// <summary>
 /// Get the property value for an enumerated or integer Unicode property for a code point.
 /// Also returns binary and mask property values.
 /// Unicode, especially in version 3.2, defines many more properties than the original set in UnicodeData.txt.
 /// The properties APIs are intended to reflect Unicode properties as defined in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). For details about the properties see http://www.unicode.org/ . For names of Unicode properties see the UCD file PropertyAliases.txt.
 /// </summary>
 /// <remarks>
 /// If <paramref name="which"/> is <see cref="UProperty.GENERAL_CATEGORY"/>, the return value will not match
 /// the enumeration in FwKernel: LgGeneralCharCategory.
 /// </remarks>
 /// <param name="characterCode">Code point to test. </param>
 /// <param name="which">UProperty selector constant, identifies which property to check. Must be UCHAR_BINARY_START&lt;=which&lt;UCHAR_BINARY_LIMIT or UCHAR_INT_START&lt;=which&lt;UCHAR_INT_LIMIT or UCHAR_MASK_START&lt;=which&lt;UCHAR_MASK_LIMIT.</param>
 /// <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="which"/> does not meet the requirement UCHAR_BINARY_START&lt;=which&lt;UCHAR_BINARY_LIMIT or UCHAR_INT_START&lt;=which&lt;UCHAR_INT_LIMIT or UCHAR_MASK_START&lt;=which&lt;UCHAR_MASK_LIMIT.</exception>
 public static int GetIntPropertyValue(int characterCode, UProperty which)
 {
     if ((which < UProperty.BINARY_START || which >= UProperty.BINARY_LIMIT) &&
         (which < UProperty.INT_START || which >= UProperty.INT_LIMIT) &&
         (which < UProperty.MASK_START || which >= UProperty.MASK_LIMIT))
     {
         throw new ArgumentOutOfRangeException(nameof(characterCode));
     }
     return(NativeMethods.u_getIntPropertyValue(characterCode, which));
 }
Beispiel #2
0
 /// <summary>
 /// Determines whether the specified character code is numeric, based on the
 /// UProperty.NUMERIC_TYPE property.
 /// </summary>
 /// <param name="characterCode">The character code.</param>
 public static bool IsNumeric(int characterCode)
 {
     return(NativeMethods.u_getIntPropertyValue(characterCode, UProperty.NUMERIC_TYPE) != 0);
 }
Beispiel #3
0
 /// <summary>
 /// Determines whether the specified character code is alphabetic, based on the
 /// UProperty.DIACRITIC property.
 /// </summary>
 /// <param name="characterCode">The character code.</param>
 public static bool IsDiacritic(int characterCode)
 {
     return(NativeMethods.u_getIntPropertyValue(characterCode, UProperty.DIACRITIC) != 0);
 }
Beispiel #4
0
 /// <summary>
 /// Determines whether the specified character code is ideographic, based on the
 /// UProperty.IDEOGRAPHIC property.
 /// </summary>
 /// <param name="characterCode">The character code.</param>
 public static bool IsIdeographic(int characterCode)
 {
     return(NativeMethods.u_getIntPropertyValue(characterCode, UProperty.IDEOGRAPHIC) != 0);
 }
Beispiel #5
0
 /// <summary>
 /// Determines whether the specified character code is alphabetic, based on the
 /// UProperty.ALPHABETIC property.
 /// </summary>
 /// <param name="characterCode">The character code.</param>
 public static bool IsAlphabetic(int characterCode)
 {
     return(NativeMethods.u_getIntPropertyValue(characterCode, UProperty.ALPHABETIC) != 0);
 }
Beispiel #6
0
 /// <summary>
 /// Get the property value for an enumerated or integer Unicode property for a code point.
 /// Also returns binary and mask property values.
 /// </summary>
 /// <param name="codePoint">Code point to test. </param>
 /// <param name="which">UProperty selector constant, identifies which property to check.
 /// Must be UProperty.BINARY_START &lt;= which &lt; UProperty.BINARY_LIMIT or
 /// UProperty.INT_START &lt;= which &lt; UProperty.INT_LIMIT or
 /// UProperty.MASK_START &lt;= which &lt; UProperty.MASK_LIMIT.</param>
 /// <returns>
 /// Numeric value that is directly the property value or, for enumerated properties,
 /// corresponds to the numeric value of the enumerated constant of the respective property
 /// value enumeration type (cast to enum type if necessary).
 /// Returns 0 or 1 (for <c>false</c>/<c>true</c>) for binary Unicode properties.
 /// Returns a bit-mask for mask properties.
 /// Returns 0 if 'which' is out of bounds or if the Unicode version does not have data for
 /// the property at all, or not for this code point.
 /// </returns>
 /// <remarks>
 /// Unicode, especially in version 3.2, defines many more properties than the original set
 /// in UnicodeData.txt.
 /// The properties APIs are intended to reflect Unicode properties as defined in the
 /// Unicode Character Database (UCD) and Unicode Technical Reports (UTR). For details
 /// about the properties <see href="http: //www.unicode.org/"/> . For names of Unicode
 /// properties see the UCD file <see cref="PropertyAliases.txt"/>.
 /// </remarks>
 public static int GetIntPropertyValue(int codePoint, UProperty which)
 {
     return(NativeMethods.u_getIntPropertyValue(codePoint, which));
 }