Skip to content

Commit

Permalink
Implements uformattable.h
Browse files Browse the repository at this point in the history
Almost all functions are implemented.  It seems that uformattable does
not, in fact, initialize formattables, but instead has a bunch of getter
methods that allow us to inspect existing formattables.

Closes google#140.
  • Loading branch information
filmil committed Jun 23, 2020
1 parent 3cb0017 commit f30a565
Show file tree
Hide file tree
Showing 15 changed files with 305 additions and 73 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ coverage in the headers.
| [rust_icu_udat](https://crates.io/crates/rust_icu_udat)| ICU date and time. Implements [`udat.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/udat_8h.html) C API header from the ICU library. |
| [rust_icu_udata](https://crates.io/crates/rust_icu_udata)| ICU binary data. Implements [`udata.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/udata_8h.html) C API header from the ICU library. |
| [rust_icu_uenum](https://crates.io/crates/rust_icu_uenum)| ICU enumerations. Implements [`uenum.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/uenum_8h.html) C API header from the ICU library. Mainly `UEnumeration` and friends. |
| [rust_icu_uformattable](https://crates.io/crates/rust_icu_uformattable)| Locale-sensitive list formatting support. Implements [`uformattable.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/uformattable_8h.html) C API header from the ICU library. Since 0.3.1. |
| [rust_icu_ulistformatter](https://crates.io/crates/rust_icu_ulistformatter)| Locale-sensitive list formatting support. Implements [`ulistformatter.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ulistformatter_8h.html) C API header from the ICU library. |
| [rust_icu_uloc](https://crates.io/crates/rust_icu_uloc)| Locale support. Implements [`uloc.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/uloc_8h.html) C API header from the ICU library. |
| [rust_icu_umsg](https://crates.io/crates/rust_icu_umsg)| MessageFormat support. Implements [`umsg.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/umsg_8h.html) C API header from the ICU library. |
Expand Down
4 changes: 3 additions & 1 deletion build/showprogress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ C_API_HEADER_NAMES=(
"udat"
"udata"
"uenum"
"uformattable"
"ulistformatter"
"uloc"
"upluralrules"
"umsg"
"ustring"
"ustring"
"utext"
)

Expand Down
121 changes: 51 additions & 70 deletions coverage/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

| Header | Implemented |
| ------ | ----------- |
| `ucal.h` | 15 / 45 |
| `ucal.h` | 15 / 46 |
| `ucol.h` | 2 / 50 |
| `udat.h` | 6 / 38 |
| `udata.h` | 2 / 8 |
| `uenum.h` | 8 / 8 |
| `uloc.h` | 19 / 41 |
| `uformattable.h` | 7 / 13 |
| `ulistformatter.h` | 2 / 8 |
| `uloc.h` | 19 / 42 |
| `upluralrules.h` | 3 / 7 |
| `umsg.h` | 6 / 20 |
| `ustring.h` | 3 / 61 |
| `ustring.h` | 3 / 61 |
| `utext.h` | 3 / 28 |
# Unimplemented functions per header

Expand Down Expand Up @@ -47,6 +49,7 @@
| `ucal_getDSTSavings` | |
| `ucal_getFieldDifference` | |
| `ucal_getGregorianChange` | |
| `ucal_getHostTimeZone` | |
| `ucal_getKeywordValuesForLocale` | |
| `ucal_getLimit` | |
| `ucal_getLocaleByType` | |
Expand Down Expand Up @@ -196,6 +199,38 @@
| `uenum_reset` | |
| `uenum_unext` | |

# Header: `uformattable.h`

| Unimplemented | Implemented |
| ------------- | ----------- |
| | `$impl_function_name` |
| | `ufmt_close` |
| | `ufmt_getArrayItemByIndex` |
| | `ufmt_getDecNumChars` |
| | `ufmt_getUChars` |
| | `ufmt_isNumeric` |
| | `ufmt_open` |
| `ufmt_getArrayLength` | |
| `ufmt_getDate` | |
| `ufmt_getDouble` | |
| `ufmt_getInt64` | |
| `ufmt_getLong` | |
| `ufmt_getObject` | |
| `ufmt_getType` | |

# Header: `ulistformatter.h`

| Unimplemented | Implemented |
| ------------- | ----------- |
| | `ulistfmt_format` |
| | `ulistfmt_openForType` |
| `ulistfmt_close` | |
| `ulistfmt_closeResult` | |
| `ulistfmt_formatStringsToResult` | |
| `ulistfmt_open` | |
| `ulistfmt_openResult` | |
| `ulistfmt_resultAsValue` | |

# Header: `uloc.h`

| Unimplemented | Implemented |
Expand Down Expand Up @@ -242,10 +277,23 @@
| `uloc_getName` | |
| `uloc_getParent` | |
| `uloc_isRightToLeft` | |
| `uloc_openAvailableByType` | |
| `uloc_openKeywords` | |
| `uloc_setKeywordValue` | |
| `uloc_toLegacyType` | |

# Header: `upluralrules.h`

| Unimplemented | Implemented |
| ------------- | ----------- |
| | `uplrules_getKeywords` |
| | `uplrules_openForType` |
| | `uplrules_select` |
| `uplrules_close` | |
| `uplrules_open` | |
| `uplrules_selectFormatted` | |
| `uplrules_selectWithFormat` | |

# Header: `umsg.h`

| Unimplemented | Implemented |
Expand Down Expand Up @@ -339,73 +387,6 @@
| `u_unescape` | |
| `u_unescapeAt` | |

# Header: `ustring.h`

| Unimplemented | Implemented |
| ------------- | ----------- |
| | `UChar*` |
| | `u_strFromUTF8` |
| | `u_strToUTF8` |
| `u_austrcpy` | |
| `u_austrncpy` | |
| `u_countChar32` | |
| `u_memcasecmp` | |
| `u_memchr` | |
| `u_memchr32` | |
| `u_memcmp` | |
| `u_memcmpCodePointOrder` | |
| `u_memcpy` | |
| `u_memmove` | |
| `u_memrchr` | |
| `u_memrchr32` | |
| `u_memset` | |
| `u_strcasecmp` | |
| `u_strCaseCompare` | |
| `u_strcat` | |
| `u_strchr` | |
| `u_strchr32` | |
| `u_strcmp` | |
| `u_strcmpCodePointOrder` | |
| `u_strCompare` | |
| `u_strCompareIter` | |
| `u_strcpy` | |
| `u_strcspn` | |
| `u_strFindFirst` | |
| `u_strFindLast` | |
| `u_strFoldCase` | |
| `u_strFromJavaModifiedUTF8WithSub` | |
| `u_strFromUTF32` | |
| `u_strFromUTF32WithSub` | |
| `u_strFromUTF8Lenient` | |
| `u_strFromUTF8WithSub` | |
| `u_strFromWCS` | |
| `u_strHasMoreChar32Than` | |
| `u_strlen` | |
| `u_strncasecmp` | |
| `u_strncat` | |
| `u_strncmp` | |
| `u_strncmpCodePointOrder` | |
| `u_strncpy` | |
| `u_strpbrk` | |
| `u_strrchr` | |
| `u_strrchr32` | |
| `u_strrstr` | |
| `u_strspn` | |
| `u_strstr` | |
| `u_strToJavaModifiedUTF8` | |
| `u_strtok_r` | |
| `u_strToLower` | |
| `u_strToTitle` | |
| `u_strToUpper` | |
| `u_strToUTF32` | |
| `u_strToUTF32WithSub` | |
| `u_strToUTF8WithSub` | |
| `u_strToWCS` | |
| `u_uastrcpy` | |
| `u_uastrncpy` | |
| `u_unescape` | |
| `u_unescapeAt` | |

# Header: `utext.h`

| Unimplemented | Implemented |
Expand Down
1 change: 1 addition & 0 deletions coverage/ucal_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ucal_getDefaultTimeZone
ucal_getDSTSavings
ucal_getFieldDifference
ucal_getGregorianChange
ucal_getHostTimeZone
ucal_getKeywordValuesForLocale
ucal_getLimit
ucal_getLocaleByType
Expand Down
Empty file added coverage/ufmt_all.txt
Empty file.
13 changes: 13 additions & 0 deletions coverage/uformattable_all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ufmt_close
ufmt_getArrayItemByIndex
ufmt_getArrayLength
ufmt_getDate
ufmt_getDecNumChars
ufmt_getDouble
ufmt_getInt64
ufmt_getLong
ufmt_getObject
ufmt_getType
ufmt_getUChars
ufmt_isNumeric
ufmt_open
7 changes: 7 additions & 0 deletions coverage/uformattable_implemented.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$impl_function_name
ufmt_close
ufmt_getArrayItemByIndex
ufmt_getDecNumChars
ufmt_getUChars
ufmt_isNumeric
ufmt_open
8 changes: 8 additions & 0 deletions coverage/ulistformatter_all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ulistfmt_close
ulistfmt_closeResult
ulistfmt_format
ulistfmt_formatStringsToResult
ulistfmt_open
ulistfmt_openForType
ulistfmt_openResult
ulistfmt_resultAsValue
2 changes: 2 additions & 0 deletions coverage/ulistformatter_implemented.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ulistfmt_format
ulistfmt_openForType
1 change: 1 addition & 0 deletions coverage/uloc_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ uloc_getScript
uloc_getVariant
uloc_isRightToLeft
uloc_minimizeSubtags
uloc_openAvailableByType
uloc_openKeywords
uloc_setDefault
uloc_setKeywordValue
Expand Down
7 changes: 7 additions & 0 deletions coverage/upluralrules_all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
uplrules_close
uplrules_getKeywords
uplrules_open
uplrules_openForType
uplrules_select
uplrules_selectFormatted
uplrules_selectWithFormat
3 changes: 3 additions & 0 deletions coverage/upluralrules_implemented.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
uplrules_getKeywords
uplrules_openForType
uplrules_select
2 changes: 1 addition & 1 deletion rust_icu_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Into<std::fmt::Error> for Error {
/// BUFFER_CAPACITY,
/// [before_arg_a: before_type_a, before_arg_b: before_type_b,],
/// [after_arg_a: after_type_a, after_arg_b: after_type_b,]
/// );
/// );
/// ```
///
/// the generated method has a signature of the form
Expand Down
Loading

0 comments on commit f30a565

Please sign in to comment.