Update to package:intl4x (#977)
* Update to branch
* new bindings
* remove duplicate build_libs
* format
* try fixing collation
* Collation support
* Fix others
* toX to getters
* Kind of works
* Fixes
* Seems to start working
* refactorings
* add asserts
* More test cases
* fix tests
* More fixes
* More fixes
* start changing api
* Stwiched API
* Remove timezones
* Add timezones back
* Manually treeshake timezones
* Add recorduse to bindings
* Refactor
* Also treeshake datetime format
* Add changelog
* Run dart build during tests
* Fixes
* More fixes
* try this
* Fix line length
* Use main branch
* try allowing non utc
* remove utc
* Try something new
* Should pass
* Show output
* stdout
* pub get first
* Fix wf
* Add linux toolchain
* set up toolchains
* fix
* Add locale print for debug
* more debug
* Remove panic_handler
* use looping
* Remove custom locale code
* New name
* Fixes
* artifacts fix
* Generate more artifacts
* Add file size check
* try stuff
* Fix local build
* fix path
* Fix args to datagen
* Fix upload name
* Fix typo
* Fix exports
* Don't run on skip-fetch
* check smarter for labels
* fix typo
* Fix
* Check if this fixed windows
* Exclude windows again
* Update to main
* Enable windows
* Exclude windows for now
* Add todo
* Changes as per review
* Changes as per review
* Fix tests
diff --git a/.github/workflows/health.yaml b/.github/workflows/health.yaml
index 7e1409b..29c8371 100644
--- a/.github/workflows/health.yaml
+++ b/.github/workflows/health.yaml
@@ -10,8 +10,7 @@
with:
coverage_web: true
checkout_submodules: true
- experiments: native-assets
- sdk: dev
+ sdk: main
ignore_license: "**.g.dart,pkgs/intl_translation/example/lib/generated/**,pkgs/intl_translation/test/generate_localized/**,pkgs/intl_translation/test/two_components/**"
ignore_coverage: "**.g.dart"
ignore_packages: "submodules"
diff --git a/.github/workflows/intl4x.yml b/.github/workflows/intl4x.yml
index 366651b..c383438 100644
--- a/.github/workflows/intl4x.yml
+++ b/.github/workflows/intl4x.yml
@@ -1,36 +1,60 @@
name: package:intl4x
-permissions: read-all
+permissions:
+ pull-requests: read # Changed to read, as we are only reading labels
+ contents: read # Added for checkout action
on:
pull_request:
- branches: [ main ]
+ branches: [main]
paths:
- - '.github/workflows/intl4x.yml'
- - 'pkgs/intl4x/**'
- - 'submodules/**'
+ - ".github/workflows/intl4x.yml"
+ - "pkgs/intl4x/**"
+ - "submodules/**"
push:
- branches: [ main ]
+ branches: [main]
paths:
- - '.github/workflows/intl4x.yml'
- - 'pkgs/intl4x/**'
- - 'submodules/**'
+ - ".github/workflows/intl4x.yml"
+ - "pkgs/intl4x/**"
+ - "submodules/**"
schedule:
- - cron: '0 0 * * 0' # weekly
+ - cron: "0 0 * * 0" # weekly
jobs:
+ # This job will determine if the 'skip-fetch' tag is present
+ check_skip_fetch:
+ runs-on: ubuntu-latest
+ outputs:
+ skip_fetch: ${{ steps.get-labels.outputs.skip_fetch }}
+ permissions:
+ pull-requests: read
+ if: github.event_name == 'pull_request'
+ steps:
+ - name: Get PR Labels
+ id: get-labels
+ run: |
+ labels="$(gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER --jq '.labels.[].name')"
+ echo "Found labels: $labels"
+ if echo "$labels" | grep -q "skip-fetch"; then
+ echo "skip_fetch=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "skip_fetch=false" >> "$GITHUB_OUTPUT"
+ fi
+ shell: bash
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ OWNER: ${{ github.repository_owner }}
+ REPO_NAME: ${{ github.event.repository.name }}
+ PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
+
build_checkout:
- runs-on: ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: pkgs/intl4x
strategy:
matrix:
- sdk: [dev]
- os: [ubuntu-latest, windows-latest, macos-latest]
- include:
- - sdk: dev
- run-tests: true
+ os: [ubuntu-latest, macos-latest] #TODO: Exlude windows-latest until it is resolved upstream
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
@@ -38,7 +62,30 @@
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
- sdk: ${{matrix.sdk}}
+ sdk: main
+
+ - name: Install Rust toolchains
+ run: |
+ rustup toolchain install stable
+ rustup toolchain install nightly
+
+ - name: Show the selected Rust toolchain
+ run: rustup show
+
+ - name: Set up toolchain for Linux
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
+
+ - name: Set up toolchain for Mac
+ if: matrix.os == 'macos-latest'
+ run: |
+ rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
+
+ - name: Set up toolchain for Windows
+ if: matrix.os == 'windows-latest'
+ run: |
+ rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
- run: dart pub get
@@ -47,28 +94,85 @@
- run: dart tool/write_option_file.dart pubspec.yaml checkout $(realpath ${{ github.workspace }}/submodules/icu4x)
if: matrix.os == 'macos-latest'
-
+
- run: dart tool/write_option_file.dart pubspec.yaml checkout (Get-Item ${{ github.workspace }}\submodules\icu4x).FullName -replace '/', '\'
if: matrix.os == 'windows-latest'
- - run: dart --enable-experiment=native-assets analyze --fatal-infos
+ - run: dart analyze --fatal-infos
- - run: dart --enable-experiment=native-assets format --output=none --set-exit-if-changed .
- if: ${{matrix.run-tests}}
+ - run: dart format --output=none --set-exit-if-changed .
- - run: dart --enable-experiment=native-assets test
- if: ${{matrix.run-tests}}
+ - run: dart test
- - run: dart --enable-experiment=native-assets test -p chrome
- if: ${{matrix.run-tests}}
+ - run: dart test -p chrome
+
+ - run: dart pub get
+ working-directory: pkgs/intl4x/example_native
+
+ - run: dart --enable-experiment=record-use build cli bin/example_native.dart
+ working-directory: pkgs/intl4x/example_native
+
+ - run: tree . -a
+ if: matrix.os == 'ubuntu-latest'
+
+ - name: Run example_native (Linux)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'ubuntu-latest'
+ run: ./build/cli/linux_x64/bundle/bin/example_native
+ - name: Print file size and check limit for example_native (Linux)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ FILE_PATH="build/cli/linux_x64/bundle/bin/example_native"
+ FILE_SIZE=$(stat -c %s "$FILE_PATH")
+ echo "Linux executable size: $FILE_SIZE bytes"
+ if [ "$FILE_SIZE" -gt 10485760 ]; then
+ echo "Error: Linux executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
+ exit 1
+ fi
+
+ - name: Run example_native (Mac)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'macos-latest'
+ run: ./build/cli/macos_arm64/bundle/bin/example_native
+ - name: Print file size and check limit for example_native (Mac)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'macos-latest'
+ run: |
+ FILE_PATH="build/cli/macos_arm64/bundle/bin/example_native"
+ FILE_SIZE=$(stat -f %z "$FILE_PATH")
+ echo "macOS executable size: $FILE_SIZE bytes"
+ if [ "$FILE_SIZE" -gt 10485760 ]; then
+ echo "Error: macOS executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
+ exit 1
+ fi
+
+ - name: Run example_native (Windows)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'windows-latest'
+ run: .\build\cli\windows_x64\bundle\bin\example_native.exe
+ - name: Print file size and check limit for example_native (Windows)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'windows-latest'
+ run: |
+ $filePath = ".\build\cli\windows_x64\bundle\bin\example_native.exe"
+ $fileSize = (Get-Item $filePath).Length
+ Write-Host "Windows executable size: $fileSize bytes"
+ if ($fileSize -gt 10485760) {
+ Write-Host "Error: Windows executable size ($fileSize bytes) exceeds 10MB limit (10485760 bytes)."
+ exit 1
+ }
build_fetch:
- runs-on: ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ needs: [check_skip_fetch]
+ # Only run if not PR, or if PR and skip_fetch is false
+ if: github.event_name != 'pull_request' || needs.check_skip_fetch.outputs.skip_fetch == 'false'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
-
+
defaults:
run:
working-directory: pkgs/intl4x
@@ -80,93 +184,148 @@
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
- sdk: dev
+ sdk: main
- run: dart pub get
- run: dart tool/write_option_file.dart pubspec.yaml fetch
- - run: dart --enable-experiment=native-assets test
+ - run: dart test
+
+ - run: dart pub get
+ working-directory: pkgs/intl4x/example_native
+
+ - run: dart --enable-experiment=record-use build cli bin/example_native.dart
+ working-directory: pkgs/intl4x/example_native
+
+ - name: Run example_native (Linux)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'ubuntu-latest'
+ run: ./build/cli/linux_x64/bundle/bin/example_native
+
+ - name: Print file size and check limit for example_native (Linux)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ FILE_PATH="build/cli/linux_x64/bundle/bin/example_native"
+ FILE_SIZE=$(stat -c %s "$FILE_PATH")
+ echo "Linux executable size: $FILE_SIZE bytes"
+ if [ "$FILE_SIZE" -gt 10485760 ]; then
+ echo "Error: Linux executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
+ exit 1
+ fi
+
+ - name: Run example_native (Mac)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'macos-latest'
+ run: ./build/cli/macos_arm64/bundle/bin/example_native
+
+ - name: Print file size and check limit for example_native (Mac)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'macos-latest'
+ run: |
+ FILE_PATH="build/cli/macos_arm64/bundle/bin/example_native"
+ FILE_SIZE=$(stat -f %z "$FILE_PATH")
+ echo "macOS executable size: $FILE_SIZE bytes"
+ if [ "$FILE_SIZE" -gt 10485760 ]; then
+ echo "Error: macOS executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
+ exit 1
+ fi
+
+ - name: Run example_native (Windows)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'windows-latest'
+ run: .\build\cli\windows_x64\bundle\bin\example_native.exe
+
+ - name: Print file size and check limit for example_native (Windows)
+ working-directory: pkgs/intl4x/example_native
+ if: matrix.os == 'windows-latest'
+ run: |
+ $filePath = ".\build\cli\windows_x64\bundle\bin\example_native.exe"
+ $fileSize = (Get-Item $filePath).Length
+ Write-Host "Windows executable size: $fileSize bytes"
+ if ($fileSize -gt 10485760) {
+ Write-Host "Error: Windows executable size ($fileSize bytes) exceeds 10MB limit (10485760 bytes)."
+ exit 1
+ }
build_local:
strategy:
fail-fast: false
matrix:
- os: [ ubuntu-latest, macos-latest, windows-latest ]
+ os: [ubuntu-latest, macos-latest] #TODO: Exlude windows-latest until it is resolved upstream
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- with:
- submodules: true
+ - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+ with:
+ submodules: true
- - name: Install Rust toolchains
- run: |
- rustup toolchain install 1.78
-
- - name: Show the selected Rust toolchain
- run: rustup show
-
- - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
- with:
- sdk: dev
+ - name: Install Rust toolchains
+ run: |
+ rustup toolchain install stable
+ rustup toolchain install nightly
- - name: Build Linux
- if: matrix.os == 'ubuntu-latest'
- run: |
- cd submodules/icu4x
+ - name: Show the selected Rust toolchain
+ run: rustup show
- mkdir bin
+ - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
+ with:
+ sdk: main
- cd ffi/dart
- dart pub get
- cd ../..
- dart ffi/dart/tool/build_libs.dart --file bin/linux_x64 --os linux --architecture x64 --compile_type dynamic --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
+ - name: Prep build
+ run: |
+ (cd pkgs/intl4x && dart pub get)
- - name: Build Mac
- if: matrix.os == 'macos-latest'
- run: |
- cd submodules/icu4x
+ mkdir submodules/icu4x/bin
- mkdir bin
+ - name: Build Linux
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
- cd ffi/dart
- dart pub get
- cd ../..
- dart ffi/dart/tool/build_libs.dart --file bin/macos_arm64 --os macos --architecture arm64 --compile_type dynamic --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_x64 --os linux --architecture x64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,experimental,compiled_data
- - name: Build Windows
- if: matrix.os == 'windows-latest'
- run: |
- cd submodules/icu4x
-
- mkdir bin
+ - name: Build Mac
+ if: matrix.os == 'macos-latest'
+ run: |
+ rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
- cd ffi/dart
- dart pub get
- cd ../..
- dart ffi/dart/tool/build_libs.dart --file bin/windows_x64 --os windows --architecture x64 --compile_type dynamic --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/macos_arm64 --os macos --architecture arm64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,experimental,compiled_data
- - name: Run `dart pub get`
- run: |
- cd pkgs/intl4x
- dart pub get
+ - name: Build Windows
+ if: matrix.os == 'windows-latest'
+ run: |
+ rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
- - run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/linux_x64)
- if: matrix.os == 'ubuntu-latest'
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_x64 --os windows --architecture x64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,experimental,compiled_data
- - run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/macos_arm64)
- if: matrix.os == 'macos-latest'
-
- - run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\'
- if: matrix.os == 'windows-latest'
+ - name: Run `dart pub get`
+ run: |
+ cd pkgs/intl4x
+ dart pub get
- - run: echo $LOCAL_ICU4X_BINARY
-
- - name: Display structure of downloaded files
- run: ls -R
+ - run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/linux_x64)
+ if: matrix.os == 'ubuntu-latest'
- - name: Run `dart test`
- run: |
- cd pkgs/intl4x
- dart --enable-experiment=native-assets test
+ - run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/macos_arm64)
+ if: matrix.os == 'macos-latest'
+
+ - run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\'
+ if: matrix.os == 'windows-latest'
+
+ - run: echo $LOCAL_ICU4X_BINARY
+
+ - name: Display structure of downloaded files
+ run: ls -R
+
+ - name: Run `dart test`
+ run: |
+ cd pkgs/intl4x
+ dart test
+
+ - run: dart pub get
+ working-directory: pkgs/intl4x/example_native
+
+ - run: dart --enable-experiment=record-use build cli
+ working-directory: pkgs/intl4x/example_native
diff --git a/.github/workflows/intl4x_artifacts.yml b/.github/workflows/intl4x_artifacts.yml
index 78d2237..8e7d610 100644
--- a/.github/workflows/intl4x_artifacts.yml
+++ b/.github/workflows/intl4x_artifacts.yml
@@ -24,9 +24,14 @@
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
compiletype: [ dynamic, static ]
+ include_data: [true, false]
+ exclude:
+ - compiletype: dynamic
+ include_data: false
runs-on: ${{ matrix.os }}
env:
- DATA: ${{ matrix.compiletype == 'dynamic' && ',compiled_data' || '' }}
+ DATA: ${{ matrix.include_data == true && ',compiled_data' || '' }}
+ FILENAME_SUFFIX: ${{ matrix.compiletype == 'static' && matrix.include_data == true && '_data' || '' }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
@@ -43,7 +48,7 @@
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
- sdk: dev
+ sdk: main
- name: Setup additional linkers
if: matrix.os == 'ubuntu-latest'
@@ -68,29 +73,29 @@
mkdir submodules/icu4x/bin
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_arm_${{ matrix.compiletype }} --os android --architecture arm --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_arm64_${{ matrix.compiletype }} --os android --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_ia32_${{ matrix.compiletype }} --os android --architecture ia32 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_x64_${{ matrix.compiletype }} --os android --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_arm_${{ matrix.compiletype }} --os linux --architecture arm --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_arm64_${{ matrix.compiletype }} --os linux --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_riscv64_${{ matrix.compiletype }} --os linux --architecture riscv64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_x64_${{ matrix.compiletype }} --os linux --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_arm_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os android --architecture arm --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_arm64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os android --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_ia32_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os android --architecture ia32 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/android_x64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os android --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_arm_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os linux --architecture arm --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_arm64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os linux --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_riscv64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os linux --architecture riscv64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_x64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os linux --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
- name: Build Linux data
- if: matrix.os == 'ubuntu-latest' && matrix.compiletype == 'static'
+ if: matrix.os == 'ubuntu-latest' && matrix.compiletype == 'static' && matrix.include_data == false
run: |
cd submodules/icu4x
- cargo run -p icu_datagen -- --locales full --keys all --format blob --out bin/full.postcard
+ cargo run -p icu4x-datagen -- --locales modern --markers all --format blob --out bin/full.postcard
- cd provider/datagen # avoid global feature resolution
+ cd provider/icu4x-datagen # avoid global feature resolution
rustup target add aarch64-unknown-linux-gnu
- cargo build --release --bin icu4x-datagen --no-default-features --features bin,blob_exporter,blob_input,rayon,experimental_components --target aarch64-unknown-linux-gnu
+ cargo build --release --bin icu4x-datagen --no-default-features --features blob_exporter,blob_input,rayon --target aarch64-unknown-linux-gnu
rustup target add riscv64gc-unknown-linux-gnu
- cargo build --release --bin icu4x-datagen --no-default-features --features bin,blob_exporter,blob_input,rayon,experimental_components --target riscv64gc-unknown-linux-gnu
+ cargo build --release --bin icu4x-datagen --no-default-features --features blob_exporter,blob_input,rayon --target riscv64gc-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu
- cargo build --release --bin icu4x-datagen --no-default-features --features bin,blob_exporter,blob_input,rayon,experimental_components --target x86_64-unknown-linux-gnu
+ cargo build --release --bin icu4x-datagen --no-default-features --features blob_exporter,blob_input,rayon --target x86_64-unknown-linux-gnu
cd ../..
cp target/aarch64-unknown-linux-gnu/release/icu4x-datagen bin/linux_arm64-datagen
@@ -106,19 +111,19 @@
mkdir submodules/icu4x/bin
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/ios_arm64_${{ matrix.compiletype }} --os ios --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/ios_x64_${{ matrix.compiletype }} --os ios --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/macos_arm64_${{ matrix.compiletype }} --os macos --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/macos_x64_${{ matrix.compiletype }} --os macos --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/ios_arm64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os ios --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/ios_x64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os ios --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/macos_arm64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os macos --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/macos_x64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os macos --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
- name: Build Mac data
- if: matrix.os == 'macos-latest' && matrix.compiletype == 'static'
+ if: matrix.os == 'macos-latest' && matrix.compiletype == 'static' && matrix.include_data == false
run: |
- cd submodules/icu4x/provider/datagen # avoid global feature resolution
+ cd submodules/icu4x/provider/icu4x-datagen # avoid global feature resolution
rustup target add aarch64-apple-darwin
- cargo build --release --bin icu4x-datagen --no-default-features --features bin,blob_exporter,blob_input,rayon,experimental_components --target aarch64-apple-darwin
+ cargo build --release --bin icu4x-datagen --no-default-features --features blob_exporter,blob_input,rayon --target aarch64-apple-darwin
rustup target add x86_64-apple-darwin
- cargo build --release --bin icu4x-datagen --no-default-features --features bin,blob_exporter,blob_input,rayon,experimental_components --target x86_64-apple-darwin
+ cargo build --release --bin icu4x-datagen --no-default-features --features blob_exporter,blob_input,rayon --target x86_64-apple-darwin
cd ../..
cp target/aarch64-apple-darwin/release/icu4x-datagen bin/macos_arm64-datagen
@@ -135,18 +140,18 @@
mkdir submodules/icu4x/bin
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_arm64_${{ matrix.compiletype }} --os windows --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_ia32_${{ matrix.compiletype }} --os windows --architecture ia32 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
- dart pkgs/intl4x/tool/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_x64_${{ matrix.compiletype }} --os windows --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_arm64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os windows --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_ia32_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os windows --architecture ia32 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
+ dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_x64_${{ matrix.compiletype }}${{ env.FILENAME_SUFFIX }} --os windows --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features collator,datetime,list,decimal,plurals,experimental${{ env.DATA }}
- name: Build Windows data
- if: matrix.os == 'windows-latest' && matrix.compiletype == 'static'
+ if: matrix.os == 'windows-latest' && matrix.compiletype == 'static' && matrix.include_data == false
run: |
- cd submodules/icu4x/provider/datagen # avoid global feature resolution
+ cd submodules/icu4x/provider/icu4x-datagen # avoid global feature resolution
rustup target add aarch64-pc-windows-msvc
- cargo build --release --bin icu4x-datagen --no-default-features --features bin,blob_exporter,blob_input,rayon,experimental_components --target aarch64-pc-windows-msvc
+ cargo build --release --bin icu4x-datagen --no-default-features --features blob_exporter,blob_input,rayon --target aarch64-pc-windows-msvc
rustup target add x86_64-pc-windows-msvc
- cargo build --release --bin icu4x-datagen --no-default-features --features bin,blob_exporter,blob_input,rayon,experimental_components --target x86_64-pc-windows-msvc
+ cargo build --release --bin icu4x-datagen --no-default-features --features blob_exporter,blob_input,rayon --target x86_64-pc-windows-msvc
cd ../..
cp target/aarch64-pc-windows-msvc/release/icu4x-datagen.exe bin/windows_arm64-datagen.exe
@@ -155,7 +160,7 @@
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
- name: dart-${{matrix.os}}-${{ matrix.compiletype }}-libs
+ name: dart-${{matrix.os}}-${{ matrix.compiletype }}-${{ matrix.compiletype == 'static' && matrix.include_data == true && 'with_data' || '' }}-libs
path: submodules/icu4x/bin
check_hashes:
@@ -181,13 +186,13 @@
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
- sdk: dev
+ sdk: main
- name: Check hashes of released artifacts
run: |
cd pkgs/intl4x
dart pub get
- dart --enable-experiment=native-assets tool/regenerate_hashes.dart
+ dart tool/regenerate_hashes.dart
git diff --exit-code
release:
diff --git a/pkgs/intl4x/CHANGELOG.md b/pkgs/intl4x/CHANGELOG.md
index b012786..87f1a32 100644
--- a/pkgs/intl4x/CHANGELOG.md
+++ b/pkgs/intl4x/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.12.0
+
+- Update to ICU4X 2.0.
+
## 0.11.4
- Remove `native_assets_*` dependencies for `hooks` and `code_assets`.
diff --git a/pkgs/intl4x/README.md b/pkgs/intl4x/README.md
index f0f5ecf..877b79b 100644
--- a/pkgs/intl4x/README.md
+++ b/pkgs/intl4x/README.md
@@ -39,7 +39,7 @@
void main() {
final numberFormat = Intl(
ecmaPolicy: const AlwaysEcma(),
- locale: const Locale(language: 'en', region: 'US'),
+ locale: Locale.parse('en-US'),
).numberFormat(NumberFormatOptions.percent());
print(numberFormat.format(0.5)); // prints 50%
diff --git a/pkgs/intl4x/example_native/.gitignore b/pkgs/intl4x/example_native/.gitignore
index 750e1ef..4dda46f 100644
--- a/pkgs/intl4x/example_native/.gitignore
+++ b/pkgs/intl4x/example_native/.gitignore
@@ -1,4 +1,4 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
-bin/example_native/
+build/
diff --git a/pkgs/intl4x/example_native/bin/example_native.dart b/pkgs/intl4x/example_native/bin/example_native.dart
index 9a74434..35232cb 100644
--- a/pkgs/intl4x/example_native/bin/example_native.dart
+++ b/pkgs/intl4x/example_native/bin/example_native.dart
@@ -2,8 +2,17 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'dart:io';
+
+import 'package:intl4x/datetime_format.dart';
import 'package:intl4x/intl4x.dart';
void main(List<String> arguments) {
- print(Intl().numberFormat().format(3));
+ const timeZone = TimeZone.long(
+ name: 'Europe/Paris',
+ offset: Duration(hours: 2),
+ );
+ print(Platform.localeName);
+ print(Intl().locale);
+ print(Intl().dateTimeFormat().time(DateTime.now(), timeZone: timeZone));
}
diff --git a/pkgs/intl4x/hook/build.dart b/pkgs/intl4x/hook/build.dart
index a925b6a..e209407 100644
--- a/pkgs/intl4x/hook/build.dart
+++ b/pkgs/intl4x/hook/build.dart
@@ -112,7 +112,11 @@
final targetArchitecture = input.config.code.targetArchitecture;
final libraryType =
input.config.buildStatic(treeshake) ? 'static' : 'dynamic';
- final target = [targetOS, targetArchitecture, libraryType].join('_');
+ final target = [
+ targetOS,
+ targetArchitecture,
+ libraryType,
+ ].join('_'); //TODO: Add with-data if static
print('Fetching pre-built binary for $version and $target');
final dylibRemoteUri = Uri.parse(
'https://github.com/dart-lang/i18n/releases/download/$version/$target',
@@ -208,12 +212,13 @@
input.config.code.iOS.targetSdk == IOSSdk.iPhoneSimulator,
Directory.fromUri(checkoutPath!),
[
- 'icu_collator',
- 'icu_datetime',
- 'icu_list',
- 'icu_decimal',
- 'icu_plurals',
- 'experimental_components',
+ 'collator',
+ 'datetime',
+ 'list',
+ 'decimal',
+ 'plurals',
+ 'buffer_provider',
+ 'experimental',
'default_components',
'compiled_data',
],
diff --git a/pkgs/intl4x/hook/link.dart b/pkgs/intl4x/hook/link.dart
index 4d85fc1..ff057c7 100644
--- a/pkgs/intl4x/hook/link.dart
+++ b/pkgs/intl4x/hook/link.dart
@@ -8,6 +8,7 @@
import 'package:code_assets/code_assets.dart' show LinkInputCodeAssets;
import 'package:collection/collection.dart' show IterableExtension;
import 'package:hooks/hooks.dart' show LinkInput, link;
+import 'package:intl4x/datetime_format.dart';
import 'package:intl4x/src/hook_helpers/shared.dart' show assetId, package;
import 'package:logging/logging.dart';
import 'package:native_toolchain_c/native_toolchain_c.dart';
@@ -18,6 +19,16 @@
name: '_DiplomatFfiUse',
);
+const timeFormatId = record_use.Identifier(
+ importUri: 'package:intl4x/src/datetime_format/datetime_format.dart',
+ name: 'DatetimeFormatExt|time',
+);
+
+const ymdFormatId = record_use.Identifier(
+ importUri: 'package:intl4x/src/datetime_format/datetime_format.dart',
+ name: 'DatetimeFormatExt|ymd',
+);
+
/// Run the linker to turn a static into a treeshaken dynamic library.
Future<void> main(List<String> args) async {
await link(args, (input, output) async {
@@ -33,16 +44,37 @@
output.addDependency(staticLib.file!);
final usages = input.usages;
+
+ final timeZonesTimeFormat = _usedTimeZonesTimeFormat(usages);
+ final timeZonesDateFormat = _usedTimeZonesDateFormat(usages);
+
final usedSymbols = usages
?.constantsOf(recordSymbolId)
- .map((instance) => instance['symbol'] as String);
+ .map((instance) => instance['symbol'] as String)
+ .whereNot(
+ (symbol) =>
+ _isUnusedSymbol(
+ symbol,
+ 'icu4x_ZonedTimeFormatter_create_',
+ timeZonesTimeFormat,
+ ) ||
+ _isUnusedSymbol(
+ symbol,
+ 'icu4x_ZonedDateFormatter_create_',
+ timeZonesDateFormat,
+ ),
+ );
- print('Using symbols: $usedSymbols');
+ print('''
+### Using symbols:
+${usedSymbols?.join('\n')}
+### End using symbols
+''');
await CLinker.library(
name: input.packageName,
assetName: assetId,
- sources: [staticLib.file!.path],
+ sources: [staticLib.file!.toFilePath()],
linkerOptions: LinkerOptions.treeshake(symbols: usedSymbols),
).run(
input: input,
@@ -55,6 +87,69 @@
});
}
+bool _isUnusedSymbol(String symbol, String prefix, Set<String>? usedSymbols) =>
+ symbol.startsWith(prefix) && !(usedSymbols?.contains(symbol) ?? true);
+
+Set<String>? _usedTimeZonesTimeFormat(record_use.RecordedUsages? usages) =>
+ usages
+ ?.constArgumentsFor(
+ timeFormatId,
+ 'String time(DateTime datetime, {TimeZone timeZone})',
+ )
+ .map(
+ (argument) =>
+ ((argument.named['timeZone'] as Map)['type'] as Map)['index']
+ as int,
+ )
+ .map((index) => TimeZoneType.values[index])
+ .map(
+ (timeZoneType) => switch (timeZoneType) {
+ TimeZoneType.long =>
+ 'icu4x_ZonedTimeFormatter_create_specific_long_mv1',
+ TimeZoneType.short =>
+ 'icu4x_ZonedTimeFormatter_create_specific_short_mv1',
+ TimeZoneType.shortOffset =>
+ 'icu4x_ZonedTimeFormatter_create_localized_offset_short_mv1',
+ TimeZoneType.longOffset =>
+ 'icu4x_ZonedTimeFormatter_create_localized_offset_long_mv1',
+ TimeZoneType.shortGeneric =>
+ 'icu4x_ZonedTimeFormatter_create_generic_short_mv1',
+ TimeZoneType.longGeneric =>
+ 'icu4x_ZonedTimeFormatter_create_generic_long_mv1',
+ },
+ )
+ .toSet();
+
+Set<String>? _usedTimeZonesDateFormat(record_use.RecordedUsages? usages) =>
+ usages
+ ?.constArgumentsFor(
+ ymdFormatId,
+ 'String ymd(DateTime datetime, {TimeZone timeZone})',
+ )
+ .map(
+ (argument) =>
+ ((argument.named['timeZone'] as Map)['type'] as Map)['index']
+ as int,
+ )
+ .map((index) => TimeZoneType.values[index])
+ .map(
+ (timeZoneType) => switch (timeZoneType) {
+ TimeZoneType.long =>
+ 'icu4x_ZonedDateFormatter_create_specific_long_mv1',
+ TimeZoneType.short =>
+ 'icu4x_ZonedDateFormatter_create_specific_short_mv1',
+ TimeZoneType.shortOffset =>
+ 'icu4x_ZonedDateFormatter_create_localized_offset_short_mv1',
+ TimeZoneType.longOffset =>
+ 'icu4x_ZonedDateFormatter_create_localized_offset_long_mv1',
+ TimeZoneType.shortGeneric =>
+ 'icu4x_ZonedDateFormatter_create_generic_short_mv1',
+ TimeZoneType.longGeneric =>
+ 'icu4x_ZonedDateFormatter_create_generic_long_mv1',
+ },
+ )
+ .toSet();
+
extension on LinkInput {
record_use.RecordedUsages? get usages {
if (recordedUsagesFile == null) {
diff --git a/pkgs/intl4x/lib/collation.dart b/pkgs/intl4x/lib/collation.dart
index cc987ac..fb3212f 100644
--- a/pkgs/intl4x/lib/collation.dart
+++ b/pkgs/intl4x/lib/collation.dart
@@ -2,6 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-export 'src/collation/collation.dart';
+export 'src/collation/collation.dart' show Collation;
export 'src/collation/collation_options.dart';
export 'src/options.dart';
diff --git a/pkgs/intl4x/lib/datetime_format.dart b/pkgs/intl4x/lib/datetime_format.dart
index 6735df8..16b76dd 100644
--- a/pkgs/intl4x/lib/datetime_format.dart
+++ b/pkgs/intl4x/lib/datetime_format.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-export 'src/datetime_format/datetime_format.dart';
+export 'src/datetime_format/datetime_format.dart'
+ show DateTimeFormat, DatetimeFormatExt;
export 'src/datetime_format/datetime_format_options.dart';
export 'src/options.dart';
diff --git a/pkgs/intl4x/lib/display_names.dart b/pkgs/intl4x/lib/display_names.dart
index 4c1ba3f..7120fc8 100644
--- a/pkgs/intl4x/lib/display_names.dart
+++ b/pkgs/intl4x/lib/display_names.dart
@@ -2,6 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-export 'src/display_names/display_names.dart';
+export 'src/display_names/display_names.dart' show DisplayNames;
export 'src/display_names/display_names_options.dart';
export 'src/options.dart';
diff --git a/pkgs/intl4x/lib/intl4x.dart b/pkgs/intl4x/lib/intl4x.dart
index 6eeb86f..106c83d 100644
--- a/pkgs/intl4x/lib/intl4x.dart
+++ b/pkgs/intl4x/lib/intl4x.dart
@@ -5,11 +5,12 @@
import 'collation.dart';
import 'display_names.dart';
import 'number_format.dart';
+import 'src/collation/collation.dart';
import 'src/collation/collation_impl.dart';
-import 'src/data.dart';
import 'src/datetime_format/datetime_format.dart';
import 'src/datetime_format/datetime_format_impl.dart';
import 'src/datetime_format/datetime_format_options.dart';
+import 'src/display_names/display_names.dart';
import 'src/display_names/display_names_impl.dart';
import 'src/ecma/ecma_policy.dart';
import 'src/ecma/ecma_stub.dart' if (dart.library.js) 'src/ecma/ecma_web.dart';
@@ -18,14 +19,14 @@
import 'src/list_format/list_format_impl.dart';
import 'src/list_format/list_format_options.dart';
import 'src/locale/locale.dart';
+import 'src/number_format/number_format.dart';
import 'src/number_format/number_format_impl.dart';
import 'src/plural_rules/plural_rules.dart';
import 'src/plural_rules/plural_rules_impl.dart';
import 'src/plural_rules/plural_rules_options.dart';
-export 'src/data.dart';
export 'src/locale/locale.dart';
-export 'src/plural_rules/plural_rules.dart';
+export 'src/plural_rules/plural_rules.dart' show PluralCategory, PluralRules;
typedef Icu4xKey = String;
@@ -43,47 +44,44 @@
/// ```
class Intl {
final EcmaPolicy ecmaPolicy;
- final Data data;
- final List<Locale> supportedLocales;
final LocaleMatcher localeMatcher;
Collation collation([CollationOptions options = const CollationOptions()]) =>
- Collation(
- CollationImpl.build(locale, data, options, localeMatcher, ecmaPolicy),
+ buildCollation(
+ CollationImpl.build(locale, options, localeMatcher, ecmaPolicy),
);
- NumberFormat numberFormat([NumberFormatOptions? options]) => NumberFormat(
- NumberFormatImpl.build(
- locale,
- data,
- options ?? NumberFormatOptions.custom(),
- localeMatcher,
- ecmaPolicy,
- ),
- );
+ NumberFormat numberFormat([NumberFormatOptions? options]) =>
+ buildNumberFormat(
+ NumberFormatImpl.build(
+ locale,
+ options ?? NumberFormatOptions.custom(),
+ localeMatcher,
+ ecmaPolicy,
+ ),
+ );
ListFormat listFormat([
ListFormatOptions options = const ListFormatOptions(),
- ]) => ListFormat(
- ListFormatImpl.build(locale, data, options, localeMatcher, ecmaPolicy),
+ ]) => buildListFormat(
+ ListFormatImpl.build(locale, options, localeMatcher, ecmaPolicy),
);
DisplayNames displayNames([
DisplayNamesOptions options = const DisplayNamesOptions(),
- ]) => DisplayNames(
- DisplayNamesImpl.build(locale, data, options, localeMatcher, ecmaPolicy),
+ ]) => buildDisplayNames(
+ DisplayNamesImpl.build(locale, options, localeMatcher, ecmaPolicy),
);
- DateTimeFormat datetimeFormat([
+ DateTimeFormat dateTimeFormat([
DateTimeFormatOptions options = const DateTimeFormatOptions(),
- ]) => DateTimeFormat(
- DateTimeFormatImpl.build(locale, data, options, localeMatcher, ecmaPolicy),
+ ]) => buildDateTimeFormat(
+ DateTimeFormatImpl.build(locale, options, localeMatcher, ecmaPolicy),
);
- PluralRules plural([PluralRulesOptions? options]) => PluralRules(
+ PluralRules plural([PluralRulesOptions? options]) => buildPluralRules(
PluralRulesImpl.build(
locale,
- data,
options ?? PluralRulesOptions(),
localeMatcher,
ecmaPolicy,
@@ -96,9 +94,7 @@
Intl._({
Locale? locale,
this.ecmaPolicy = defaultPolicy,
- this.supportedLocales = allLocales,
this.localeMatcher = LocaleMatcher.lookup,
- this.data = const NoData(),
}) : locale = locale ?? findSystemLocale();
Intl.includeLocales({
@@ -106,37 +102,19 @@
EcmaPolicy ecmaPolicy = defaultPolicy,
List<Locale> includedLocales = const [],
LocaleMatcher localeMatcher = LocaleMatcher.lookup,
- }) : this._(
- locale: locale,
- ecmaPolicy: ecmaPolicy,
- supportedLocales: includedLocales,
- );
+ }) : this._(locale: locale, ecmaPolicy: ecmaPolicy);
Intl.excludeLocales({
Locale? locale,
EcmaPolicy ecmaPolicy = defaultPolicy,
- List<Locale> excludedLocales = const [],
LocaleMatcher localeMatcher = LocaleMatcher.lookup,
- }) : this._(
- locale: locale,
- ecmaPolicy: ecmaPolicy,
- supportedLocales:
- allLocales
- .where((locale) => !excludedLocales.contains(locale))
- .toList(),
- );
+ }) : this._(locale: locale, ecmaPolicy: ecmaPolicy);
Intl({
Locale? locale,
EcmaPolicy ecmaPolicy = defaultPolicy,
LocaleMatcher localeMatcher = LocaleMatcher.lookup,
- Data data = const BundleData(),
- }) : this._(
- locale: locale,
- ecmaPolicy: ecmaPolicy,
- supportedLocales: allLocales,
- data: data,
- );
+ }) : this._(locale: locale, ecmaPolicy: ecmaPolicy);
Locale locale;
diff --git a/pkgs/intl4x/lib/list_format.dart b/pkgs/intl4x/lib/list_format.dart
index a22f8a7..e66bf5e 100644
--- a/pkgs/intl4x/lib/list_format.dart
+++ b/pkgs/intl4x/lib/list_format.dart
@@ -2,6 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-export 'src/list_format/list_format.dart';
+export 'src/list_format/list_format.dart' show ListFormat;
export 'src/list_format/list_format_options.dart';
export 'src/options.dart';
diff --git a/pkgs/intl4x/lib/number_format.dart b/pkgs/intl4x/lib/number_format.dart
index facd400..6151f1e 100644
--- a/pkgs/intl4x/lib/number_format.dart
+++ b/pkgs/intl4x/lib/number_format.dart
@@ -2,6 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-export 'src/number_format/number_format.dart';
+export 'src/number_format/number_format.dart' show NumberFormat;
export 'src/number_format/number_format_options.dart';
export 'src/options.dart';
diff --git a/pkgs/intl4x/lib/plural_rules.dart b/pkgs/intl4x/lib/plural_rules.dart
index fc101c5..1727de5 100644
--- a/pkgs/intl4x/lib/plural_rules.dart
+++ b/pkgs/intl4x/lib/plural_rules.dart
@@ -3,5 +3,5 @@
// BSD-style license that can be found in the LICENSE file.
export 'src/options.dart';
-export 'src/plural_rules/plural_rules.dart';
+export 'src/plural_rules/plural_rules.dart' show PluralCategory, PluralRules;
export 'src/plural_rules/plural_rules_options.dart';
diff --git a/pkgs/intl4x/lib/src/bindings/AnyCalendarKind.g.dart b/pkgs/intl4x/lib/src/bindings/AnyCalendarKind.g.dart
deleted file mode 100644
index da95ca0..0000000
--- a/pkgs/intl4x/lib/src/bindings/AnyCalendarKind.g.dart
+++ /dev/null
@@ -1,141 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// The various calendar types currently supported by [`Calendar`]
-///
-/// See the [Rust documentation for `AnyCalendarKind`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendarKind.html) for more information.
-enum AnyCalendarKind {
- /// The kind of an Iso calendar
- iso,
-
- /// The kind of a Gregorian calendar
- gregorian,
-
- /// The kind of a Buddhist calendar
- buddhist,
-
- /// The kind of a Japanese calendar with modern eras
- japanese,
-
- /// The kind of a Japanese calendar with modern and historic eras
- japaneseExtended,
-
- /// The kind of an Ethiopian calendar, with Amete Mihret era
- ethiopian,
-
- /// The kind of an Ethiopian calendar, with Amete Alem era
- ethiopianAmeteAlem,
-
- /// The kind of a Indian calendar
- indian,
-
- /// The kind of a Coptic calendar
- coptic,
-
- /// The kind of a Dangi calendar
- dangi,
-
- /// The kind of a Chinese calendar
- chinese,
-
- /// The kind of a Hebrew calendar
- hebrew,
-
- /// The kind of a Islamic civil calendar
- islamicCivil,
-
- /// The kind of a Islamic observational calendar
- islamicObservational,
-
- /// The kind of a Islamic tabular calendar
- islamicTabular,
-
- /// The kind of a Islamic Umm al-Qura calendar
- islamicUmmAlQura,
-
- /// The kind of a Persian calendar
- persian,
-
- /// The kind of a Roc calendar
- roc;
-
- /// Read the calendar type off of the -u-ca- extension on a locale.
- ///
- /// Returns nothing if there is no calendar on the locale or if the locale's calendar
- /// is not known or supported.
- ///
- /// See the [Rust documentation for `get_for_locale`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendarKind.html#method.get_for_locale) for more information.
- static AnyCalendarKind? getForLocale(Locale locale) {
- final result = _ICU4XAnyCalendarKind_get_for_locale(locale._ffi);
- if (!result.isOk) {
- return null;
- }
- return AnyCalendarKind.values[result.union.ok];
- }
-
- /// Obtain the calendar type given a BCP-47 -u-ca- extension string.
- ///
- /// Returns nothing if the calendar is not known or supported.
- ///
- /// See the [Rust documentation for `get_for_bcp47_value`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendarKind.html#method.get_for_bcp47_value) for more information.
- static AnyCalendarKind? getForBcp47(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XAnyCalendarKind_get_for_bcp47(
- sView.allocIn(temp),
- sView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- return null;
- }
- return AnyCalendarKind.values[result.union.ok];
- }
-
- /// Obtain the string suitable for use in the -u-ca- extension in a BCP47 locale.
- ///
- /// See the [Rust documentation for `as_bcp47_string`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendarKind.html#method.as_bcp47_string) for more information.
- ///
- /// Throws [Error] on failure.
- String get bcp47 {
- final writeable = _Writeable();
- final result = _ICU4XAnyCalendarKind_bcp47(index, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XAnyCalendarKind_get_for_locale')
-@ffi.Native<_ResultInt32Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XAnyCalendarKind_get_for_locale',
-)
-// ignore: non_constant_identifier_names
-external _ResultInt32Void _ICU4XAnyCalendarKind_get_for_locale(
- ffi.Pointer<ffi.Opaque> locale,
-);
-
-@_DiplomatFfiUse('ICU4XAnyCalendarKind_get_for_bcp47')
-@ffi.Native<_ResultInt32Void Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XAnyCalendarKind_get_for_bcp47',
-)
-// ignore: non_constant_identifier_names
-external _ResultInt32Void _ICU4XAnyCalendarKind_get_for_bcp47(
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
-);
-
-@_DiplomatFfiUse('ICU4XAnyCalendarKind_bcp47')
-@ffi.Native<_ResultVoidInt32 Function(ffi.Int32, ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XAnyCalendarKind_bcp47',
-)
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XAnyCalendarKind_bcp47(
- int self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/Bcp47ToIanaMapper.g.dart b/pkgs/intl4x/lib/src/bindings/Bcp47ToIanaMapper.g.dart
deleted file mode 100644
index be1b749..0000000
--- a/pkgs/intl4x/lib/src/bindings/Bcp47ToIanaMapper.g.dart
+++ /dev/null
@@ -1,97 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An object capable of mapping from a BCP-47 time zone ID to an IANA ID.
-///
-/// See the [Rust documentation for `IanaBcp47RoundTripMapper`](https://docs.rs/icu/latest/icu/timezone/struct.IanaBcp47RoundTripMapper.html) for more information.
-final class Bcp47ToIanaMapper implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- Bcp47ToIanaMapper._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XBcp47ToIanaMapper_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XBcp47ToIanaMapper_destroy),
- );
-
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.IanaBcp47RoundTripMapper.html#method.new) for more information.
- ///
- /// Throws [Error] on failure.
- factory Bcp47ToIanaMapper(DataProvider provider) {
- final result = _ICU4XBcp47ToIanaMapper_create(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return Bcp47ToIanaMapper._fromFfi(result.union.ok, []);
- }
-
- /// Writes out the canonical IANA time zone ID corresponding to the given BCP-47 ID.
- ///
- /// See the [Rust documentation for `bcp47_to_iana`](https://docs.rs/icu/latest/icu/timezone/struct.IanaBcp47RoundTripMapperBorrowed.html#method.bcp47_to_iana) for more information.
- ///
- /// Throws [Error] on failure.
- String operator [](String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XBcp47ToIanaMapper_get(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XBcp47ToIanaMapper_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XBcp47ToIanaMapper_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XBcp47ToIanaMapper_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XBcp47ToIanaMapper_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBcp47ToIanaMapper_create',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XBcp47ToIanaMapper_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
-
-@_DiplomatFfiUse('ICU4XBcp47ToIanaMapper_get')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XBcp47ToIanaMapper_get')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XBcp47ToIanaMapper_get(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/Bidi.g.dart b/pkgs/intl4x/lib/src/bindings/Bidi.g.dart
index 2a08397..20d4a34 100644
--- a/pkgs/intl4x/lib/src/bindings/Bidi.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Bidi.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X Bidi object, containing loaded bidi data
///
-/// See the [Rust documentation for `BidiClassAdapter`](https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html) for more information.
+/// See the [Rust documentation for `BidiClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html) for more information.
final class Bidi implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,20 +23,22 @@
}
}
- @_DiplomatFfiUse('ICU4XBidi_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XBidi_destroy),
- );
+ @_DiplomatFfiUse('icu4x_Bidi_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Bidi_destroy_mv1));
- /// Creates a new [`Bidi`] from locale data.
+ /// Creates a new [Bidi] from locale data using compiled data.
+ factory Bidi() {
+ final result = _icu4x_Bidi_create_mv1();
+ return Bidi._fromFfi(result, []);
+ }
+
+ /// Creates a new [Bidi] from locale data, and a particular data source.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html#method.new) for more information.
- ///
- /// Throws [Error] on failure.
- factory Bidi(DataProvider provider) {
- final result = _ICU4XBidi_create(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory Bidi.withProvider(DataProvider provider) {
+ final result = _icu4x_Bidi_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return Bidi._fromFfi(result.union.ok, []);
}
@@ -44,18 +47,12 @@
///
/// Takes in a Level for the default level, if it is an invalid value it will default to LTR
///
- /// See the [Rust documentation for `new_with_data_source`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.new_with_data_source) for more information.
- BidiInfo forText(String text, int defaultLevel) {
- final textView = text.utf8View;
+ /// See the [Rust documentation for `new_with_data_source`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/struct.BidiInfo.html#method.new_with_data_source) for more information.
+ BidiInfo forText(String text, [int? defaultLevel]) {
final textArena = _FinalizedArena();
// This lifetime edge depends on lifetimes: 'text
core.List<Object> textEdges = [textArena];
- final result = _ICU4XBidi_for_text_valid_utf8(
- _ffi,
- textView.allocIn(textArena.arena),
- textView.length,
- defaultLevel,
- );
+ final result = _icu4x_Bidi_for_text_valid_utf8_mv1(_ffi, text._utf8AllocIn(textArena.arena), defaultLevel != null ? _ResultUint8Void.ok(defaultLevel) : _ResultUint8Void.err());
return BidiInfo._fromFfi(result, [], textEdges);
}
@@ -68,16 +65,10 @@
/// Failure to follow this invariant may lead to incorrect results,
/// but is still safe.
///
- /// See the [Rust documentation for `reorder_visual`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.reorder_visual) for more information.
+ /// See the [Rust documentation for `reorder_visual`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/struct.BidiInfo.html#method.reorder_visual) for more information.
ReorderedIndexMap reorderVisual(core.List<int> levels) {
- final temp = ffi2.Arena();
- final levelsView = levels.uint8View;
- final result = _ICU4XBidi_reorder_visual(
- _ffi,
- levelsView.allocIn(temp),
- levelsView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_Bidi_reorder_visual_mv1(_ffi, levels._uint8AllocIn(temp.arena));
return ReorderedIndexMap._fromFfi(result, []);
}
@@ -85,9 +76,9 @@
///
/// Invalid levels (numbers greater than 125) will be assumed LTR
///
- /// See the [Rust documentation for `is_rtl`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_rtl) for more information.
+ /// See the [Rust documentation for `is_rtl`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/level/struct.Level.html#method.is_rtl) for more information.
static bool levelIsRtl(int level) {
- final result = _ICU4XBidi_level_is_rtl(level);
+ final result = _icu4x_Bidi_level_is_rtl_mv1(level);
return result;
}
@@ -95,99 +86,73 @@
///
/// Invalid levels (numbers greater than 125) will be assumed LTR
///
- /// See the [Rust documentation for `is_ltr`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_ltr) for more information.
+ /// See the [Rust documentation for `is_ltr`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/level/struct.Level.html#method.is_ltr) for more information.
static bool levelIsLtr(int level) {
- final result = _ICU4XBidi_level_is_ltr(level);
+ final result = _icu4x_Bidi_level_is_ltr_mv1(level);
return result;
}
/// Get a basic RTL Level value
///
- /// See the [Rust documentation for `rtl`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.rtl) for more information.
+ /// See the [Rust documentation for `rtl`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/level/struct.Level.html#method.rtl) for more information.
static int levelRtl() {
- final result = _ICU4XBidi_level_rtl();
+ final result = _icu4x_Bidi_level_rtl_mv1();
return result;
}
/// Get a simple LTR Level value
///
- /// See the [Rust documentation for `ltr`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.ltr) for more information.
+ /// See the [Rust documentation for `ltr`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/level/struct.Level.html#method.ltr) for more information.
static int levelLtr() {
- final result = _ICU4XBidi_level_ltr();
+ final result = _icu4x_Bidi_level_ltr_mv1();
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XBidi_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XBidi_destroy',
-)
+@_DiplomatFfiUse('icu4x_Bidi_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Bidi_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XBidi_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_Bidi_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XBidi_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBidi_create',
-)
+@_DiplomatFfiUse('icu4x_Bidi_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_Bidi_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XBidi_create(ffi.Pointer<ffi.Opaque> provider);
+external ffi.Pointer<ffi.Opaque> _icu4x_Bidi_create_mv1();
-@_DiplomatFfiUse('ICU4XBidi_for_text_valid_utf8')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Uint8,
- )
->(isLeaf: true, symbol: 'ICU4XBidi_for_text_valid_utf8')
+@_DiplomatFfiUse('icu4x_Bidi_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Bidi_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XBidi_for_text_valid_utf8(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> textData,
- int textLength,
- int defaultLevel,
-);
+external _ResultOpaqueInt32 _icu4x_Bidi_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XBidi_reorder_visual')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XBidi_reorder_visual')
+@_DiplomatFfiUse('icu4x_Bidi_for_text_valid_utf8_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, _ResultUint8Void)>(isLeaf: true, symbol: 'icu4x_Bidi_for_text_valid_utf8_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XBidi_reorder_visual(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> levelsData,
- int levelsLength,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_Bidi_for_text_valid_utf8_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 text, _ResultUint8Void defaultLevel);
-@_DiplomatFfiUse('ICU4XBidi_level_is_rtl')
-@ffi.Native<ffi.Bool Function(ffi.Uint8)>(
- isLeaf: true,
- symbol: 'ICU4XBidi_level_is_rtl',
-)
+@_DiplomatFfiUse('icu4x_Bidi_reorder_visual_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUint8)>(isLeaf: true, symbol: 'icu4x_Bidi_reorder_visual_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XBidi_level_is_rtl(int level);
+external ffi.Pointer<ffi.Opaque> _icu4x_Bidi_reorder_visual_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUint8 levels);
-@_DiplomatFfiUse('ICU4XBidi_level_is_ltr')
-@ffi.Native<ffi.Bool Function(ffi.Uint8)>(
- isLeaf: true,
- symbol: 'ICU4XBidi_level_is_ltr',
-)
+@_DiplomatFfiUse('icu4x_Bidi_level_is_rtl_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_Bidi_level_is_rtl_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XBidi_level_is_ltr(int level);
+external bool _icu4x_Bidi_level_is_rtl_mv1(int level);
-@_DiplomatFfiUse('ICU4XBidi_level_rtl')
-@ffi.Native<ffi.Uint8 Function()>(isLeaf: true, symbol: 'ICU4XBidi_level_rtl')
+@_DiplomatFfiUse('icu4x_Bidi_level_is_ltr_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_Bidi_level_is_ltr_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidi_level_rtl();
+external bool _icu4x_Bidi_level_is_ltr_mv1(int level);
-@_DiplomatFfiUse('ICU4XBidi_level_ltr')
-@ffi.Native<ffi.Uint8 Function()>(isLeaf: true, symbol: 'ICU4XBidi_level_ltr')
+@_DiplomatFfiUse('icu4x_Bidi_level_rtl_mv1')
+@ffi.Native<ffi.Uint8 Function()>(isLeaf: true, symbol: 'icu4x_Bidi_level_rtl_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidi_level_ltr();
+external int _icu4x_Bidi_level_rtl_mv1();
+
+@_DiplomatFfiUse('icu4x_Bidi_level_ltr_mv1')
+@ffi.Native<ffi.Uint8 Function()>(isLeaf: true, symbol: 'icu4x_Bidi_level_ltr_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Bidi_level_ltr_mv1();
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/BidiClass.g.dart b/pkgs/intl4x/lib/src/bindings/BidiClass.g.dart
new file mode 100644
index 0000000..6ab86cb
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/BidiClass.g.dart
@@ -0,0 +1,129 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `BidiClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html) for more information.
+enum BidiClass {
+ /// See the [Rust documentation for `LeftToRight`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.LeftToRight) for more information.
+ leftToRight,
+ /// See the [Rust documentation for `RightToLeft`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.RightToLeft) for more information.
+ rightToLeft,
+ /// See the [Rust documentation for `EuropeanNumber`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.EuropeanNumber) for more information.
+ europeanNumber,
+ /// See the [Rust documentation for `EuropeanSeparator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.EuropeanSeparator) for more information.
+ europeanSeparator,
+ /// See the [Rust documentation for `EuropeanTerminator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.EuropeanTerminator) for more information.
+ europeanTerminator,
+ /// See the [Rust documentation for `ArabicNumber`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.ArabicNumber) for more information.
+ arabicNumber,
+ /// See the [Rust documentation for `CommonSeparator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.CommonSeparator) for more information.
+ commonSeparator,
+ /// See the [Rust documentation for `ParagraphSeparator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.ParagraphSeparator) for more information.
+ paragraphSeparator,
+ /// See the [Rust documentation for `SegmentSeparator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.SegmentSeparator) for more information.
+ segmentSeparator,
+ /// See the [Rust documentation for `WhiteSpace`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.WhiteSpace) for more information.
+ whiteSpace,
+ /// See the [Rust documentation for `OtherNeutral`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.OtherNeutral) for more information.
+ otherNeutral,
+ /// See the [Rust documentation for `LeftToRightEmbedding`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.LeftToRightEmbedding) for more information.
+ leftToRightEmbedding,
+ /// See the [Rust documentation for `LeftToRightOverride`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.LeftToRightOverride) for more information.
+ leftToRightOverride,
+ /// See the [Rust documentation for `ArabicLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.ArabicLetter) for more information.
+ arabicLetter,
+ /// See the [Rust documentation for `RightToLeftEmbedding`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.RightToLeftEmbedding) for more information.
+ rightToLeftEmbedding,
+ /// See the [Rust documentation for `RightToLeftOverride`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.RightToLeftOverride) for more information.
+ rightToLeftOverride,
+ /// See the [Rust documentation for `PopDirectionalFormat`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.PopDirectionalFormat) for more information.
+ popDirectionalFormat,
+ /// See the [Rust documentation for `NonspacingMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.NonspacingMark) for more information.
+ nonspacingMark,
+ /// See the [Rust documentation for `BoundaryNeutral`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.BoundaryNeutral) for more information.
+ boundaryNeutral,
+ /// See the [Rust documentation for `FirstStrongIsolate`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.FirstStrongIsolate) for more information.
+ firstStrongIsolate,
+ /// See the [Rust documentation for `LeftToRightIsolate`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.LeftToRightIsolate) for more information.
+ leftToRightIsolate,
+ /// See the [Rust documentation for `RightToLeftIsolate`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.RightToLeftIsolate) for more information.
+ rightToLeftIsolate,
+ /// See the [Rust documentation for `PopDirectionalIsolate`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#associatedconstant.PopDirectionalIsolate) for more information.
+ popDirectionalIsolate;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static BidiClass forChar(Rune ch) {
+ final result = _icu4x_BidiClass_for_char_mv1(ch);
+ return BidiClass.values[result];
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_BidiClass_long_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_BidiClass_short_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_BidiClass_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html#method.from_icu4c_value) for more information.
+ static BidiClass? fromIntegerValue(int other) {
+ final result = _icu4x_BidiClass_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return BidiClass.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_BidiClass_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_BidiClass_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_BidiClass_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_BidiClass_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_BidiClass_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_BidiClass_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_BidiClass_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_BidiClass_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_BidiClass_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_BidiClass_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_BidiClass_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_BidiClass_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_BidiClass_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_BidiClass_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_BidiClass_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/BidiDirection.g.dart b/pkgs/intl4x/lib/src/bindings/BidiDirection.g.dart
index 2fae34e..bcf20b2 100644
--- a/pkgs/intl4x/lib/src/bindings/BidiDirection.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/BidiDirection.g.dart
@@ -1,5 +1,16 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-enum BidiDirection { ltr, rtl, mixed }
+enum BidiDirection {
+
+ ltr,
+
+ rtl,
+
+ mixed;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/BidiInfo.g.dart b/pkgs/intl4x/lib/src/bindings/BidiInfo.g.dart
index 2410516..f91a93d 100644
--- a/pkgs/intl4x/lib/src/bindings/BidiInfo.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/BidiInfo.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An object containing bidi information for a given string, produced by `for_text()` on `Bidi`
///
-/// See the [Rust documentation for `BidiInfo`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html) for more information.
+/// See the [Rust documentation for `BidiInfo`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/struct.BidiInfo.html) for more information.
final class BidiInfo implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,14 +25,12 @@
}
}
- @_DiplomatFfiUse('ICU4XBidiInfo_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XBidiInfo_destroy),
- );
+ @_DiplomatFfiUse('icu4x_BidiInfo_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_BidiInfo_destroy_mv1));
/// The number of paragraphs contained here
int get paragraphCount {
- final result = _ICU4XBidiInfo_paragraph_count(_ffi);
+ final result = _icu4x_BidiInfo_paragraph_count_mv1(_ffi);
return result;
}
@@ -39,67 +38,51 @@
BidiParagraph? paragraphAt(int n) {
// This lifetime edge depends on lifetimes: 'text
core.List<Object> textEdges = [this];
- final result = _ICU4XBidiInfo_paragraph_at(_ffi, n);
- return result.address == 0
- ? null
- : BidiParagraph._fromFfi(result, [], textEdges);
+ final result = _icu4x_BidiInfo_paragraph_at_mv1(_ffi, n);
+ return result.address == 0 ? null : BidiParagraph._fromFfi(result, [], textEdges);
}
/// The number of bytes in this full text
int get size {
- final result = _ICU4XBidiInfo_size(_ffi);
+ final result = _icu4x_BidiInfo_size_mv1(_ffi);
return result;
}
/// Get the BIDI level at a particular byte index in the full text.
/// This integer is conceptually a `unicode_bidi::Level`,
- /// and can be further inspected using the static methods on ICU4XBidi.
+ /// and can be further inspected using the static methods on Bidi.
///
/// Returns 0 (equivalent to `Level::ltr()`) on error
int levelAt(int pos) {
- final result = _ICU4XBidiInfo_level_at(_ffi, pos);
+ final result = _icu4x_BidiInfo_level_at_mv1(_ffi, pos);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XBidiInfo_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiInfo_destroy',
-)
+@_DiplomatFfiUse('icu4x_BidiInfo_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_BidiInfo_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XBidiInfo_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_BidiInfo_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XBidiInfo_paragraph_count')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiInfo_paragraph_count',
-)
+@_DiplomatFfiUse('icu4x_BidiInfo_paragraph_count_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_BidiInfo_paragraph_count_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiInfo_paragraph_count(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_BidiInfo_paragraph_count_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XBidiInfo_paragraph_at')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XBidiInfo_paragraph_at')
+@_DiplomatFfiUse('icu4x_BidiInfo_paragraph_at_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(isLeaf: true, symbol: 'icu4x_BidiInfo_paragraph_at_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XBidiInfo_paragraph_at(
- ffi.Pointer<ffi.Opaque> self,
- int n,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_BidiInfo_paragraph_at_mv1(ffi.Pointer<ffi.Opaque> self, int n);
-@_DiplomatFfiUse('ICU4XBidiInfo_size')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiInfo_size',
-)
+@_DiplomatFfiUse('icu4x_BidiInfo_size_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_BidiInfo_size_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiInfo_size(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_BidiInfo_size_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XBidiInfo_level_at')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XBidiInfo_level_at',
-)
+@_DiplomatFfiUse('icu4x_BidiInfo_level_at_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(isLeaf: true, symbol: 'icu4x_BidiInfo_level_at_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiInfo_level_at(ffi.Pointer<ffi.Opaque> self, int pos);
+external int _icu4x_BidiInfo_level_at_mv1(ffi.Pointer<ffi.Opaque> self, int pos);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/BidiMirroringGlyph.g.dart b/pkgs/intl4x/lib/src/bindings/BidiMirroringGlyph.g.dart
new file mode 100644
index 0000000..ac263c3
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/BidiMirroringGlyph.g.dart
@@ -0,0 +1,70 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _BidiMirroringGlyphFfi extends ffi.Struct {
+ external _ResultUint32Void mirroringGlyph;
+ @ffi.Bool()
+ external bool mirrored;
+ @ffi.Int32()
+ external int pairedBracketType;
+}
+
+/// See the [Rust documentation for `BidiMirroringGlyph`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiMirroringGlyph.html) for more information.
+final class BidiMirroringGlyph {
+ Rune? mirroringGlyph;
+ bool mirrored;
+ BidiPairedBracketType pairedBracketType;
+
+ BidiMirroringGlyph({this.mirroringGlyph, required this.mirrored, required this.pairedBracketType});
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ BidiMirroringGlyph._fromFfi(_BidiMirroringGlyphFfi ffi) :
+ mirroringGlyph = ffi.mirroringGlyph.isOk ? ffi.mirroringGlyph.union.ok : null,
+ mirrored = ffi.mirrored,
+ pairedBracketType = BidiPairedBracketType.values[ffi.pairedBracketType];
+
+ // ignore: unused_element
+ _BidiMirroringGlyphFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_BidiMirroringGlyphFfi>();
+ Rune? mirroringGlyph = this.mirroringGlyph;
+ struct.mirroringGlyph = mirroringGlyph != null ? _ResultUint32Void.ok(mirroringGlyph) : _ResultUint32Void.err();
+ struct.mirrored = mirrored;
+ struct.pairedBracketType = pairedBracketType.index;
+ return struct;
+ }
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static BidiMirroringGlyph forChar(Rune ch) {
+ final result = _icu4x_BidiMirroringGlyph_for_char_mv1(ch);
+ return BidiMirroringGlyph._fromFfi(result);
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is BidiMirroringGlyph &&
+ other.mirroringGlyph == mirroringGlyph &&
+ other.mirrored == mirrored &&
+ other.pairedBracketType == pairedBracketType;
+
+ @override
+ int get hashCode => Object.hashAll([
+ mirroringGlyph,
+ mirrored,
+ pairedBracketType,
+ ]);
+}
+
+@_DiplomatFfiUse('icu4x_BidiMirroringGlyph_for_char_mv1')
+@ffi.Native<_BidiMirroringGlyphFfi Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_BidiMirroringGlyph_for_char_mv1')
+// ignore: non_constant_identifier_names
+external _BidiMirroringGlyphFfi _icu4x_BidiMirroringGlyph_for_char_mv1(Rune ch);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/BidiPairedBracketType.g.dart b/pkgs/intl4x/lib/src/bindings/BidiPairedBracketType.g.dart
new file mode 100644
index 0000000..cc1bf39
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/BidiPairedBracketType.g.dart
@@ -0,0 +1,17 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `BidiPairedBracketType`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.BidiPairedBracketType.html) for more information.
+enum BidiPairedBracketType {
+ /// Represents Bidi_Paired_Bracket_Type=Open.
+ open,
+ /// Represents Bidi_Paired_Bracket_Type=Close.
+ close,
+ /// Represents Bidi_Paired_Bracket_Type=None.
+ none;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/BidiParagraph.g.dart b/pkgs/intl4x/lib/src/bindings/BidiParagraph.g.dart
index 31124fb..81f727d 100644
--- a/pkgs/intl4x/lib/src/bindings/BidiParagraph.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/BidiParagraph.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -22,161 +23,112 @@
}
}
- @_DiplomatFfiUse('ICU4XBidiParagraph_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XBidiParagraph_destroy),
- );
+ @_DiplomatFfiUse('icu4x_BidiParagraph_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_BidiParagraph_destroy_mv1));
/// Given a paragraph index `n` within the surrounding text, this sets this
- /// object to the paragraph at that index. Returns `Error::OutOfBoundsError` when out of bounds.
+ /// object to the paragraph at that index. Returns nothing when out of bounds.
///
/// This is equivalent to calling `paragraph_at()` on `BidiInfo` but doesn't
/// create a new object
- ///
- /// Throws [Error] on failure.
- void setParagraphInText(int n) {
- final result = _ICU4XBidiParagraph_set_paragraph_in_text(_ffi, n);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
+ bool setParagraphInText(int n) {
+ final result = _icu4x_BidiParagraph_set_paragraph_in_text_mv1(_ffi, n);
+ return result;
}
/// The primary direction of this paragraph
///
- /// See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
+ /// See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
BidiDirection get direction {
- final result = _ICU4XBidiParagraph_direction(_ffi);
+ final result = _icu4x_BidiParagraph_direction_mv1(_ffi);
return BidiDirection.values[result];
}
/// The number of bytes in this paragraph
///
- /// See the [Rust documentation for `len`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.ParagraphInfo.html#method.len) for more information.
+ /// See the [Rust documentation for `len`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/struct.ParagraphInfo.html#method.len) for more information.
int get size {
- final result = _ICU4XBidiParagraph_size(_ffi);
+ final result = _icu4x_BidiParagraph_size_mv1(_ffi);
return result;
}
/// The start index of this paragraph within the source text
int get rangeStart {
- final result = _ICU4XBidiParagraph_range_start(_ffi);
+ final result = _icu4x_BidiParagraph_range_start_mv1(_ffi);
return result;
}
/// The end index of this paragraph within the source text
int get rangeEnd {
- final result = _ICU4XBidiParagraph_range_end(_ffi);
+ final result = _icu4x_BidiParagraph_range_end_mv1(_ffi);
return result;
}
/// Reorder a line based on display order. The ranges are specified relative to the source text and must be contained
/// within this paragraph's range.
///
- /// See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
- ///
- /// Throws [Error] on failure.
- String reorderLine(int rangeStart, int rangeEnd) {
- final writeable = _Writeable();
- final result = _ICU4XBidiParagraph_reorder_line(
- _ffi,
- rangeStart,
- rangeEnd,
- writeable._ffi,
- );
+ /// See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
+ String? reorderLine(int rangeStart, int rangeEnd) {
+ final write = _Write();
+ final result = _icu4x_BidiParagraph_reorder_line_mv1(_ffi, rangeStart, rangeEnd, write._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ return null;
}
- return writeable.finalize();
+ return write.finalize();
}
/// Get the BIDI level at a particular byte index in this paragraph.
/// This integer is conceptually a `unicode_bidi::Level`,
- /// and can be further inspected using the static methods on ICU4XBidi.
+ /// and can be further inspected using the static methods on Bidi.
///
/// Returns 0 (equivalent to `Level::ltr()`) on error
///
- /// See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
+ /// See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/0.3.11/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
int levelAt(int pos) {
- final result = _ICU4XBidiParagraph_level_at(_ffi, pos);
+ final result = _icu4x_BidiParagraph_level_at_mv1(_ffi, pos);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XBidiParagraph_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiParagraph_destroy',
-)
+@_DiplomatFfiUse('icu4x_BidiParagraph_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XBidiParagraph_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_BidiParagraph_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XBidiParagraph_set_paragraph_in_text')
-@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XBidiParagraph_set_paragraph_in_text',
-)
+@_DiplomatFfiUse('icu4x_BidiParagraph_set_paragraph_in_text_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_set_paragraph_in_text_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XBidiParagraph_set_paragraph_in_text(
- ffi.Pointer<ffi.Opaque> self,
- int n,
-);
+external bool _icu4x_BidiParagraph_set_paragraph_in_text_mv1(ffi.Pointer<ffi.Opaque> self, int n);
-@_DiplomatFfiUse('ICU4XBidiParagraph_direction')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiParagraph_direction',
-)
+@_DiplomatFfiUse('icu4x_BidiParagraph_direction_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_direction_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiParagraph_direction(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_BidiParagraph_direction_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XBidiParagraph_size')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiParagraph_size',
-)
+@_DiplomatFfiUse('icu4x_BidiParagraph_size_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_size_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiParagraph_size(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_BidiParagraph_size_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XBidiParagraph_range_start')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiParagraph_range_start',
-)
+@_DiplomatFfiUse('icu4x_BidiParagraph_range_start_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_range_start_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiParagraph_range_start(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_BidiParagraph_range_start_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XBidiParagraph_range_end')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XBidiParagraph_range_end',
-)
+@_DiplomatFfiUse('icu4x_BidiParagraph_range_end_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_range_end_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiParagraph_range_end(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_BidiParagraph_range_end_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XBidiParagraph_reorder_line')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Size,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XBidiParagraph_reorder_line')
+@_DiplomatFfiUse('icu4x_BidiParagraph_reorder_line_mv1')
+@ffi.Native<_ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, ffi.Size, ffi.Size, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_reorder_line_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XBidiParagraph_reorder_line(
- ffi.Pointer<ffi.Opaque> self,
- int rangeStart,
- int rangeEnd,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultVoidVoid _icu4x_BidiParagraph_reorder_line_mv1(ffi.Pointer<ffi.Opaque> self, int rangeStart, int rangeEnd, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XBidiParagraph_level_at')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XBidiParagraph_level_at',
-)
+@_DiplomatFfiUse('icu4x_BidiParagraph_level_at_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(isLeaf: true, symbol: 'icu4x_BidiParagraph_level_at_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XBidiParagraph_level_at(
- ffi.Pointer<ffi.Opaque> self,
- int pos,
-);
+external int _icu4x_BidiParagraph_level_at_mv1(ffi.Pointer<ffi.Opaque> self, int pos);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Calendar.g.dart b/pkgs/intl4x/lib/src/bindings/Calendar.g.dart
index 8e0c633..4a9fb9e 100644
--- a/pkgs/intl4x/lib/src/bindings/Calendar.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Calendar.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `AnyCalendar`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html) for more information.
+/// See the [Rust documentation for `AnyCalendar`](https://docs.rs/icu/2.0.0/icu/calendar/enum.AnyCalendar.html) for more information.
final class Calendar implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,79 +21,58 @@
}
}
- @_DiplomatFfiUse('ICU4XCalendar_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCalendar_destroy),
- );
+ @_DiplomatFfiUse('icu4x_Calendar_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Calendar_destroy_mv1));
- /// Creates a new [`Calendar`] from the specified date and time.
+ /// Creates a new [Calendar] for the specified kind, using compiled data.
///
- /// See the [Rust documentation for `new_for_locale`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.new_for_locale) for more information.
- ///
- /// Throws [Error] on failure.
- factory Calendar.forLocale(DataProvider provider, Locale locale) {
- final result = _ICU4XCalendar_create_for_locale(provider._ffi, locale._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return Calendar._fromFfi(result.union.ok, []);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/calendar/enum.AnyCalendar.html#method.new) for more information.
+ factory Calendar(CalendarKind kind) {
+ final result = _icu4x_Calendar_create_mv1(kind._ffi);
+ return Calendar._fromFfi(result, []);
}
- /// Creates a new [`Calendar`] from the specified date and time.
+ /// Creates a new [Calendar] for the specified kind, using a particular data source.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/calendar/enum.AnyCalendar.html#method.new) for more information.
///
- /// Throws [Error] on failure.
- factory Calendar.forKind(DataProvider provider, AnyCalendarKind kind) {
- final result = _ICU4XCalendar_create_for_kind(provider._ffi, kind.index);
+ /// Throws [DataError] on failure.
+ factory Calendar.newWithProvider(DataProvider provider, CalendarKind kind) {
+ final result = _icu4x_Calendar_create_with_provider_mv1(provider._ffi, kind._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return Calendar._fromFfi(result.union.ok, []);
}
/// Returns the kind of this calendar
///
- /// See the [Rust documentation for `kind`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.kind) for more information.
- AnyCalendarKind get kind {
- final result = _ICU4XCalendar_kind(_ffi);
- return AnyCalendarKind.values[result];
+ /// See the [Rust documentation for `kind`](https://docs.rs/icu/2.0.0/icu/calendar/enum.AnyCalendar.html#method.kind) for more information.
+ CalendarKind get kind {
+ final result = _icu4x_Calendar_kind_mv1(_ffi);
+ return CalendarKind.values.firstWhere((v) => v._ffi == result);
}
+
}
-@_DiplomatFfiUse('ICU4XCalendar_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCalendar_destroy',
-)
+@_DiplomatFfiUse('icu4x_Calendar_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Calendar_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCalendar_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_Calendar_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCalendar_create_for_locale')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCalendar_create_for_locale')
+@_DiplomatFfiUse('icu4x_Calendar_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Calendar_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCalendar_create_for_locale(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_Calendar_create_mv1(int kind);
-@_DiplomatFfiUse('ICU4XCalendar_create_for_kind')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XCalendar_create_for_kind',
-)
+@_DiplomatFfiUse('icu4x_Calendar_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Calendar_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCalendar_create_for_kind(
- ffi.Pointer<ffi.Opaque> provider,
- int kind,
-);
+external _ResultOpaqueInt32 _icu4x_Calendar_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, int kind);
-@_DiplomatFfiUse('ICU4XCalendar_kind')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCalendar_kind',
-)
+@_DiplomatFfiUse('icu4x_Calendar_kind_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Calendar_kind_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XCalendar_kind(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_Calendar_kind_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CalendarError.g.dart b/pkgs/intl4x/lib/src/bindings/CalendarError.g.dart
new file mode 100644
index 0000000..56179fb
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/CalendarError.g.dart
@@ -0,0 +1,19 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/icu/2.0.0/icu/calendar/struct.RangeError.html), [2](https://docs.rs/icu/2.0.0/icu/calendar/enum.DateError.html)
+enum CalendarError {
+
+ unknown,
+
+ outOfRange,
+
+ unknownEra,
+
+ unknownMonthCode;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CalendarKind.g.dart b/pkgs/intl4x/lib/src/bindings/CalendarKind.g.dart
new file mode 100644
index 0000000..6f83631
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/CalendarKind.g.dart
@@ -0,0 +1,103 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// The various calendar types currently supported by [Calendar]
+///
+/// See the [Rust documentation for `AnyCalendarKind`](https://docs.rs/icu/2.0.0/icu/calendar/enum.AnyCalendarKind.html) for more information.
+enum CalendarKind {
+ /// The kind of an Iso calendar
+ iso,
+ /// The kind of a Gregorian calendar
+ gregorian,
+ /// The kind of a Buddhist calendar
+ buddhist,
+ /// The kind of a Japanese calendar with modern eras
+ japanese,
+ /// The kind of a Japanese calendar with modern and historic eras
+ japaneseExtended,
+ /// The kind of an Ethiopian calendar, with Amete Mihret era
+ ethiopian,
+ /// The kind of an Ethiopian calendar, with Amete Alem era
+ ethiopianAmeteAlem,
+ /// The kind of a Indian calendar
+ indian,
+ /// The kind of a Coptic calendar
+ coptic,
+ /// The kind of a Dangi calendar
+ dangi,
+ /// The kind of a Chinese calendar
+ chinese,
+ /// The kind of a Hebrew calendar
+ hebrew,
+ /// The kind of a Hijri tabular, type II leap years, Friday epoch, calendar
+ hijriTabularTypeIiFriday,
+ /// The kind of a Hijri simulated, Mecca calendar
+ hijriSimulatedMecca,
+ /// The kind of a Hijri tabular, type II leap years, Thursday epoch, calendar
+ hijriTabularTypeIiThursday,
+ /// The kind of a Hijri Umm al-Qura calendar
+ hijriUmmAlQura,
+ /// The kind of a Persian calendar
+ persian,
+ /// The kind of a Roc calendar
+ roc;
+
+ int get _ffi {
+ switch (this) {
+ case iso:
+ return 0;
+ case gregorian:
+ return 1;
+ case buddhist:
+ return 2;
+ case japanese:
+ return 3;
+ case japaneseExtended:
+ return 4;
+ case ethiopian:
+ return 5;
+ case ethiopianAmeteAlem:
+ return 6;
+ case indian:
+ return 7;
+ case coptic:
+ return 8;
+ case dangi:
+ return 9;
+ case chinese:
+ return 10;
+ case hebrew:
+ return 11;
+ case hijriTabularTypeIiFriday:
+ return 12;
+ case hijriSimulatedMecca:
+ return 18;
+ case hijriTabularTypeIiThursday:
+ return 14;
+ case hijriUmmAlQura:
+ return 15;
+ case persian:
+ return 16;
+ case roc:
+ return 17;
+ }
+ }
+
+ /// Creates a new [CalendarKind] for the specified locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/calendar/enum.AnyCalendarKind.html#method.new) for more information.
+ static CalendarKind create(Locale locale) {
+ final result = _icu4x_CalendarKind_create_mv1(locale._ffi);
+ return CalendarKind.values.firstWhere((v) => v._ffi == result);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_CalendarKind_create_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CalendarKind_create_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_CalendarKind_create_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CanonicalCombiningClass.g.dart b/pkgs/intl4x/lib/src/bindings/CanonicalCombiningClass.g.dart
new file mode 100644
index 0000000..2e01d7d
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/CanonicalCombiningClass.g.dart
@@ -0,0 +1,288 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `CanonicalCombiningClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html) for more information.
+enum CanonicalCombiningClass {
+ /// See the [Rust documentation for `NotReordered`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.NotReordered) for more information.
+ notReordered,
+ /// See the [Rust documentation for `Overlay`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.Overlay) for more information.
+ overlay,
+ /// See the [Rust documentation for `HanReading`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.HanReading) for more information.
+ hanReading,
+ /// See the [Rust documentation for `Nukta`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.Nukta) for more information.
+ nukta,
+ /// See the [Rust documentation for `KanaVoicing`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.KanaVoicing) for more information.
+ kanaVoicing,
+ /// See the [Rust documentation for `Virama`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.Virama) for more information.
+ virama,
+ /// See the [Rust documentation for `CCC10`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC10) for more information.
+ ccc10,
+ /// See the [Rust documentation for `CCC11`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC11) for more information.
+ ccc11,
+ /// See the [Rust documentation for `CCC12`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC12) for more information.
+ ccc12,
+ /// See the [Rust documentation for `CCC13`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC13) for more information.
+ ccc13,
+ /// See the [Rust documentation for `CCC14`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC14) for more information.
+ ccc14,
+ /// See the [Rust documentation for `CCC15`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC15) for more information.
+ ccc15,
+ /// See the [Rust documentation for `CCC16`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC16) for more information.
+ ccc16,
+ /// See the [Rust documentation for `CCC17`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC17) for more information.
+ ccc17,
+ /// See the [Rust documentation for `CCC18`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC18) for more information.
+ ccc18,
+ /// See the [Rust documentation for `CCC19`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC19) for more information.
+ ccc19,
+ /// See the [Rust documentation for `CCC20`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC20) for more information.
+ ccc20,
+ /// See the [Rust documentation for `CCC21`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC21) for more information.
+ ccc21,
+ /// See the [Rust documentation for `CCC22`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC22) for more information.
+ ccc22,
+ /// See the [Rust documentation for `CCC23`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC23) for more information.
+ ccc23,
+ /// See the [Rust documentation for `CCC24`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC24) for more information.
+ ccc24,
+ /// See the [Rust documentation for `CCC25`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC25) for more information.
+ ccc25,
+ /// See the [Rust documentation for `CCC26`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC26) for more information.
+ ccc26,
+ /// See the [Rust documentation for `CCC27`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC27) for more information.
+ ccc27,
+ /// See the [Rust documentation for `CCC28`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC28) for more information.
+ ccc28,
+ /// See the [Rust documentation for `CCC29`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC29) for more information.
+ ccc29,
+ /// See the [Rust documentation for `CCC30`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC30) for more information.
+ ccc30,
+ /// See the [Rust documentation for `CCC31`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC31) for more information.
+ ccc31,
+ /// See the [Rust documentation for `CCC32`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC32) for more information.
+ ccc32,
+ /// See the [Rust documentation for `CCC33`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC33) for more information.
+ ccc33,
+ /// See the [Rust documentation for `CCC34`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC34) for more information.
+ ccc34,
+ /// See the [Rust documentation for `CCC35`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC35) for more information.
+ ccc35,
+ /// See the [Rust documentation for `CCC36`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC36) for more information.
+ ccc36,
+ /// See the [Rust documentation for `CCC84`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC84) for more information.
+ ccc84,
+ /// See the [Rust documentation for `CCC91`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC91) for more information.
+ ccc91,
+ /// See the [Rust documentation for `CCC103`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC103) for more information.
+ ccc103,
+ /// See the [Rust documentation for `CCC107`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC107) for more information.
+ ccc107,
+ /// See the [Rust documentation for `CCC118`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC118) for more information.
+ ccc118,
+ /// See the [Rust documentation for `CCC122`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC122) for more information.
+ ccc122,
+ /// See the [Rust documentation for `CCC129`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC129) for more information.
+ ccc129,
+ /// See the [Rust documentation for `CCC130`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC130) for more information.
+ ccc130,
+ /// See the [Rust documentation for `CCC132`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC132) for more information.
+ ccc132,
+ /// See the [Rust documentation for `CCC133`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.CCC133) for more information.
+ ccc133,
+ /// See the [Rust documentation for `AttachedBelowLeft`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.AttachedBelowLeft) for more information.
+ attachedBelowLeft,
+ /// See the [Rust documentation for `AttachedBelow`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.AttachedBelow) for more information.
+ attachedBelow,
+ /// See the [Rust documentation for `AttachedAbove`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.AttachedAbove) for more information.
+ attachedAbove,
+ /// See the [Rust documentation for `AttachedAboveRight`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.AttachedAboveRight) for more information.
+ attachedAboveRight,
+ /// See the [Rust documentation for `BelowLeft`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.BelowLeft) for more information.
+ belowLeft,
+ /// See the [Rust documentation for `Below`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.Below) for more information.
+ below,
+ /// See the [Rust documentation for `BelowRight`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.BelowRight) for more information.
+ belowRight,
+ /// See the [Rust documentation for `Left`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.Left) for more information.
+ left,
+ /// See the [Rust documentation for `Right`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.Right) for more information.
+ right,
+ /// See the [Rust documentation for `AboveLeft`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.AboveLeft) for more information.
+ aboveLeft,
+ /// See the [Rust documentation for `Above`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.Above) for more information.
+ above,
+ /// See the [Rust documentation for `AboveRight`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.AboveRight) for more information.
+ aboveRight,
+ /// See the [Rust documentation for `DoubleBelow`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.DoubleBelow) for more information.
+ doubleBelow,
+ /// See the [Rust documentation for `DoubleAbove`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.DoubleAbove) for more information.
+ doubleAbove,
+ /// See the [Rust documentation for `IotaSubscript`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#associatedconstant.IotaSubscript) for more information.
+ iotaSubscript;
+
+ int get _ffi {
+ switch (this) {
+ case notReordered:
+ return 0;
+ case overlay:
+ return 1;
+ case hanReading:
+ return 6;
+ case nukta:
+ return 7;
+ case kanaVoicing:
+ return 8;
+ case virama:
+ return 9;
+ case ccc10:
+ return 10;
+ case ccc11:
+ return 11;
+ case ccc12:
+ return 12;
+ case ccc13:
+ return 13;
+ case ccc14:
+ return 14;
+ case ccc15:
+ return 15;
+ case ccc16:
+ return 16;
+ case ccc17:
+ return 17;
+ case ccc18:
+ return 18;
+ case ccc19:
+ return 19;
+ case ccc20:
+ return 20;
+ case ccc21:
+ return 21;
+ case ccc22:
+ return 22;
+ case ccc23:
+ return 23;
+ case ccc24:
+ return 24;
+ case ccc25:
+ return 25;
+ case ccc26:
+ return 26;
+ case ccc27:
+ return 27;
+ case ccc28:
+ return 28;
+ case ccc29:
+ return 29;
+ case ccc30:
+ return 30;
+ case ccc31:
+ return 31;
+ case ccc32:
+ return 32;
+ case ccc33:
+ return 33;
+ case ccc34:
+ return 34;
+ case ccc35:
+ return 35;
+ case ccc36:
+ return 36;
+ case ccc84:
+ return 84;
+ case ccc91:
+ return 91;
+ case ccc103:
+ return 103;
+ case ccc107:
+ return 107;
+ case ccc118:
+ return 118;
+ case ccc122:
+ return 122;
+ case ccc129:
+ return 129;
+ case ccc130:
+ return 130;
+ case ccc132:
+ return 132;
+ case ccc133:
+ return 133;
+ case attachedBelowLeft:
+ return 200;
+ case attachedBelow:
+ return 202;
+ case attachedAbove:
+ return 214;
+ case attachedAboveRight:
+ return 216;
+ case belowLeft:
+ return 218;
+ case below:
+ return 220;
+ case belowRight:
+ return 222;
+ case left:
+ return 224;
+ case right:
+ return 226;
+ case aboveLeft:
+ return 228;
+ case above:
+ return 230;
+ case aboveRight:
+ return 232;
+ case doubleBelow:
+ return 233;
+ case doubleAbove:
+ return 234;
+ case iotaSubscript:
+ return 240;
+ }
+ }
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static CanonicalCombiningClass forChar(Rune ch) {
+ final result = _icu4x_CanonicalCombiningClass_for_char_mv1(ch);
+ return CanonicalCombiningClass.values.firstWhere((v) => v._ffi == result);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_CanonicalCombiningClass_to_integer_value_mv1(_ffi);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html#method.from_icu4c_value) for more information.
+ static CanonicalCombiningClass? fromIntegerValue(int other) {
+ final result = _icu4x_CanonicalCombiningClass_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return CanonicalCombiningClass.values.firstWhere((v) => v._ffi == result.union.ok);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_CanonicalCombiningClass_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClass_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_CanonicalCombiningClass_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CanonicalCombiningClass_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClass_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_CanonicalCombiningClass_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_CanonicalCombiningClass_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClass_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_CanonicalCombiningClass_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CanonicalCombiningClassMap.g.dart b/pkgs/intl4x/lib/src/bindings/CanonicalCombiningClassMap.g.dart
index 5f98476..bf3e4d3 100644
--- a/pkgs/intl4x/lib/src/bindings/CanonicalCombiningClassMap.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CanonicalCombiningClassMap.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// Lookup of the Canonical_Combining_Class Unicode property
///
-/// See the [Rust documentation for `CanonicalCombiningClassMap`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html) for more information.
+/// See the [Rust documentation for `CanonicalCombiningClassMap`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html) for more information.
final class CanonicalCombiningClassMap implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,60 +23,58 @@
}
}
- @_DiplomatFfiUse('ICU4XCanonicalCombiningClassMap_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCanonicalCombiningClassMap_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CanonicalCombiningClassMap_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CanonicalCombiningClassMap_destroy_mv1));
- /// Construct a new ICU4XCanonicalCombiningClassMap instance for NFC
+ /// Construct a new CanonicalCombiningClassMap instance for NFC using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.new) for more information.
+ factory CanonicalCombiningClassMap() {
+ final result = _icu4x_CanonicalCombiningClassMap_create_mv1();
+ return CanonicalCombiningClassMap._fromFfi(result, []);
+ }
+
+ /// Construct a new CanonicalCombiningClassMap instance for NFC using a particular data source.
///
- /// Throws [Error] on failure.
- factory CanonicalCombiningClassMap(DataProvider provider) {
- final result = _ICU4XCanonicalCombiningClassMap_create(provider._ffi);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CanonicalCombiningClassMap.withProvider(DataProvider provider) {
+ final result = _icu4x_CanonicalCombiningClassMap_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CanonicalCombiningClassMap._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.get) for more information.
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalCombiningClassMapBorrowed.html#method.get) for more information.
///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/properties/properties/struct.CanonicalCombiningClass.html)
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html)
int operator [](Rune ch) {
- final result = _ICU4XCanonicalCombiningClassMap_get(_ffi, ch);
+ final result = _icu4x_CanonicalCombiningClassMap_get_mv1(_ffi, ch);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XCanonicalCombiningClassMap_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalCombiningClassMap_destroy',
-)
+@_DiplomatFfiUse('icu4x_CanonicalCombiningClassMap_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClassMap_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCanonicalCombiningClassMap_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_CanonicalCombiningClassMap_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCanonicalCombiningClassMap_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalCombiningClassMap_create',
-)
+@_DiplomatFfiUse('icu4x_CanonicalCombiningClassMap_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClassMap_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCanonicalCombiningClassMap_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CanonicalCombiningClassMap_create_mv1();
-@_DiplomatFfiUse('ICU4XCanonicalCombiningClassMap_get')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalCombiningClassMap_get',
-)
+@_DiplomatFfiUse('icu4x_CanonicalCombiningClassMap_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClassMap_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XCanonicalCombiningClassMap_get(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external _ResultOpaqueInt32 _icu4x_CanonicalCombiningClassMap_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CanonicalCombiningClassMap_get_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClassMap_get_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_CanonicalCombiningClassMap_get_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CanonicalComposition.g.dart b/pkgs/intl4x/lib/src/bindings/CanonicalComposition.g.dart
index da16432..c6b1312 100644
--- a/pkgs/intl4x/lib/src/bindings/CanonicalComposition.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CanonicalComposition.g.dart
@@ -1,12 +1,13 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// The raw canonical composition operation.
///
-/// Callers should generally use ICU4XComposingNormalizer unless they specifically need raw composition operations
+/// Callers should generally use ComposingNormalizer unless they specifically need raw composition operations
///
-/// See the [Rust documentation for `CanonicalComposition`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html) for more information.
+/// See the [Rust documentation for `CanonicalComposition`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalComposition.html) for more information.
final class CanonicalComposition implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,20 +25,26 @@
}
}
- @_DiplomatFfiUse('ICU4XCanonicalComposition_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCanonicalComposition_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CanonicalComposition_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CanonicalComposition_destroy_mv1));
- /// Construct a new ICU4XCanonicalComposition instance for NFC
+ /// Construct a new CanonicalComposition instance for NFC using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalComposition.html#method.new) for more information.
+ factory CanonicalComposition() {
+ final result = _icu4x_CanonicalComposition_create_mv1();
+ return CanonicalComposition._fromFfi(result, []);
+ }
+
+ /// Construct a new CanonicalComposition instance for NFC using a particular data source.
///
- /// Throws [Error] on failure.
- factory CanonicalComposition(DataProvider provider) {
- final result = _ICU4XCanonicalComposition_create(provider._ffi);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalComposition.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CanonicalComposition.withProvider(DataProvider provider) {
+ final result = _icu4x_CanonicalComposition_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CanonicalComposition._fromFfi(result.union.ok, []);
}
@@ -45,38 +52,32 @@
/// Performs canonical composition (including Hangul) on a pair of characters
/// or returns NUL if these characters don’t compose. Composition exclusions are taken into account.
///
- /// See the [Rust documentation for `compose`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html#method.compose) for more information.
+ /// See the [Rust documentation for `compose`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalCompositionBorrowed.html#method.compose) for more information.
Rune compose(Rune starter, Rune second) {
- final result = _ICU4XCanonicalComposition_compose(_ffi, starter, second);
+ final result = _icu4x_CanonicalComposition_compose_mv1(_ffi, starter, second);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XCanonicalComposition_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalComposition_destroy',
-)
+@_DiplomatFfiUse('icu4x_CanonicalComposition_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CanonicalComposition_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCanonicalComposition_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CanonicalComposition_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCanonicalComposition_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalComposition_create',
-)
+@_DiplomatFfiUse('icu4x_CanonicalComposition_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CanonicalComposition_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCanonicalComposition_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CanonicalComposition_create_mv1();
-@_DiplomatFfiUse('ICU4XCanonicalComposition_compose')
-@ffi.Native<
- ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)
->(isLeaf: true, symbol: 'ICU4XCanonicalComposition_compose')
+@_DiplomatFfiUse('icu4x_CanonicalComposition_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CanonicalComposition_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external Rune _ICU4XCanonicalComposition_compose(
- ffi.Pointer<ffi.Opaque> self,
- Rune starter,
- Rune second,
-);
+external _ResultOpaqueInt32 _icu4x_CanonicalComposition_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CanonicalComposition_compose_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CanonicalComposition_compose_mv1')
+// ignore: non_constant_identifier_names
+external Rune _icu4x_CanonicalComposition_compose_mv1(ffi.Pointer<ffi.Opaque> self, Rune starter, Rune second);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CanonicalDecomposition.g.dart b/pkgs/intl4x/lib/src/bindings/CanonicalDecomposition.g.dart
index 7c25ab0..04189f8 100644
--- a/pkgs/intl4x/lib/src/bindings/CanonicalDecomposition.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CanonicalDecomposition.g.dart
@@ -1,12 +1,13 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// The raw (non-recursive) canonical decomposition operation.
///
-/// Callers should generally use ICU4XDecomposingNormalizer unless they specifically need raw composition operations
+/// Callers should generally use DecomposingNormalizer unless they specifically need raw composition operations
///
-/// See the [Rust documentation for `CanonicalDecomposition`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html) for more information.
+/// See the [Rust documentation for `CanonicalDecomposition`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalDecomposition.html) for more information.
final class CanonicalDecomposition implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,58 +25,58 @@
}
}
- @_DiplomatFfiUse('ICU4XCanonicalDecomposition_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCanonicalDecomposition_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CanonicalDecomposition_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CanonicalDecomposition_destroy_mv1));
- /// Construct a new ICU4XCanonicalDecomposition instance for NFC
+ /// Construct a new CanonicalDecomposition instance for NFC using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.new) for more information.
+ factory CanonicalDecomposition() {
+ final result = _icu4x_CanonicalDecomposition_create_mv1();
+ return CanonicalDecomposition._fromFfi(result, []);
+ }
+
+ /// Construct a new CanonicalDecomposition instance for NFC using a particular data source.
///
- /// Throws [Error] on failure.
- factory CanonicalDecomposition(DataProvider provider) {
- final result = _ICU4XCanonicalDecomposition_create(provider._ffi);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CanonicalDecomposition.withProvider(DataProvider provider) {
+ final result = _icu4x_CanonicalDecomposition_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CanonicalDecomposition._fromFfi(result.union.ok, []);
}
/// Performs non-recursive canonical decomposition (including for Hangul).
///
- /// See the [Rust documentation for `decompose`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.decompose) for more information.
+ /// See the [Rust documentation for `decompose`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/struct.CanonicalDecompositionBorrowed.html#method.decompose) for more information.
Decomposed decompose(Rune c) {
- final result = _ICU4XCanonicalDecomposition_decompose(_ffi, c);
+ final result = _icu4x_CanonicalDecomposition_decompose_mv1(_ffi, c);
return Decomposed._fromFfi(result);
}
+
}
-@_DiplomatFfiUse('ICU4XCanonicalDecomposition_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalDecomposition_destroy',
-)
+@_DiplomatFfiUse('icu4x_CanonicalDecomposition_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CanonicalDecomposition_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCanonicalDecomposition_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CanonicalDecomposition_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCanonicalDecomposition_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalDecomposition_create',
-)
+@_DiplomatFfiUse('icu4x_CanonicalDecomposition_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CanonicalDecomposition_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCanonicalDecomposition_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CanonicalDecomposition_create_mv1();
-@_DiplomatFfiUse('ICU4XCanonicalDecomposition_decompose')
-@ffi.Native<_DecomposedFfi Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCanonicalDecomposition_decompose',
-)
+@_DiplomatFfiUse('icu4x_CanonicalDecomposition_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CanonicalDecomposition_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _DecomposedFfi _ICU4XCanonicalDecomposition_decompose(
- ffi.Pointer<ffi.Opaque> self,
- Rune c,
-);
+external _ResultOpaqueInt32 _icu4x_CanonicalDecomposition_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CanonicalDecomposition_decompose_mv1')
+@ffi.Native<_DecomposedFfi Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CanonicalDecomposition_decompose_mv1')
+// ignore: non_constant_identifier_names
+external _DecomposedFfi _icu4x_CanonicalDecomposition_decompose_mv1(ffi.Pointer<ffi.Opaque> self, Rune c);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CaseMapCloser.g.dart b/pkgs/intl4x/lib/src/bindings/CaseMapCloser.g.dart
index fa13c01..9bb1324 100644
--- a/pkgs/intl4x/lib/src/bindings/CaseMapCloser.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CaseMapCloser.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `CaseMapCloser`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloser.html) for more information.
+/// See the [Rust documentation for `CaseMapCloser`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapCloser.html) for more information.
final class CaseMapCloser implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,20 +21,31 @@
}
}
- @_DiplomatFfiUse('ICU4XCaseMapCloser_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCaseMapCloser_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CaseMapCloser_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CaseMapCloser_destroy_mv1));
- /// Construct a new ICU4XCaseMapper instance
+ /// Construct a new CaseMapCloser instance using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloser.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapCloser.html#method.new) for more information.
///
- /// Throws [Error] on failure.
- factory CaseMapCloser(DataProvider provider) {
- final result = _ICU4XCaseMapCloser_create(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CaseMapCloser() {
+ final result = _icu4x_CaseMapCloser_create_mv1();
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return CaseMapCloser._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct a new CaseMapCloser instance using a particular data source.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapCloser.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CaseMapCloser.withProvider(DataProvider provider) {
+ final result = _icu4x_CaseMapCloser_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return CaseMapCloser._fromFfi(result.union.ok, []);
}
@@ -41,9 +53,9 @@
/// Adds all simple case mappings and the full case folding for `c` to `builder`.
/// Also adds special case closure mappings.
///
- /// See the [Rust documentation for `add_case_closure_to`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloser.html#method.add_case_closure_to) for more information.
+ /// See the [Rust documentation for `add_case_closure_to`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapCloserBorrowed.html#method.add_case_closure_to) for more information.
void addCaseClosureTo(Rune c, CodePointSetBuilder builder) {
- _ICU4XCaseMapCloser_add_case_closure_to(_ffi, c, builder._ffi);
+ _icu4x_CaseMapCloser_add_case_closure_to_mv1(_ffi, c, builder._ffi);
}
/// Finds all characters and strings which may casemap to `s` as their full case folding string
@@ -51,67 +63,38 @@
///
/// Returns true if the string was found
///
- /// See the [Rust documentation for `add_string_case_closure_to`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloser.html#method.add_string_case_closure_to) for more information.
+ /// See the [Rust documentation for `add_string_case_closure_to`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapCloserBorrowed.html#method.add_string_case_closure_to) for more information.
bool addStringCaseClosureTo(String s, CodePointSetBuilder builder) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XCaseMapCloser_add_string_case_closure_to(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- builder._ffi,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_CaseMapCloser_add_string_case_closure_to_mv1(_ffi, s._utf8AllocIn(temp.arena), builder._ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XCaseMapCloser_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapCloser_destroy',
-)
+@_DiplomatFfiUse('icu4x_CaseMapCloser_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CaseMapCloser_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCaseMapCloser_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CaseMapCloser_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCaseMapCloser_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapCloser_create',
-)
+@_DiplomatFfiUse('icu4x_CaseMapCloser_create_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function()>(isLeaf: true, symbol: 'icu4x_CaseMapCloser_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCaseMapCloser_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CaseMapCloser_create_mv1();
-@_DiplomatFfiUse('ICU4XCaseMapCloser_add_case_closure_to')
-@ffi.Native<
- ffi.Void Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Uint32,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCaseMapCloser_add_case_closure_to')
+@_DiplomatFfiUse('icu4x_CaseMapCloser_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapCloser_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCaseMapCloser_add_case_closure_to(
- ffi.Pointer<ffi.Opaque> self,
- Rune c,
- ffi.Pointer<ffi.Opaque> builder,
-);
+external _ResultOpaqueInt32 _icu4x_CaseMapCloser_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCaseMapCloser_add_string_case_closure_to')
-@ffi.Native<
- ffi.Bool Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCaseMapCloser_add_string_case_closure_to')
+@_DiplomatFfiUse('icu4x_CaseMapCloser_add_case_closure_to_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapCloser_add_case_closure_to_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XCaseMapCloser_add_string_case_closure_to(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> builder,
-);
+external void _icu4x_CaseMapCloser_add_case_closure_to_mv1(ffi.Pointer<ffi.Opaque> self, Rune c, ffi.Pointer<ffi.Opaque> builder);
+
+@_DiplomatFfiUse('icu4x_CaseMapCloser_add_string_case_closure_to_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapCloser_add_string_case_closure_to_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CaseMapCloser_add_string_case_closure_to_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> builder);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CaseMapper.g.dart b/pkgs/intl4x/lib/src/bindings/CaseMapper.g.dart
index ef5ba6b..b5d1f77 100644
--- a/pkgs/intl4x/lib/src/bindings/CaseMapper.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CaseMapper.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `CaseMapper`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html) for more information.
+/// See the [Rust documentation for `CaseMapper`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapper.html) for more information.
final class CaseMapper implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,68 +21,68 @@
}
}
- @_DiplomatFfiUse('ICU4XCaseMapper_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCaseMapper_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CaseMapper_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CaseMapper_destroy_mv1));
- /// Construct a new ICU4XCaseMapper instance
+ /// Construct a new CaseMapper instance using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapper.html#method.new) for more information.
+ factory CaseMapper() {
+ final result = _icu4x_CaseMapper_create_mv1();
+ return CaseMapper._fromFfi(result, []);
+ }
+
+ /// Construct a new CaseMapper instance using a particular data source.
///
- /// Throws [Error] on failure.
- factory CaseMapper(DataProvider provider) {
- final result = _ICU4XCaseMapper_create(provider._ffi);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapper.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CaseMapper.withProvider(DataProvider provider) {
+ final result = _icu4x_CaseMapper_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CaseMapper._fromFfi(result.union.ok, []);
}
/// Returns the full lowercase mapping of the given string
///
- /// See the [Rust documentation for `lowercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.lowercase) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `lowercase`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.lowercase) for more information.
String lowercase(String s, Locale locale) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XCaseMapper_lowercase(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- locale._ffi,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_CaseMapper_lowercase_mv1(_ffi, s._utf8AllocIn(temp.arena), locale._ffi, write._ffi);
+ return write.finalize();
}
/// Returns the full uppercase mapping of the given string
///
- /// See the [Rust documentation for `uppercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.uppercase) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `uppercase`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.uppercase) for more information.
String uppercase(String s, Locale locale) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XCaseMapper_uppercase(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- locale._ffi,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_CaseMapper_uppercase_mv1(_ffi, s._utf8AllocIn(temp.arena), locale._ffi, write._ffi);
+ return write.finalize();
+ }
+
+ /// Returns the full lowercase mapping of the given string, using compiled data (avoids having to allocate a CaseMapper object)
+ ///
+ /// See the [Rust documentation for `lowercase`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.lowercase) for more information.
+ static String lowercaseWithCompiledData(String s, Locale locale) {
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_CaseMapper_lowercase_with_compiled_data_mv1(s._utf8AllocIn(temp.arena), locale._ffi, write._ffi);
+ return write.finalize();
+ }
+
+ /// Returns the full uppercase mapping of the given string, using compiled data (avoids having to allocate a CaseMapper object)
+ ///
+ /// See the [Rust documentation for `uppercase`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.uppercase) for more information.
+ static String uppercaseWithCompiledData(String s, Locale locale) {
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_CaseMapper_uppercase_with_compiled_data_mv1(s._utf8AllocIn(temp.arena), locale._ffi, write._ffi);
+ return write.finalize();
}
/// Returns the full titlecase mapping of the given string, performing head adjustment without
@@ -90,75 +91,33 @@
///
/// The `v1` refers to the version of the options struct, which may change as we add more options
///
- /// See the [Rust documentation for `titlecase_segment_with_only_case_data`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.titlecase_segment_with_only_case_data) for more information.
- ///
- /// Throws [Error] on failure.
- String titlecaseSegmentWithOnlyCaseData(
- String s,
- Locale locale,
- TitlecaseOptions options,
- ) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- locale._ffi,
- options._toFfi(temp),
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ /// See the [Rust documentation for `titlecase_segment_with_only_case_data`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.titlecase_segment_with_only_case_data) for more information.
+ String titlecaseSegmentWithOnlyCaseData(String s, Locale locale, TitlecaseOptions options) {
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_CaseMapper_titlecase_segment_with_only_case_data_v1_mv1(_ffi, s._utf8AllocIn(temp.arena), locale._ffi, options._toFfi(temp.arena), write._ffi);
+ return write.finalize();
}
/// Case-folds the characters in the given string
///
- /// See the [Rust documentation for `fold`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.fold) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `fold`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.fold) for more information.
String fold(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XCaseMapper_fold(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_CaseMapper_fold_mv1(_ffi, s._utf8AllocIn(temp.arena), write._ffi);
+ return write.finalize();
}
/// Case-folds the characters in the given string
/// using Turkic (T) mappings for dotted/dotless I.
///
- /// See the [Rust documentation for `fold_turkic`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.fold_turkic) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `fold_turkic`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.fold_turkic) for more information.
String foldTurkic(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XCaseMapper_fold_turkic(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_CaseMapper_fold_turkic_mv1(_ffi, s._utf8AllocIn(temp.arena), write._ffi);
+ return write.finalize();
}
/// Adds all simple case mappings and the full case folding for `c` to `builder`.
@@ -167,26 +126,26 @@
/// In other words, this adds all characters that this casemaps to, as
/// well as all characters that may casemap to this one.
///
- /// Note that since ICU4XCodePointSetBuilder does not contain strings, this will
+ /// Note that since CodePointSetBuilder does not contain strings, this will
/// ignore string mappings.
///
/// Identical to the similarly named method on `CaseMapCloser`, use that if you
/// plan on using string case closure mappings too.
///
- /// See the [Rust documentation for `add_case_closure_to`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.add_case_closure_to) for more information.
+ /// See the [Rust documentation for `add_case_closure_to`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.add_case_closure_to) for more information.
void addCaseClosureTo(Rune c, CodePointSetBuilder builder) {
- _ICU4XCaseMapper_add_case_closure_to(_ffi, c, builder._ffi);
+ _icu4x_CaseMapper_add_case_closure_to_mv1(_ffi, c, builder._ffi);
}
/// Returns the simple lowercase mapping of the given character.
///
/// This function only implements simple and common mappings.
/// Full mappings, which can map one char to a string, are not included.
- /// For full mappings, use `CaseMapper::lowercase`.
+ /// For full mappings, use `CaseMapperBorrowed::lowercase`.
///
- /// See the [Rust documentation for `simple_lowercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_lowercase) for more information.
+ /// See the [Rust documentation for `simple_lowercase`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_lowercase) for more information.
Rune simpleLowercase(Rune ch) {
- final result = _ICU4XCaseMapper_simple_lowercase(_ffi, ch);
+ final result = _icu4x_CaseMapper_simple_lowercase_mv1(_ffi, ch);
return result;
}
@@ -194,11 +153,11 @@
///
/// This function only implements simple and common mappings.
/// Full mappings, which can map one char to a string, are not included.
- /// For full mappings, use `CaseMapper::uppercase`.
+ /// For full mappings, use `CaseMapperBorrowed::uppercase`.
///
- /// See the [Rust documentation for `simple_uppercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_uppercase) for more information.
+ /// See the [Rust documentation for `simple_uppercase`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_uppercase) for more information.
Rune simpleUppercase(Rune ch) {
- final result = _ICU4XCaseMapper_simple_uppercase(_ffi, ch);
+ final result = _icu4x_CaseMapper_simple_uppercase_mv1(_ffi, ch);
return result;
}
@@ -206,218 +165,116 @@
///
/// This function only implements simple and common mappings.
/// Full mappings, which can map one char to a string, are not included.
- /// For full mappings, use `CaseMapper::titlecase_segment`.
+ /// For full mappings, use `CaseMapperBorrowed::titlecase_segment`.
///
- /// See the [Rust documentation for `simple_titlecase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_titlecase) for more information.
+ /// See the [Rust documentation for `simple_titlecase`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_titlecase) for more information.
Rune simpleTitlecase(Rune ch) {
- final result = _ICU4XCaseMapper_simple_titlecase(_ffi, ch);
+ final result = _icu4x_CaseMapper_simple_titlecase_mv1(_ffi, ch);
return result;
}
/// Returns the simple casefolding of the given character.
///
/// This function only implements simple folding.
- /// For full folding, use `CaseMapper::fold`.
+ /// For full folding, use `CaseMapperBorrowed::fold`.
///
- /// See the [Rust documentation for `simple_fold`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_fold) for more information.
+ /// See the [Rust documentation for `simple_fold`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_fold) for more information.
Rune simpleFold(Rune ch) {
- final result = _ICU4XCaseMapper_simple_fold(_ffi, ch);
+ final result = _icu4x_CaseMapper_simple_fold_mv1(_ffi, ch);
return result;
}
/// Returns the simple casefolding of the given character in the Turkic locale
///
/// This function only implements simple folding.
- /// For full folding, use `CaseMapper::fold_turkic`.
+ /// For full folding, use `CaseMapperBorrowed::fold_turkic`.
///
- /// See the [Rust documentation for `simple_fold_turkic`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_fold_turkic) for more information.
+ /// See the [Rust documentation for `simple_fold_turkic`](https://docs.rs/icu/2.0.0/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_fold_turkic) for more information.
Rune simpleFoldTurkic(Rune ch) {
- final result = _ICU4XCaseMapper_simple_fold_turkic(_ffi, ch);
+ final result = _icu4x_CaseMapper_simple_fold_turkic_mv1(_ffi, ch);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XCaseMapper_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_destroy',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCaseMapper_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CaseMapper_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCaseMapper_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_create',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CaseMapper_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCaseMapper_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CaseMapper_create_mv1();
-@_DiplomatFfiUse('ICU4XCaseMapper_lowercase')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCaseMapper_lowercase')
+@_DiplomatFfiUse('icu4x_CaseMapper_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCaseMapper_lowercase(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> locale,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_CaseMapper_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCaseMapper_uppercase')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCaseMapper_uppercase')
+@_DiplomatFfiUse('icu4x_CaseMapper_lowercase_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_lowercase_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCaseMapper_uppercase(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> locale,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external void _icu4x_CaseMapper_lowercase_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- _TitlecaseOptionsFfi,
- ffi.Pointer<ffi.Opaque>,
- )
->(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_uppercase_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_uppercase_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> locale,
- _TitlecaseOptionsFfi options,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external void _icu4x_CaseMapper_uppercase_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XCaseMapper_fold')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCaseMapper_fold')
+@_DiplomatFfiUse('icu4x_CaseMapper_lowercase_with_compiled_data_mv1')
+@ffi.Native<ffi.Void Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_lowercase_with_compiled_data_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCaseMapper_fold(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external void _icu4x_CaseMapper_lowercase_with_compiled_data_mv1(_SliceUtf8 s, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XCaseMapper_fold_turkic')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCaseMapper_fold_turkic')
+@_DiplomatFfiUse('icu4x_CaseMapper_uppercase_with_compiled_data_mv1')
+@ffi.Native<ffi.Void Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_uppercase_with_compiled_data_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCaseMapper_fold_turkic(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external void _icu4x_CaseMapper_uppercase_with_compiled_data_mv1(_SliceUtf8 s, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XCaseMapper_add_case_closure_to')
-@ffi.Native<
- ffi.Void Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Uint32,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCaseMapper_add_case_closure_to')
+@_DiplomatFfiUse('icu4x_CaseMapper_titlecase_segment_with_only_case_data_v1_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>, _TitlecaseOptionsFfi, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_titlecase_segment_with_only_case_data_v1_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCaseMapper_add_case_closure_to(
- ffi.Pointer<ffi.Opaque> self,
- Rune c,
- ffi.Pointer<ffi.Opaque> builder,
-);
+external void _icu4x_CaseMapper_titlecase_segment_with_only_case_data_v1_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> locale, _TitlecaseOptionsFfi options, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XCaseMapper_simple_lowercase')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_simple_lowercase',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_fold_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_fold_mv1')
// ignore: non_constant_identifier_names
-external Rune _ICU4XCaseMapper_simple_lowercase(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external void _icu4x_CaseMapper_fold_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XCaseMapper_simple_uppercase')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_simple_uppercase',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_fold_turkic_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_fold_turkic_mv1')
// ignore: non_constant_identifier_names
-external Rune _ICU4XCaseMapper_simple_uppercase(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external void _icu4x_CaseMapper_fold_turkic_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XCaseMapper_simple_titlecase')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_simple_titlecase',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_add_case_closure_to_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CaseMapper_add_case_closure_to_mv1')
// ignore: non_constant_identifier_names
-external Rune _ICU4XCaseMapper_simple_titlecase(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external void _icu4x_CaseMapper_add_case_closure_to_mv1(ffi.Pointer<ffi.Opaque> self, Rune c, ffi.Pointer<ffi.Opaque> builder);
-@_DiplomatFfiUse('ICU4XCaseMapper_simple_fold')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_simple_fold',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_simple_lowercase_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CaseMapper_simple_lowercase_mv1')
// ignore: non_constant_identifier_names
-external Rune _ICU4XCaseMapper_simple_fold(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external Rune _icu4x_CaseMapper_simple_lowercase_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XCaseMapper_simple_fold_turkic')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCaseMapper_simple_fold_turkic',
-)
+@_DiplomatFfiUse('icu4x_CaseMapper_simple_uppercase_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CaseMapper_simple_uppercase_mv1')
// ignore: non_constant_identifier_names
-external Rune _ICU4XCaseMapper_simple_fold_turkic(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external Rune _icu4x_CaseMapper_simple_uppercase_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
+
+@_DiplomatFfiUse('icu4x_CaseMapper_simple_titlecase_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CaseMapper_simple_titlecase_mv1')
+// ignore: non_constant_identifier_names
+external Rune _icu4x_CaseMapper_simple_titlecase_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
+
+@_DiplomatFfiUse('icu4x_CaseMapper_simple_fold_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CaseMapper_simple_fold_mv1')
+// ignore: non_constant_identifier_names
+external Rune _icu4x_CaseMapper_simple_fold_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
+
+@_DiplomatFfiUse('icu4x_CaseMapper_simple_fold_turkic_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CaseMapper_simple_fold_turkic_mv1')
+// ignore: non_constant_identifier_names
+external Rune _icu4x_CaseMapper_simple_fold_turkic_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CodePointMapData16.g.dart b/pkgs/intl4x/lib/src/bindings/CodePointMapData16.g.dart
index d8f374e..e2f9bd3 100644
--- a/pkgs/intl4x/lib/src/bindings/CodePointMapData16.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CodePointMapData16.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -6,11 +7,11 @@
///
/// For properties whose values fit into 16 bits.
///
-/// See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information.
+/// See the [Rust documentation for `properties`](https://docs.rs/icu/2.0.0/icu/properties/index.html) for more information.
///
-/// See the [Rust documentation for `CodePointMapData`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html) for more information.
+/// See the [Rust documentation for `CodePointMapData`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapData.html) for more information.
///
-/// See the [Rust documentation for `CodePointMapDataBorrowed`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html) for more information.
+/// See the [Rust documentation for `CodePointMapDataBorrowed`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html) for more information.
final class CodePointMapData16 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -28,121 +29,101 @@
}
}
- @_DiplomatFfiUse('ICU4XCodePointMapData16_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCodePointMapData16_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CodePointMapData16_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CodePointMapData16_destroy_mv1));
/// Gets the value for a code point.
///
- /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get) for more information.
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.get) for more information.
int operator [](Rune cp) {
- final result = _ICU4XCodePointMapData16_get(_ffi, cp);
+ final result = _icu4x_CodePointMapData16_get_mv1(_ffi, cp);
return result;
}
/// Produces an iterator over ranges of code points that map to `value`
///
- /// See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information.
+ /// See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information.
CodePointRangeIterator iterRangesForValue(int value) {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XCodePointMapData16_iter_ranges_for_value(_ffi, value);
+ final result = _icu4x_CodePointMapData16_iter_ranges_for_value_mv1(_ffi, value);
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
/// Produces an iterator over ranges of code points that do not map to `value`
///
- /// See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information.
+ /// See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information.
CodePointRangeIterator iterRangesForValueComplemented(int value) {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XCodePointMapData16_iter_ranges_for_value_complemented(
- _ffi,
- value,
- );
+ final result = _icu4x_CodePointMapData16_iter_ranges_for_value_complemented_mv1(_ffi, value);
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
- /// Gets a [`CodePointSetData`] representing all entries in this map that map to the given value
+ /// Gets a [CodePointSetData] representing all entries in this map that map to the given value
///
- /// See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information.
+ /// See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information.
CodePointSetData getSetForValue(int value) {
- final result = _ICU4XCodePointMapData16_get_set_for_value(_ffi, value);
+ final result = _icu4x_CodePointMapData16_get_set_for_value_mv1(_ffi, value);
return CodePointSetData._fromFfi(result, []);
}
- /// See the [Rust documentation for `script`](https://docs.rs/icu/latest/icu/properties/maps/fn.script.html) for more information.
+ /// Create a map for the `Script` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData16.script(DataProvider provider) {
- final result = _ICU4XCodePointMapData16_load_script(provider._ffi);
+ /// See the [Rust documentation for `Script`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html) for more information.
+ factory CodePointMapData16.script() {
+ final result = _icu4x_CodePointMapData16_create_script_mv1();
+ return CodePointMapData16._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Script` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Script`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData16.scriptWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData16_create_script_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData16._fromFfi(result.union.ok, []);
}
+
}
-@_DiplomatFfiUse('ICU4XCodePointMapData16_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData16_destroy',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData16_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData16_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointMapData16_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CodePointMapData16_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCodePointMapData16_get')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData16_get',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData16_get_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointMapData16_get_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XCodePointMapData16_get(
- ffi.Pointer<ffi.Opaque> self,
- Rune cp,
-);
+external int _icu4x_CodePointMapData16_get_mv1(ffi.Pointer<ffi.Opaque> self, Rune cp);
-@_DiplomatFfiUse('ICU4XCodePointMapData16_iter_ranges_for_value')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)
->(isLeaf: true, symbol: 'ICU4XCodePointMapData16_iter_ranges_for_value')
+@_DiplomatFfiUse('icu4x_CodePointMapData16_iter_ranges_for_value_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_CodePointMapData16_iter_ranges_for_value_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointMapData16_iter_ranges_for_value(
- ffi.Pointer<ffi.Opaque> self,
- int value,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData16_iter_ranges_for_value_mv1(ffi.Pointer<ffi.Opaque> self, int value);
-@_DiplomatFfiUse('ICU4XCodePointMapData16_iter_ranges_for_value_complemented')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)
->(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData16_iter_ranges_for_value_complemented',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData16_iter_ranges_for_value_complemented_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_CodePointMapData16_iter_ranges_for_value_complemented_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XCodePointMapData16_iter_ranges_for_value_complemented(
- ffi.Pointer<ffi.Opaque> self,
- int value,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData16_iter_ranges_for_value_complemented_mv1(ffi.Pointer<ffi.Opaque> self, int value);
-@_DiplomatFfiUse('ICU4XCodePointMapData16_get_set_for_value')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)
->(isLeaf: true, symbol: 'ICU4XCodePointMapData16_get_set_for_value')
+@_DiplomatFfiUse('icu4x_CodePointMapData16_get_set_for_value_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_CodePointMapData16_get_set_for_value_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointMapData16_get_set_for_value(
- ffi.Pointer<ffi.Opaque> self,
- int value,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData16_get_set_for_value_mv1(ffi.Pointer<ffi.Opaque> self, int value);
-@_DiplomatFfiUse('ICU4XCodePointMapData16_load_script')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData16_load_script',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData16_create_script_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData16_create_script_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData16_load_script(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData16_create_script_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData16_create_script_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData16_create_script_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData16_create_script_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CodePointMapData8.g.dart b/pkgs/intl4x/lib/src/bindings/CodePointMapData8.g.dart
index 1cd9270..d7fbb5b 100644
--- a/pkgs/intl4x/lib/src/bindings/CodePointMapData8.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CodePointMapData8.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -6,11 +7,11 @@
///
/// For properties whose values fit into 8 bits.
///
-/// See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information.
+/// See the [Rust documentation for `properties`](https://docs.rs/icu/2.0.0/icu/properties/index.html) for more information.
///
-/// See the [Rust documentation for `CodePointMapData`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html) for more information.
+/// See the [Rust documentation for `CodePointMapData`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapData.html) for more information.
///
-/// See the [Rust documentation for `CodePointMapDataBorrowed`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html) for more information.
+/// See the [Rust documentation for `CodePointMapDataBorrowed`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html) for more information.
final class CodePointMapData8 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -28,49 +29,34 @@
}
}
- @_DiplomatFfiUse('ICU4XCodePointMapData8_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCodePointMapData8_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CodePointMapData8_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CodePointMapData8_destroy_mv1));
/// Gets the value for a code point.
///
- /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get) for more information.
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.get) for more information.
int operator [](Rune cp) {
- final result = _ICU4XCodePointMapData8_get(_ffi, cp);
- return result;
- }
-
- /// Converts a general category to its corresponding mask value
- ///
- /// Nonexistent general categories will map to the empty mask
- ///
- /// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html) for more information.
- static int generalCategoryToMask(int gc) {
- final result = _ICU4XCodePointMapData8_general_category_to_mask(gc);
+ final result = _icu4x_CodePointMapData8_get_mv1(_ffi, cp);
return result;
}
/// Produces an iterator over ranges of code points that map to `value`
///
- /// See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information.
+ /// See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information.
CodePointRangeIterator iterRangesForValue(int value) {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XCodePointMapData8_iter_ranges_for_value(_ffi, value);
+ final result = _icu4x_CodePointMapData8_iter_ranges_for_value_mv1(_ffi, value);
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
/// Produces an iterator over ranges of code points that do not map to `value`
///
- /// See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information.
+ /// See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information.
CodePointRangeIterator iterRangesForValueComplemented(int value) {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XCodePointMapData8_iter_ranges_for_value_complemented(
- _ffi,
- value,
- );
+ final result = _icu4x_CodePointMapData8_iter_ranges_for_value_complemented_mv1(_ffi, value);
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
@@ -83,304 +69,425 @@
/// Should only be used on maps for properties with values less than 32 (like Generak_Category),
/// other maps will have unpredictable results
///
- /// See the [Rust documentation for `iter_ranges_for_group`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_group) for more information.
- CodePointRangeIterator iterRangesForMask(int mask) {
+ /// See the [Rust documentation for `iter_ranges_for_group`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_group) for more information.
+ CodePointRangeIterator iterRangesForGroup(GeneralCategoryGroup group) {
+ final temp = _FinalizedArena();
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XCodePointMapData8_iter_ranges_for_mask(_ffi, mask);
+ final result = _icu4x_CodePointMapData8_iter_ranges_for_group_mv1(_ffi, group._toFfi(temp.arena));
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
- /// Gets a [`CodePointSetData`] representing all entries in this map that map to the given value
+ /// Gets a [CodePointSetData] representing all entries in this map that map to the given value
///
- /// See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information.
+ /// See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information.
CodePointSetData getSetForValue(int value) {
- final result = _ICU4XCodePointMapData8_get_set_for_value(_ffi, value);
+ final result = _icu4x_CodePointMapData8_get_set_for_value_mv1(_ffi, value);
return CodePointSetData._fromFfi(result, []);
}
- /// See the [Rust documentation for `general_category`](https://docs.rs/icu/latest/icu/properties/maps/fn.general_category.html) for more information.
+ /// Create a map for the `General_Category` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.generalCategory(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_general_category(provider._ffi);
+ /// See the [Rust documentation for `GeneralCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html) for more information.
+ factory CodePointMapData8.generalCategory() {
+ final result = _icu4x_CodePointMapData8_create_general_category_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `General_Category` property, using a particular data source
+ ///
+ /// See the [Rust documentation for `GeneralCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.generalCategoryWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_general_category_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `bidi_class`](https://docs.rs/icu/latest/icu/properties/maps/fn.bidi_class.html) for more information.
+ /// Create a map for the `Bidi_Class` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.bidiClass(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_bidi_class(provider._ffi);
+ /// See the [Rust documentation for `BidiClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html) for more information.
+ factory CodePointMapData8.bidiClass() {
+ final result = _icu4x_CodePointMapData8_create_bidi_class_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Bidi_Class` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `BidiClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.bidiClassWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_bidi_class_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `east_asian_width`](https://docs.rs/icu/latest/icu/properties/maps/fn.east_asian_width.html) for more information.
+ /// Create a map for the `East_Asian_Width` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.eastAsianWidth(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_east_asian_width(provider._ffi);
+ /// See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html) for more information.
+ factory CodePointMapData8.eastAsianWidth() {
+ final result = _icu4x_CodePointMapData8_create_east_asian_width_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `East_Asian_Width` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.eastAsianWidthWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_east_asian_width_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `hangul_syllable_type`](https://docs.rs/icu/latest/icu/properties/maps/fn.hangul_syllable_type.html) for more information.
+ /// Create a map for the `Hangul_Syllable_Type` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.hangulSyllableType(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_hangul_syllable_type(
- provider._ffi,
- );
+ /// See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html) for more information.
+ factory CodePointMapData8.hangulSyllableType() {
+ final result = _icu4x_CodePointMapData8_create_hangul_syllable_type_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Hangul_Syllable_Type` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.hangulSyllableTypeWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_hangul_syllable_type_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `indic_syllabic_category`](https://docs.rs/icu/latest/icu/properties/maps/fn.indic_syllabic_category.html) for more information.
+ /// Create a map for the `Indic_Syllabic_Property` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.indicSyllabicCategory(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_indic_syllabic_category(
- provider._ffi,
- );
+ /// See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html) for more information.
+ factory CodePointMapData8.indicSyllabicCategory() {
+ final result = _icu4x_CodePointMapData8_create_indic_syllabic_category_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Indic_Syllabic_Property` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.indicSyllabicCategoryWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_indic_syllabic_category_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `line_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.line_break.html) for more information.
+ /// Create a map for the `Line_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.lineBreak(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_line_break(provider._ffi);
+ /// See the [Rust documentation for `LineBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html) for more information.
+ factory CodePointMapData8.lineBreak() {
+ final result = _icu4x_CodePointMapData8_create_line_break_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Line_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `LineBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.lineBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_line_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `grapheme_cluster_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.grapheme_cluster_break.html) for more information.
+ /// Create a map for the `Grapheme_Cluster_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- static CodePointMapData8 tryGraphemeClusterBreak(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_try_grapheme_cluster_break(
- provider._ffi,
- );
+ /// See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeClusterBreak.html) for more information.
+ factory CodePointMapData8.graphemeClusterBreak() {
+ final result = _icu4x_CodePointMapData8_create_grapheme_cluster_break_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Grapheme_Cluster_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeClusterBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.graphemeClusterBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_grapheme_cluster_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `word_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.word_break.html) for more information.
+ /// Create a map for the `Word_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.wordBreak(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_word_break(provider._ffi);
+ /// See the [Rust documentation for `WordBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html) for more information.
+ factory CodePointMapData8.wordBreak() {
+ final result = _icu4x_CodePointMapData8_create_word_break_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Word_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `WordBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.wordBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_word_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `sentence_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.sentence_break.html) for more information.
+ /// Create a map for the `Sentence_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.sentenceBreak(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_sentence_break(provider._ffi);
+ /// See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html) for more information.
+ factory CodePointMapData8.sentenceBreak() {
+ final result = _icu4x_CodePointMapData8_create_sentence_break_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Sentence_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.sentenceBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_sentence_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `joining_type`](https://docs.rs/icu/latest/icu/properties/maps/fn.joining_type.html) for more information.
+ /// Create a map for the `Joining_Type` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory CodePointMapData8.joiningType(DataProvider provider) {
- final result = _ICU4XCodePointMapData8_load_joining_type(provider._ffi);
+ /// See the [Rust documentation for `JoiningType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html) for more information.
+ factory CodePointMapData8.joiningType() {
+ final result = _icu4x_CodePointMapData8_create_joining_type_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Joining_Type` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `JoiningType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.joiningTypeWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_joining_type_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointMapData8._fromFfi(result.union.ok, []);
}
+
+ /// Create a map for the `Canonical_Combining_Class` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `CanonicalCombiningClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html) for more information.
+ factory CodePointMapData8.canonicalCombiningClass() {
+ final result = _icu4x_CodePointMapData8_create_canonical_combining_class_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Canonical_Combining_Class` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `CanonicalCombiningClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CanonicalCombiningClass.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.canonicalCombiningClassWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_canonical_combining_class_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return CodePointMapData8._fromFfi(result.union.ok, []);
+ }
+
+ /// Create a map for the `Vertical_Orientation` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `VerticalOrientation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html) for more information.
+ factory CodePointMapData8.verticalOrientation() {
+ final result = _icu4x_CodePointMapData8_create_vertical_orientation_mv1();
+ return CodePointMapData8._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Vertical_Orientation` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `VerticalOrientation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointMapData8.verticalOrientationWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointMapData8_create_vertical_orientation_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return CodePointMapData8._fromFfi(result.union.ok, []);
+ }
+
}
-@_DiplomatFfiUse('ICU4XCodePointMapData8_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_destroy',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointMapData8_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CodePointMapData8_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_get')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_get',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_get_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_get_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XCodePointMapData8_get(ffi.Pointer<ffi.Opaque> self, Rune cp);
+external int _icu4x_CodePointMapData8_get_mv1(ffi.Pointer<ffi.Opaque> self, Rune cp);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_general_category_to_mask')
-@ffi.Native<ffi.Uint32 Function(ffi.Uint8)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_general_category_to_mask',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_iter_ranges_for_value_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_iter_ranges_for_value_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XCodePointMapData8_general_category_to_mask(int gc);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_iter_ranges_for_value_mv1(ffi.Pointer<ffi.Opaque> self, int value);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_iter_ranges_for_value')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint8)
->(isLeaf: true, symbol: 'ICU4XCodePointMapData8_iter_ranges_for_value')
+@_DiplomatFfiUse('icu4x_CodePointMapData8_iter_ranges_for_value_complemented_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_iter_ranges_for_value_complemented_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointMapData8_iter_ranges_for_value(
- ffi.Pointer<ffi.Opaque> self,
- int value,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_iter_ranges_for_value_complemented_mv1(ffi.Pointer<ffi.Opaque> self, int value);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_iter_ranges_for_value_complemented')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint8)
->(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_iter_ranges_for_value_complemented',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_iter_ranges_for_group_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _GeneralCategoryGroupFfi)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_iter_ranges_for_group_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XCodePointMapData8_iter_ranges_for_value_complemented(
- ffi.Pointer<ffi.Opaque> self,
- int value,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_iter_ranges_for_group_mv1(ffi.Pointer<ffi.Opaque> self, _GeneralCategoryGroupFfi group);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_iter_ranges_for_mask')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)
->(isLeaf: true, symbol: 'ICU4XCodePointMapData8_iter_ranges_for_mask')
+@_DiplomatFfiUse('icu4x_CodePointMapData8_get_set_for_value_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_get_set_for_value_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointMapData8_iter_ranges_for_mask(
- ffi.Pointer<ffi.Opaque> self,
- int mask,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_get_set_for_value_mv1(ffi.Pointer<ffi.Opaque> self, int value);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_get_set_for_value')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint8)
->(isLeaf: true, symbol: 'ICU4XCodePointMapData8_get_set_for_value')
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_general_category_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_general_category_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointMapData8_get_set_for_value(
- ffi.Pointer<ffi.Opaque> self,
- int value,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_general_category_mv1();
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_general_category')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_general_category',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_general_category_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_general_category_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_general_category(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_general_category_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_bidi_class')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_bidi_class',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_bidi_class_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_bidi_class_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_bidi_class(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_bidi_class_mv1();
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_east_asian_width')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_east_asian_width',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_bidi_class_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_bidi_class_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_east_asian_width(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_bidi_class_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_hangul_syllable_type')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_hangul_syllable_type',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_east_asian_width_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_east_asian_width_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_hangul_syllable_type(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_east_asian_width_mv1();
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_indic_syllabic_category')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_indic_syllabic_category',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_east_asian_width_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_east_asian_width_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XCodePointMapData8_load_indic_syllabic_category(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_east_asian_width_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_line_break')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_line_break',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_hangul_syllable_type_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_hangul_syllable_type_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_line_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_hangul_syllable_type_mv1();
-@_DiplomatFfiUse('ICU4XCodePointMapData8_try_grapheme_cluster_break')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_try_grapheme_cluster_break',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_hangul_syllable_type_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_hangul_syllable_type_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_try_grapheme_cluster_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_hangul_syllable_type_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_word_break')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_word_break',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_indic_syllabic_category_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_indic_syllabic_category_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_word_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_indic_syllabic_category_mv1();
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_sentence_break')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_sentence_break',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_indic_syllabic_category_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_indic_syllabic_category_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_sentence_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_indic_syllabic_category_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointMapData8_load_joining_type')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointMapData8_load_joining_type',
-)
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_line_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_line_break_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_joining_type(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_line_break_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_line_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_line_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_line_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_grapheme_cluster_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_grapheme_cluster_break_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_grapheme_cluster_break_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_grapheme_cluster_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_grapheme_cluster_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_grapheme_cluster_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_word_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_word_break_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_word_break_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_word_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_word_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_word_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_sentence_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_sentence_break_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_sentence_break_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_sentence_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_sentence_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_sentence_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_joining_type_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_joining_type_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_joining_type_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_joining_type_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_joining_type_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_joining_type_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_canonical_combining_class_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_canonical_combining_class_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_canonical_combining_class_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_canonical_combining_class_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_canonical_combining_class_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_canonical_combining_class_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_vertical_orientation_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_vertical_orientation_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointMapData8_create_vertical_orientation_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointMapData8_create_vertical_orientation_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointMapData8_create_vertical_orientation_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointMapData8_create_vertical_orientation_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CodePointRangeIterator.g.dart b/pkgs/intl4x/lib/src/bindings/CodePointRangeIterator.g.dart
index 3f48614..324423a 100644
--- a/pkgs/intl4x/lib/src/bindings/CodePointRangeIterator.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CodePointRangeIterator.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -23,34 +24,27 @@
}
}
- @_DiplomatFfiUse('CodePointRangeIterator_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_CodePointRangeIterator_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CodePointRangeIterator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CodePointRangeIterator_destroy_mv1));
/// Advance the iterator by one and return the next range.
///
/// If the iterator is out of items, `done` will be true
CodePointRangeIteratorResult next() {
- final result = _CodePointRangeIterator_next(_ffi);
+ final result = _icu4x_CodePointRangeIterator_next_mv1(_ffi);
return CodePointRangeIteratorResult._fromFfi(result);
}
+
}
-@_DiplomatFfiUse('CodePointRangeIterator_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'CodePointRangeIterator_destroy',
-)
+@_DiplomatFfiUse('icu4x_CodePointRangeIterator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CodePointRangeIterator_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _CodePointRangeIterator_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CodePointRangeIterator_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('CodePointRangeIterator_next')
-@ffi.Native<_CodePointRangeIteratorResultFfi Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'CodePointRangeIterator_next',
-)
+@_DiplomatFfiUse('icu4x_CodePointRangeIterator_next_mv1')
+@ffi.Native<_CodePointRangeIteratorResultFfi Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointRangeIterator_next_mv1')
// ignore: non_constant_identifier_names
-external _CodePointRangeIteratorResultFfi _CodePointRangeIterator_next(
- ffi.Pointer<ffi.Opaque> self,
-);
+external _CodePointRangeIteratorResultFfi _icu4x_CodePointRangeIterator_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CodePointRangeIteratorResult.g.dart b/pkgs/intl4x/lib/src/bindings/CodePointRangeIteratorResult.g.dart
index 13eaa49..37eaa25 100644
--- a/pkgs/intl4x/lib/src/bindings/CodePointRangeIteratorResult.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CodePointRangeIteratorResult.g.dart
@@ -1,26 +1,27 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
final class _CodePointRangeIteratorResultFfi extends ffi.Struct {
@ffi.Uint32()
- external int start;
+ external Rune start;
@ffi.Uint32()
- external int end;
+ external Rune end;
@ffi.Bool()
external bool done;
}
-/// Result of a single iteration of [`CodePointRangeIterator`].
-/// Logically can be considered to be an `Option<RangeInclusive<u32>>`,
+/// Result of a single iteration of [CodePointRangeIterator].
+/// Logically can be considered to be an `Option<RangeInclusive<DiplomatChar>>`,
///
-/// `start` and `end` represent an inclusive range of code points [start, end],
+/// `start` and `end` represent an inclusive range of code points `[start, end]`,
/// and `done` will be true if the iterator has already finished. The last contentful
-/// iteration will NOT produce a range done=true, in other words `start` and `end` are useful
+/// iteration will NOT produce a range `done=true`, in other words `start` and `end` are useful
/// values if and only if `done=false`.
final class CodePointRangeIteratorResult {
- final int start;
- final int end;
+ final Rune start;
+ final Rune end;
final bool done;
// This struct contains borrowed fields, so this takes in a list of
@@ -29,10 +30,10 @@
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
- CodePointRangeIteratorResult._fromFfi(_CodePointRangeIteratorResultFfi ffi)
- : start = ffi.start,
- end = ffi.end,
- done = ffi.done;
+ CodePointRangeIteratorResult._fromFfi(_CodePointRangeIteratorResultFfi ffi) :
+ start = ffi.start,
+ end = ffi.end,
+ done = ffi.done;
// ignore: unused_element
_CodePointRangeIteratorResultFfi _toFfi(ffi.Allocator temp) {
@@ -43,6 +44,7 @@
return struct;
}
+
@override
bool operator ==(Object other) =>
other is CodePointRangeIteratorResult &&
@@ -51,5 +53,11 @@
other.done == done;
@override
- int get hashCode => Object.hashAll([start, end, done]);
+ int get hashCode => Object.hashAll([
+ start,
+ end,
+ done,
+ ]);
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CodePointSetBuilder.g.dart b/pkgs/intl4x/lib/src/bindings/CodePointSetBuilder.g.dart
index e43bfdd..e739c04 100644
--- a/pkgs/intl4x/lib/src/bindings/CodePointSetBuilder.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CodePointSetBuilder.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `CodePointInversionListBuilder`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html) for more information.
+/// See the [Rust documentation for `CodePointInversionListBuilder`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html) for more information.
final class CodePointSetBuilder implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,16 +21,14 @@
}
}
- @_DiplomatFfiUse('ICU4XCodePointSetBuilder_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCodePointSetBuilder_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CodePointSetBuilder_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CodePointSetBuilder_destroy_mv1));
/// Make a new set builder containing nothing
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.new) for more information.
factory CodePointSetBuilder() {
- final result = _ICU4XCodePointSetBuilder_create();
+ final result = _icu4x_CodePointSetBuilder_create_mv1();
return CodePointSetBuilder._fromFfi(result, []);
}
@@ -37,9 +36,9 @@
///
/// This object is repopulated with an empty builder
///
- /// See the [Rust documentation for `build`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.build) for more information.
+ /// See the [Rust documentation for `build`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.build) for more information.
CodePointSetData build() {
- final result = _ICU4XCodePointSetBuilder_build(_ffi);
+ final result = _icu4x_CodePointSetBuilder_build_mv1(_ffi);
return CodePointSetData._fromFfi(result, []);
}
@@ -47,282 +46,194 @@
///
/// (Elements in this set are removed and vice versa)
///
- /// See the [Rust documentation for `complement`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement) for more information.
+ /// See the [Rust documentation for `complement`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement) for more information.
void complement() {
- _ICU4XCodePointSetBuilder_complement(_ffi);
+ _icu4x_CodePointSetBuilder_complement_mv1(_ffi);
}
/// Returns whether this set is empty
///
- /// See the [Rust documentation for `is_empty`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.is_empty) for more information.
+ /// See the [Rust documentation for `is_empty`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.is_empty) for more information.
bool get isEmpty {
- final result = _ICU4XCodePointSetBuilder_is_empty(_ffi);
+ final result = _icu4x_CodePointSetBuilder_is_empty_mv1(_ffi);
return result;
}
/// Add a single character to the set
///
- /// See the [Rust documentation for `add_char`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_char) for more information.
+ /// See the [Rust documentation for `add_char`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_char) for more information.
void addChar(Rune ch) {
- _ICU4XCodePointSetBuilder_add_char(_ffi, ch);
+ _icu4x_CodePointSetBuilder_add_char_mv1(_ffi, ch);
}
/// Add an inclusive range of characters to the set
///
- /// See the [Rust documentation for `add_range`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_range) for more information.
+ /// See the [Rust documentation for `add_range`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_range) for more information.
void addInclusiveRange(Rune start, Rune end) {
- _ICU4XCodePointSetBuilder_add_inclusive_range(_ffi, start, end);
+ _icu4x_CodePointSetBuilder_add_inclusive_range_mv1(_ffi, start, end);
}
/// Add all elements that belong to the provided set to the set
///
- /// See the [Rust documentation for `add_set`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_set) for more information.
+ /// See the [Rust documentation for `add_set`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_set) for more information.
void addSet(CodePointSetData data) {
- _ICU4XCodePointSetBuilder_add_set(_ffi, data._ffi);
+ _icu4x_CodePointSetBuilder_add_set_mv1(_ffi, data._ffi);
}
/// Remove a single character to the set
///
- /// See the [Rust documentation for `remove_char`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_char) for more information.
+ /// See the [Rust documentation for `remove_char`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_char) for more information.
void removeChar(Rune ch) {
- _ICU4XCodePointSetBuilder_remove_char(_ffi, ch);
+ _icu4x_CodePointSetBuilder_remove_char_mv1(_ffi, ch);
}
/// Remove an inclusive range of characters from the set
///
- /// See the [Rust documentation for `remove_range`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_range) for more information.
+ /// See the [Rust documentation for `remove_range`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_range) for more information.
void removeInclusiveRange(Rune start, Rune end) {
- _ICU4XCodePointSetBuilder_remove_inclusive_range(_ffi, start, end);
+ _icu4x_CodePointSetBuilder_remove_inclusive_range_mv1(_ffi, start, end);
}
/// Remove all elements that belong to the provided set from the set
///
- /// See the [Rust documentation for `remove_set`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_set) for more information.
+ /// See the [Rust documentation for `remove_set`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_set) for more information.
void removeSet(CodePointSetData data) {
- _ICU4XCodePointSetBuilder_remove_set(_ffi, data._ffi);
+ _icu4x_CodePointSetBuilder_remove_set_mv1(_ffi, data._ffi);
}
/// Removes all elements from the set except a single character
///
- /// See the [Rust documentation for `retain_char`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_char) for more information.
+ /// See the [Rust documentation for `retain_char`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_char) for more information.
void retainChar(Rune ch) {
- _ICU4XCodePointSetBuilder_retain_char(_ffi, ch);
+ _icu4x_CodePointSetBuilder_retain_char_mv1(_ffi, ch);
}
/// Removes all elements from the set except an inclusive range of characters f
///
- /// See the [Rust documentation for `retain_range`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_range) for more information.
+ /// See the [Rust documentation for `retain_range`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_range) for more information.
void retainInclusiveRange(Rune start, Rune end) {
- _ICU4XCodePointSetBuilder_retain_inclusive_range(_ffi, start, end);
+ _icu4x_CodePointSetBuilder_retain_inclusive_range_mv1(_ffi, start, end);
}
/// Removes all elements from the set except all elements in the provided set
///
- /// See the [Rust documentation for `retain_set`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_set) for more information.
+ /// See the [Rust documentation for `retain_set`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_set) for more information.
void retainSet(CodePointSetData data) {
- _ICU4XCodePointSetBuilder_retain_set(_ffi, data._ffi);
+ _icu4x_CodePointSetBuilder_retain_set_mv1(_ffi, data._ffi);
}
/// Complement a single character to the set
///
/// (Characters which are in this set are removed and vice versa)
///
- /// See the [Rust documentation for `complement_char`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement_char) for more information.
+ /// See the [Rust documentation for `complement_char`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement_char) for more information.
void complementChar(Rune ch) {
- _ICU4XCodePointSetBuilder_complement_char(_ffi, ch);
+ _icu4x_CodePointSetBuilder_complement_char_mv1(_ffi, ch);
}
/// Complement an inclusive range of characters from the set
///
/// (Characters which are in this set are removed and vice versa)
///
- /// See the [Rust documentation for `complement_range`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement_range) for more information.
+ /// See the [Rust documentation for `complement_range`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement_range) for more information.
void complementInclusiveRange(Rune start, Rune end) {
- _ICU4XCodePointSetBuilder_complement_inclusive_range(_ffi, start, end);
+ _icu4x_CodePointSetBuilder_complement_inclusive_range_mv1(_ffi, start, end);
}
/// Complement all elements that belong to the provided set from the set
///
/// (Characters which are in this set are removed and vice versa)
///
- /// See the [Rust documentation for `complement_set`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement_set) for more information.
+ /// See the [Rust documentation for `complement_set`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.complement_set) for more information.
void complementSet(CodePointSetData data) {
- _ICU4XCodePointSetBuilder_complement_set(_ffi, data._ffi);
+ _icu4x_CodePointSetBuilder_complement_set_mv1(_ffi, data._ffi);
}
+
}
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_destroy',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CodePointSetBuilder_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_create')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_create',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_create_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointSetBuilder_create();
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetBuilder_create_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_build')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_build',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_build_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_build_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointSetBuilder_build(
- ffi.Pointer<ffi.Opaque> self,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetBuilder_build_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_complement')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_complement',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_complement_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_complement_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_complement(
- ffi.Pointer<ffi.Opaque> self,
-);
+external void _icu4x_CodePointSetBuilder_complement_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_is_empty')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_is_empty',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_is_empty_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_is_empty_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XCodePointSetBuilder_is_empty(ffi.Pointer<ffi.Opaque> self);
+external bool _icu4x_CodePointSetBuilder_is_empty_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_add_char')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_add_char',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_add_char_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_add_char_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_add_char(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external void _icu4x_CodePointSetBuilder_add_char_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_add_inclusive_range')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_add_inclusive_range',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_add_inclusive_range_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_add_inclusive_range_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_add_inclusive_range(
- ffi.Pointer<ffi.Opaque> self,
- Rune start,
- Rune end,
-);
+external void _icu4x_CodePointSetBuilder_add_inclusive_range_mv1(ffi.Pointer<ffi.Opaque> self, Rune start, Rune end);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_add_set')
-@ffi.Native<
- ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_add_set')
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_add_set_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_add_set_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_add_set(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> data,
-);
+external void _icu4x_CodePointSetBuilder_add_set_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> data);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_remove_char')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_remove_char',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_remove_char_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_remove_char_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_remove_char(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external void _icu4x_CodePointSetBuilder_remove_char_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_remove_inclusive_range')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_remove_inclusive_range',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_remove_inclusive_range_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_remove_inclusive_range_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_remove_inclusive_range(
- ffi.Pointer<ffi.Opaque> self,
- Rune start,
- Rune end,
-);
+external void _icu4x_CodePointSetBuilder_remove_inclusive_range_mv1(ffi.Pointer<ffi.Opaque> self, Rune start, Rune end);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_remove_set')
-@ffi.Native<
- ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_remove_set')
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_remove_set_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_remove_set_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_remove_set(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> data,
-);
+external void _icu4x_CodePointSetBuilder_remove_set_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> data);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_retain_char')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_retain_char',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_retain_char_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_retain_char_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_retain_char(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external void _icu4x_CodePointSetBuilder_retain_char_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_retain_inclusive_range')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_retain_inclusive_range',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_retain_inclusive_range_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_retain_inclusive_range_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_retain_inclusive_range(
- ffi.Pointer<ffi.Opaque> self,
- Rune start,
- Rune end,
-);
+external void _icu4x_CodePointSetBuilder_retain_inclusive_range_mv1(ffi.Pointer<ffi.Opaque> self, Rune start, Rune end);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_retain_set')
-@ffi.Native<
- ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_retain_set')
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_retain_set_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_retain_set_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_retain_set(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> data,
-);
+external void _icu4x_CodePointSetBuilder_retain_set_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> data);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_complement_char')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_complement_char',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_complement_char_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_complement_char_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_complement_char(
- ffi.Pointer<ffi.Opaque> self,
- Rune ch,
-);
+external void _icu4x_CodePointSetBuilder_complement_char_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_complement_inclusive_range')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetBuilder_complement_inclusive_range',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_complement_inclusive_range_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_complement_inclusive_range_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_complement_inclusive_range(
- ffi.Pointer<ffi.Opaque> self,
- Rune start,
- Rune end,
-);
+external void _icu4x_CodePointSetBuilder_complement_inclusive_range_mv1(ffi.Pointer<ffi.Opaque> self, Rune start, Rune end);
-@_DiplomatFfiUse('ICU4XCodePointSetBuilder_complement_set')
-@ffi.Native<
- ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_complement_set')
+@_DiplomatFfiUse('icu4x_CodePointSetBuilder_complement_set_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetBuilder_complement_set_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetBuilder_complement_set(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> data,
-);
+external void _icu4x_CodePointSetBuilder_complement_set_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> data);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CodePointSetData.g.dart b/pkgs/intl4x/lib/src/bindings/CodePointSetData.g.dart
index 27fb749..de1655d 100644
--- a/pkgs/intl4x/lib/src/bindings/CodePointSetData.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CodePointSetData.g.dart
@@ -1,14 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X Unicode Set Property object, capable of querying whether a code point is contained in a set based on a Unicode property.
///
-/// See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information.
+/// See the [Rust documentation for `properties`](https://docs.rs/icu/2.0.0/icu/properties/index.html) for more information.
///
-/// See the [Rust documentation for `CodePointSetData`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetData.html) for more information.
+/// See the [Rust documentation for `CodePointSetData`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointSetData.html) for more information.
///
-/// See the [Rust documentation for `CodePointSetDataBorrowed`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html) for more information.
+/// See the [Rust documentation for `CodePointSetDataBorrowed`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointSetDataBorrowed.html) for more information.
final class CodePointSetData implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -26,1558 +27,2993 @@
}
}
- @_DiplomatFfiUse('ICU4XCodePointSetData_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCodePointSetData_destroy),
- );
+ @_DiplomatFfiUse('icu4x_CodePointSetData_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CodePointSetData_destroy_mv1));
/// Checks whether the code point is in the set.
///
- /// See the [Rust documentation for `contains`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.contains) for more information.
+ /// See the [Rust documentation for `contains`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointSetDataBorrowed.html#method.contains) for more information.
bool contains(Rune cp) {
- final result = _ICU4XCodePointSetData_contains(_ffi, cp);
+ final result = _icu4x_CodePointSetData_contains_mv1(_ffi, cp);
return result;
}
/// Produces an iterator over ranges of code points contained in this set
///
- /// See the [Rust documentation for `iter_ranges`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges) for more information.
+ /// See the [Rust documentation for `iter_ranges`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointSetDataBorrowed.html#method.iter_ranges) for more information.
CodePointRangeIterator iterRanges() {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XCodePointSetData_iter_ranges(_ffi);
+ final result = _icu4x_CodePointSetData_iter_ranges_mv1(_ffi);
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
/// Produces an iterator over ranges of code points not contained in this set
///
- /// See the [Rust documentation for `iter_ranges_complemented`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges_complemented) for more information.
+ /// See the [Rust documentation for `iter_ranges_complemented`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointSetDataBorrowed.html#method.iter_ranges_complemented) for more information.
CodePointRangeIterator iterRangesComplemented() {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XCodePointSetData_iter_ranges_complemented(_ffi);
+ final result = _icu4x_CodePointSetData_iter_ranges_complemented_mv1(_ffi);
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
- /// which is a mask with the same format as the `U_GC_XX_MASK` mask in ICU4C
+ /// Produces a set for obtaining General Category Group values
+ /// which is a mask with the same format as the `U_GC_XX_MASK` mask in ICU4C, using compiled data.
///
- /// See the [Rust documentation for `for_general_category_group`](https://docs.rs/icu/latest/icu/properties/sets/fn.for_general_category_group.html) for more information.
+ /// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.forGeneralCategoryGroup(
- DataProvider provider,
- int group,
- ) {
- final result = _ICU4XCodePointSetData_load_for_general_category_group(
- provider._ffi,
- group,
- );
+ /// See the [Rust documentation for `get_set_for_value_group`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.get_set_for_value_group) for more information.
+ factory CodePointSetData.generalCategoryGroup(GeneralCategoryGroup group) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_CodePointSetData_create_general_category_group_mv1(group._toFfi(temp.arena));
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Produces a set for obtaining General Category Group values
+ /// which is a mask with the same format as the `U_GC_XX_MASK` mask in ICU4C, using a provided data source.
+ ///
+ /// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html) for more information.
+ ///
+ /// See the [Rust documentation for `get_set_for_value_group`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointMapDataBorrowed.html#method.get_set_for_value_group) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.generalCategoryGroupWithProvider(DataProvider provider, int group) {
+ final result = _icu4x_CodePointSetData_create_general_category_group_with_provider_mv1(provider._ffi, group);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Ascii_Hex_Digit` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool asciiHexDigitForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_ascii_hex_digit_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Ascii_Hex_Digit` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `AsciiHexDigit`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.AsciiHexDigit.html) for more information.
+ factory CodePointSetData.asciiHexDigit() {
+ final result = _icu4x_CodePointSetData_create_ascii_hex_digit_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `ascii_hex_digit`](https://docs.rs/icu/latest/icu/properties/sets/fn.ascii_hex_digit.html) for more information.
+ /// Create a set for the `Ascii_Hex_Digit` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.asciiHexDigit(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_ascii_hex_digit(provider._ffi);
+ /// See the [Rust documentation for `AsciiHexDigit`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.AsciiHexDigit.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.asciiHexDigitWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_ascii_hex_digit_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Alnum` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool alnumForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_alnum_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Alnum` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Alnum`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Alnum.html) for more information.
+ factory CodePointSetData.alnum() {
+ final result = _icu4x_CodePointSetData_create_alnum_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `alnum`](https://docs.rs/icu/latest/icu/properties/sets/fn.alnum.html) for more information.
+ /// Create a set for the `Alnum` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.alnum(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_alnum(provider._ffi);
+ /// See the [Rust documentation for `Alnum`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Alnum.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.alnumWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_alnum_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `alphabetic`](https://docs.rs/icu/latest/icu/properties/sets/fn.alphabetic.html) for more information.
+ /// Get the `Alphabetic` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool alphabeticForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_alphabetic_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Alphabetic` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Alphabetic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Alphabetic.html) for more information.
+ factory CodePointSetData.alphabetic() {
+ final result = _icu4x_CodePointSetData_create_alphabetic_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Alphabetic` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Alphabetic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Alphabetic.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.alphabetic(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_alphabetic(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.alphabeticWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_alphabetic_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Bidi_Control` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool bidiControlForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_bidi_control_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Bidi_Control` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `BidiControl`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiControl.html) for more information.
+ factory CodePointSetData.bidiControl() {
+ final result = _icu4x_CodePointSetData_create_bidi_control_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `bidi_control`](https://docs.rs/icu/latest/icu/properties/sets/fn.bidi_control.html) for more information.
+ /// Create a set for the `Bidi_Control` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.bidiControl(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_bidi_control(provider._ffi);
+ /// See the [Rust documentation for `BidiControl`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiControl.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.bidiControlWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_bidi_control_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Bidi_Mirrored` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool bidiMirroredForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_bidi_mirrored_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Bidi_Mirrored` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `BidiMirrored`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiMirrored.html) for more information.
+ factory CodePointSetData.bidiMirrored() {
+ final result = _icu4x_CodePointSetData_create_bidi_mirrored_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `bidi_mirrored`](https://docs.rs/icu/latest/icu/properties/sets/fn.bidi_mirrored.html) for more information.
+ /// Create a set for the `Bidi_Mirrored` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.bidiMirrored(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_bidi_mirrored(provider._ffi);
+ /// See the [Rust documentation for `BidiMirrored`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiMirrored.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.bidiMirroredWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_bidi_mirrored_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `blank`](https://docs.rs/icu/latest/icu/properties/sets/fn.blank.html) for more information.
+ /// Get the `Blank` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool blankForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_blank_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Blank` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Blank`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Blank.html) for more information.
+ factory CodePointSetData.blank() {
+ final result = _icu4x_CodePointSetData_create_blank_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Blank` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Blank`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Blank.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.blank(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_blank(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.blankWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_blank_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `cased`](https://docs.rs/icu/latest/icu/properties/sets/fn.cased.html) for more information.
+ /// Get the `Cased` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool casedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_cased_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Cased` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Cased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Cased.html) for more information.
+ factory CodePointSetData.cased() {
+ final result = _icu4x_CodePointSetData_create_cased_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Cased` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Cased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Cased.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.cased(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_cased(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.casedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_cased_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Case_Ignorable` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool caseIgnorableForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_case_ignorable_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Case_Ignorable` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `CaseIgnorable`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CaseIgnorable.html) for more information.
+ factory CodePointSetData.caseIgnorable() {
+ final result = _icu4x_CodePointSetData_create_case_ignorable_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `case_ignorable`](https://docs.rs/icu/latest/icu/properties/sets/fn.case_ignorable.html) for more information.
+ /// Create a set for the `Case_Ignorable` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.caseIgnorable(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_case_ignorable(provider._ffi);
+ /// See the [Rust documentation for `CaseIgnorable`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CaseIgnorable.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.caseIgnorableWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_case_ignorable_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `full_composition_exclusion`](https://docs.rs/icu/latest/icu/properties/sets/fn.full_composition_exclusion.html) for more information.
+ /// Get the `Full_Composition_Exclusion` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool fullCompositionExclusionForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_full_composition_exclusion_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Full_Composition_Exclusion` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `FullCompositionExclusion`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.FullCompositionExclusion.html) for more information.
+ factory CodePointSetData.fullCompositionExclusion() {
+ final result = _icu4x_CodePointSetData_create_full_composition_exclusion_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Full_Composition_Exclusion` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `FullCompositionExclusion`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.FullCompositionExclusion.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.fullCompositionExclusion(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_full_composition_exclusion(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.fullCompositionExclusionWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_full_composition_exclusion_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Changes_When_Casefolded` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool changesWhenCasefoldedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_changes_when_casefolded_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Changes_When_Casefolded` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `ChangesWhenCasefolded`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenCasefolded.html) for more information.
+ factory CodePointSetData.changesWhenCasefolded() {
+ final result = _icu4x_CodePointSetData_create_changes_when_casefolded_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `changes_when_casefolded`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_casefolded.html) for more information.
+ /// Create a set for the `Changes_When_Casefolded` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.changesWhenCasefolded(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_changes_when_casefolded(
- provider._ffi,
- );
+ /// See the [Rust documentation for `ChangesWhenCasefolded`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenCasefolded.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.changesWhenCasefoldedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_changes_when_casefolded_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Changes_When_Casemapped` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool changesWhenCasemappedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_changes_when_casemapped_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Changes_When_Casemapped` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `ChangesWhenCasemapped`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenCasemapped.html) for more information.
+ factory CodePointSetData.changesWhenCasemapped() {
+ final result = _icu4x_CodePointSetData_create_changes_when_casemapped_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `changes_when_casemapped`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_casemapped.html) for more information.
+ /// Create a set for the `Changes_When_Casemapped` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.changesWhenCasemapped(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_changes_when_casemapped(
- provider._ffi,
- );
+ /// See the [Rust documentation for `ChangesWhenCasemapped`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenCasemapped.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.changesWhenCasemappedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_changes_when_casemapped_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `changes_when_nfkc_casefolded`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_nfkc_casefolded.html) for more information.
+ /// Get the `Changes_When_Nfkc_Casefolded` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool changesWhenNfkcCasefoldedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_changes_when_nfkc_casefolded_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Changes_When_Nfkc_Casefolded` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `ChangesWhenNfkcCasefolded`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenNfkcCasefolded.html) for more information.
+ factory CodePointSetData.changesWhenNfkcCasefolded() {
+ final result = _icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Changes_When_Nfkc_Casefolded` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `ChangesWhenNfkcCasefolded`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenNfkcCasefolded.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.changesWhenNfkcCasefolded(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.changesWhenNfkcCasefoldedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Changes_When_Lowercased` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool changesWhenLowercasedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_changes_when_lowercased_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Changes_When_Lowercased` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `ChangesWhenLowercased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenLowercased.html) for more information.
+ factory CodePointSetData.changesWhenLowercased() {
+ final result = _icu4x_CodePointSetData_create_changes_when_lowercased_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `changes_when_lowercased`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_lowercased.html) for more information.
+ /// Create a set for the `Changes_When_Lowercased` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.changesWhenLowercased(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_changes_when_lowercased(
- provider._ffi,
- );
+ /// See the [Rust documentation for `ChangesWhenLowercased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenLowercased.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.changesWhenLowercasedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_changes_when_lowercased_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `changes_when_titlecased`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_titlecased.html) for more information.
+ /// Get the `Changes_When_Titlecased` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool changesWhenTitlecasedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_changes_when_titlecased_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Changes_When_Titlecased` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `ChangesWhenTitlecased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenTitlecased.html) for more information.
+ factory CodePointSetData.changesWhenTitlecased() {
+ final result = _icu4x_CodePointSetData_create_changes_when_titlecased_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Changes_When_Titlecased` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `ChangesWhenTitlecased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenTitlecased.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.changesWhenTitlecased(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_changes_when_titlecased(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.changesWhenTitlecasedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_changes_when_titlecased_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `changes_when_uppercased`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_uppercased.html) for more information.
+ /// Get the `Changes_When_Uppercased` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool changesWhenUppercasedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_changes_when_uppercased_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Changes_When_Uppercased` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `ChangesWhenUppercased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenUppercased.html) for more information.
+ factory CodePointSetData.changesWhenUppercased() {
+ final result = _icu4x_CodePointSetData_create_changes_when_uppercased_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Changes_When_Uppercased` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `ChangesWhenUppercased`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ChangesWhenUppercased.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.changesWhenUppercased(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_changes_when_uppercased(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.changesWhenUppercasedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_changes_when_uppercased_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Dash` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool dashForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_dash_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Dash` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Dash`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Dash.html) for more information.
+ factory CodePointSetData.dash() {
+ final result = _icu4x_CodePointSetData_create_dash_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `dash`](https://docs.rs/icu/latest/icu/properties/sets/fn.dash.html) for more information.
+ /// Create a set for the `Dash` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.dash(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_dash(provider._ffi);
+ /// See the [Rust documentation for `Dash`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Dash.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.dashWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_dash_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Deprecated` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool deprecatedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_deprecated_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Deprecated` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Deprecated`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Deprecated.html) for more information.
+ factory CodePointSetData.deprecated() {
+ final result = _icu4x_CodePointSetData_create_deprecated_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `deprecated`](https://docs.rs/icu/latest/icu/properties/sets/fn.deprecated.html) for more information.
+ /// Create a set for the `Deprecated` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.deprecated(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_deprecated(provider._ffi);
+ /// See the [Rust documentation for `Deprecated`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Deprecated.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.deprecatedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_deprecated_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `default_ignorable_code_point`](https://docs.rs/icu/latest/icu/properties/sets/fn.default_ignorable_code_point.html) for more information.
+ /// Get the `Default_Ignorable_Code_Point` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool defaultIgnorableCodePointForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_default_ignorable_code_point_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Default_Ignorable_Code_Point` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `DefaultIgnorableCodePoint`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.DefaultIgnorableCodePoint.html) for more information.
+ factory CodePointSetData.defaultIgnorableCodePoint() {
+ final result = _icu4x_CodePointSetData_create_default_ignorable_code_point_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Default_Ignorable_Code_Point` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `DefaultIgnorableCodePoint`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.DefaultIgnorableCodePoint.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.defaultIgnorableCodePoint(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_default_ignorable_code_point(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.defaultIgnorableCodePointWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_default_ignorable_code_point_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `diacritic`](https://docs.rs/icu/latest/icu/properties/sets/fn.diacritic.html) for more information.
+ /// Get the `Diacritic` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool diacriticForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_diacritic_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Diacritic` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Diacritic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Diacritic.html) for more information.
+ factory CodePointSetData.diacritic() {
+ final result = _icu4x_CodePointSetData_create_diacritic_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Diacritic` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Diacritic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Diacritic.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.diacritic(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_diacritic(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.diacriticWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_diacritic_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Emoji_Modifier_Base` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool emojiModifierBaseForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_emoji_modifier_base_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Emoji_Modifier_Base` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `EmojiModifierBase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiModifierBase.html) for more information.
+ factory CodePointSetData.emojiModifierBase() {
+ final result = _icu4x_CodePointSetData_create_emoji_modifier_base_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `emoji_modifier_base`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_modifier_base.html) for more information.
+ /// Create a set for the `Emoji_Modifier_Base` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.emojiModifierBase(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_emoji_modifier_base(
- provider._ffi,
- );
+ /// See the [Rust documentation for `EmojiModifierBase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiModifierBase.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.emojiModifierBaseWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_emoji_modifier_base_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Emoji_Component` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool emojiComponentForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_emoji_component_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Emoji_Component` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `EmojiComponent`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiComponent.html) for more information.
+ factory CodePointSetData.emojiComponent() {
+ final result = _icu4x_CodePointSetData_create_emoji_component_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `emoji_component`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_component.html) for more information.
+ /// Create a set for the `Emoji_Component` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.emojiComponent(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_emoji_component(provider._ffi);
+ /// See the [Rust documentation for `EmojiComponent`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiComponent.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.emojiComponentWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_emoji_component_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Emoji_Modifier` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool emojiModifierForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_emoji_modifier_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Emoji_Modifier` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `EmojiModifier`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiModifier.html) for more information.
+ factory CodePointSetData.emojiModifier() {
+ final result = _icu4x_CodePointSetData_create_emoji_modifier_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `emoji_modifier`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_modifier.html) for more information.
+ /// Create a set for the `Emoji_Modifier` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.emojiModifier(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_emoji_modifier(provider._ffi);
+ /// See the [Rust documentation for `EmojiModifier`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiModifier.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.emojiModifierWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_emoji_modifier_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Emoji` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool emojiForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_emoji_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Emoji` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Emoji`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Emoji.html) for more information.
+ factory CodePointSetData.emoji() {
+ final result = _icu4x_CodePointSetData_create_emoji_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `emoji`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji.html) for more information.
+ /// Create a set for the `Emoji` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.emoji(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_emoji(provider._ffi);
+ /// See the [Rust documentation for `Emoji`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Emoji.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.emojiWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_emoji_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `emoji_presentation`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_presentation.html) for more information.
+ /// Get the `Emoji_Presentation` value for a given character, using compiled data
///
- /// Throws [Error] on failure.
- factory CodePointSetData.emojiPresentation(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_emoji_presentation(
- provider._ffi,
- );
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool emojiPresentationForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_emoji_presentation_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Emoji_Presentation` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `EmojiPresentation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiPresentation.html) for more information.
+ factory CodePointSetData.emojiPresentation() {
+ final result = _icu4x_CodePointSetData_create_emoji_presentation_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Emoji_Presentation` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `EmojiPresentation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EmojiPresentation.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.emojiPresentationWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_emoji_presentation_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `extender`](https://docs.rs/icu/latest/icu/properties/sets/fn.extender.html) for more information.
+ /// Get the `Extender` value for a given character, using compiled data
///
- /// Throws [Error] on failure.
- factory CodePointSetData.extender(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_extender(provider._ffi);
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool extenderForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_extender_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Extender` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Extender`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Extender.html) for more information.
+ factory CodePointSetData.extender() {
+ final result = _icu4x_CodePointSetData_create_extender_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Extender` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Extender`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Extender.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.extenderWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_extender_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Extended_Pictographic` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool extendedPictographicForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_extended_pictographic_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Extended_Pictographic` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `ExtendedPictographic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ExtendedPictographic.html) for more information.
+ factory CodePointSetData.extendedPictographic() {
+ final result = _icu4x_CodePointSetData_create_extended_pictographic_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `extended_pictographic`](https://docs.rs/icu/latest/icu/properties/sets/fn.extended_pictographic.html) for more information.
+ /// Create a set for the `Extended_Pictographic` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.extendedPictographic(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_extended_pictographic(
- provider._ffi,
- );
+ /// See the [Rust documentation for `ExtendedPictographic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.ExtendedPictographic.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.extendedPictographicWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_extended_pictographic_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Graph` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool graphForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_graph_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Graph` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Graph`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Graph.html) for more information.
+ factory CodePointSetData.graph() {
+ final result = _icu4x_CodePointSetData_create_graph_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `graph`](https://docs.rs/icu/latest/icu/properties/sets/fn.graph.html) for more information.
+ /// Create a set for the `Graph` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.graph(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_graph(provider._ffi);
+ /// See the [Rust documentation for `Graph`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Graph.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.graphWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_graph_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `grapheme_base`](https://docs.rs/icu/latest/icu/properties/sets/fn.grapheme_base.html) for more information.
+ /// Get the `Grapheme_Base` value for a given character, using compiled data
///
- /// Throws [Error] on failure.
- factory CodePointSetData.graphemeBase(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_grapheme_base(provider._ffi);
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool graphemeBaseForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_grapheme_base_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Grapheme_Base` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `GraphemeBase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeBase.html) for more information.
+ factory CodePointSetData.graphemeBase() {
+ final result = _icu4x_CodePointSetData_create_grapheme_base_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Grapheme_Base` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `GraphemeBase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeBase.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.graphemeBaseWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_grapheme_base_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Grapheme_Extend` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool graphemeExtendForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_grapheme_extend_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Grapheme_Extend` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `GraphemeExtend`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeExtend.html) for more information.
+ factory CodePointSetData.graphemeExtend() {
+ final result = _icu4x_CodePointSetData_create_grapheme_extend_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `grapheme_extend`](https://docs.rs/icu/latest/icu/properties/sets/fn.grapheme_extend.html) for more information.
+ /// Create a set for the `Grapheme_Extend` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.graphemeExtend(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_grapheme_extend(provider._ffi);
+ /// See the [Rust documentation for `GraphemeExtend`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeExtend.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.graphemeExtendWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_grapheme_extend_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Grapheme_Link` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool graphemeLinkForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_grapheme_link_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Grapheme_Link` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `GraphemeLink`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeLink.html) for more information.
+ factory CodePointSetData.graphemeLink() {
+ final result = _icu4x_CodePointSetData_create_grapheme_link_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `grapheme_link`](https://docs.rs/icu/latest/icu/properties/sets/fn.grapheme_link.html) for more information.
+ /// Create a set for the `Grapheme_Link` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.graphemeLink(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_grapheme_link(provider._ffi);
+ /// See the [Rust documentation for `GraphemeLink`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeLink.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.graphemeLinkWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_grapheme_link_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Hex_Digit` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool hexDigitForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_hex_digit_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Hex_Digit` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `HexDigit`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HexDigit.html) for more information.
+ factory CodePointSetData.hexDigit() {
+ final result = _icu4x_CodePointSetData_create_hex_digit_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `hex_digit`](https://docs.rs/icu/latest/icu/properties/sets/fn.hex_digit.html) for more information.
+ /// Create a set for the `Hex_Digit` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.hexDigit(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_hex_digit(provider._ffi);
+ /// See the [Rust documentation for `HexDigit`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HexDigit.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.hexDigitWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_hex_digit_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Hyphen` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool hyphenForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_hyphen_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Hyphen` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Hyphen`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Hyphen.html) for more information.
+ factory CodePointSetData.hyphen() {
+ final result = _icu4x_CodePointSetData_create_hyphen_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `hyphen`](https://docs.rs/icu/latest/icu/properties/sets/fn.hyphen.html) for more information.
+ /// Create a set for the `Hyphen` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.hyphen(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_hyphen(provider._ffi);
+ /// See the [Rust documentation for `Hyphen`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Hyphen.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.hyphenWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_hyphen_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `id_continue`](https://docs.rs/icu/latest/icu/properties/sets/fn.id_continue.html) for more information.
+ /// Get the `Id_Continue` value for a given character, using compiled data
///
- /// Throws [Error] on failure.
- factory CodePointSetData.idContinue(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_id_continue(provider._ffi);
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool idContinueForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_id_continue_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Id_Continue` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `IdContinue`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdContinue.html) for more information.
+ factory CodePointSetData.idContinue() {
+ final result = _icu4x_CodePointSetData_create_id_continue_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Id_Continue` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `IdContinue`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdContinue.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.idContinueWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_id_continue_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Ideographic` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool ideographicForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_ideographic_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Ideographic` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Ideographic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Ideographic.html) for more information.
+ factory CodePointSetData.ideographic() {
+ final result = _icu4x_CodePointSetData_create_ideographic_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `ideographic`](https://docs.rs/icu/latest/icu/properties/sets/fn.ideographic.html) for more information.
+ /// Create a set for the `Ideographic` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.ideographic(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_ideographic(provider._ffi);
+ /// See the [Rust documentation for `Ideographic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Ideographic.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.ideographicWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_ideographic_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Id_Start` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool idStartForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_id_start_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Id_Start` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `IdStart`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdStart.html) for more information.
+ factory CodePointSetData.idStart() {
+ final result = _icu4x_CodePointSetData_create_id_start_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `id_start`](https://docs.rs/icu/latest/icu/properties/sets/fn.id_start.html) for more information.
+ /// Create a set for the `Id_Start` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.idStart(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_id_start(provider._ffi);
+ /// See the [Rust documentation for `IdStart`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdStart.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.idStartWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_id_start_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `ids_binary_operator`](https://docs.rs/icu/latest/icu/properties/sets/fn.ids_binary_operator.html) for more information.
+ /// Get the `Ids_Binary_Operator` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool idsBinaryOperatorForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_ids_binary_operator_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Ids_Binary_Operator` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `IdsBinaryOperator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdsBinaryOperator.html) for more information.
+ factory CodePointSetData.idsBinaryOperator() {
+ final result = _icu4x_CodePointSetData_create_ids_binary_operator_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Ids_Binary_Operator` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `IdsBinaryOperator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdsBinaryOperator.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.idsBinaryOperator(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_ids_binary_operator(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.idsBinaryOperatorWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_ids_binary_operator_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Ids_Trinary_Operator` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool idsTrinaryOperatorForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_ids_trinary_operator_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Ids_Trinary_Operator` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `IdsTrinaryOperator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdsTrinaryOperator.html) for more information.
+ factory CodePointSetData.idsTrinaryOperator() {
+ final result = _icu4x_CodePointSetData_create_ids_trinary_operator_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `ids_trinary_operator`](https://docs.rs/icu/latest/icu/properties/sets/fn.ids_trinary_operator.html) for more information.
+ /// Create a set for the `Ids_Trinary_Operator` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.idsTrinaryOperator(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_ids_trinary_operator(
- provider._ffi,
- );
+ /// See the [Rust documentation for `IdsTrinaryOperator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IdsTrinaryOperator.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.idsTrinaryOperatorWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_ids_trinary_operator_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Join_Control` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool joinControlForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_join_control_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Join_Control` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `JoinControl`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoinControl.html) for more information.
+ factory CodePointSetData.joinControl() {
+ final result = _icu4x_CodePointSetData_create_join_control_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `join_control`](https://docs.rs/icu/latest/icu/properties/sets/fn.join_control.html) for more information.
+ /// Create a set for the `Join_Control` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.joinControl(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_join_control(provider._ffi);
+ /// See the [Rust documentation for `JoinControl`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoinControl.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.joinControlWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_join_control_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Logical_Order_Exception` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool logicalOrderExceptionForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_logical_order_exception_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Logical_Order_Exception` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `LogicalOrderException`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LogicalOrderException.html) for more information.
+ factory CodePointSetData.logicalOrderException() {
+ final result = _icu4x_CodePointSetData_create_logical_order_exception_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `logical_order_exception`](https://docs.rs/icu/latest/icu/properties/sets/fn.logical_order_exception.html) for more information.
+ /// Create a set for the `Logical_Order_Exception` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.logicalOrderException(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_logical_order_exception(
- provider._ffi,
- );
+ /// See the [Rust documentation for `LogicalOrderException`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LogicalOrderException.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.logicalOrderExceptionWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_logical_order_exception_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Lowercase` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool lowercaseForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_lowercase_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Lowercase` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Lowercase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Lowercase.html) for more information.
+ factory CodePointSetData.lowercase() {
+ final result = _icu4x_CodePointSetData_create_lowercase_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `lowercase`](https://docs.rs/icu/latest/icu/properties/sets/fn.lowercase.html) for more information.
+ /// Create a set for the `Lowercase` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.lowercase(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_lowercase(provider._ffi);
+ /// See the [Rust documentation for `Lowercase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Lowercase.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.lowercaseWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_lowercase_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `math`](https://docs.rs/icu/latest/icu/properties/sets/fn.math.html) for more information.
+ /// Get the `Math` value for a given character, using compiled data
///
- /// Throws [Error] on failure.
- factory CodePointSetData.math(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_math(provider._ffi);
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool mathForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_math_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Math` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Math`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Math.html) for more information.
+ factory CodePointSetData.math() {
+ final result = _icu4x_CodePointSetData_create_math_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Math` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Math`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Math.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.mathWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_math_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Noncharacter_Code_Point` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool noncharacterCodePointForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_noncharacter_code_point_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Noncharacter_Code_Point` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `NoncharacterCodePoint`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NoncharacterCodePoint.html) for more information.
+ factory CodePointSetData.noncharacterCodePoint() {
+ final result = _icu4x_CodePointSetData_create_noncharacter_code_point_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `noncharacter_code_point`](https://docs.rs/icu/latest/icu/properties/sets/fn.noncharacter_code_point.html) for more information.
+ /// Create a set for the `Noncharacter_Code_Point` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.noncharacterCodePoint(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_noncharacter_code_point(
- provider._ffi,
- );
+ /// See the [Rust documentation for `NoncharacterCodePoint`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NoncharacterCodePoint.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.noncharacterCodePointWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_noncharacter_code_point_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Nfc_Inert` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool nfcInertForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_nfc_inert_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Nfc_Inert` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `NfcInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfcInert.html) for more information.
+ factory CodePointSetData.nfcInert() {
+ final result = _icu4x_CodePointSetData_create_nfc_inert_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `nfc_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfc_inert.html) for more information.
+ /// Create a set for the `Nfc_Inert` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.nfcInert(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_nfc_inert(provider._ffi);
+ /// See the [Rust documentation for `NfcInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfcInert.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.nfcInertWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_nfc_inert_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `nfd_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfd_inert.html) for more information.
+ /// Get the `Nfd_Inert` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool nfdInertForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_nfd_inert_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Nfd_Inert` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `NfdInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfdInert.html) for more information.
+ factory CodePointSetData.nfdInert() {
+ final result = _icu4x_CodePointSetData_create_nfd_inert_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Nfd_Inert` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `NfdInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfdInert.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.nfdInert(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_nfd_inert(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.nfdInertWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_nfd_inert_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Nfkc_Inert` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool nfkcInertForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_nfkc_inert_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Nfkc_Inert` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `NfkcInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfkcInert.html) for more information.
+ factory CodePointSetData.nfkcInert() {
+ final result = _icu4x_CodePointSetData_create_nfkc_inert_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `nfkc_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfkc_inert.html) for more information.
+ /// Create a set for the `Nfkc_Inert` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.nfkcInert(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_nfkc_inert(provider._ffi);
+ /// See the [Rust documentation for `NfkcInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfkcInert.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.nfkcInertWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_nfkc_inert_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `nfkd_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfkd_inert.html) for more information.
+ /// Get the `Nfkd_Inert` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool nfkdInertForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_nfkd_inert_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Nfkd_Inert` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `NfkdInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfkdInert.html) for more information.
+ factory CodePointSetData.nfkdInert() {
+ final result = _icu4x_CodePointSetData_create_nfkd_inert_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Nfkd_Inert` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `NfkdInert`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.NfkdInert.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.nfkdInert(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_nfkd_inert(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.nfkdInertWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_nfkd_inert_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Pattern_Syntax` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool patternSyntaxForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_pattern_syntax_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Pattern_Syntax` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `PatternSyntax`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.PatternSyntax.html) for more information.
+ factory CodePointSetData.patternSyntax() {
+ final result = _icu4x_CodePointSetData_create_pattern_syntax_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `pattern_syntax`](https://docs.rs/icu/latest/icu/properties/sets/fn.pattern_syntax.html) for more information.
+ /// Create a set for the `Pattern_Syntax` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.patternSyntax(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_pattern_syntax(provider._ffi);
+ /// See the [Rust documentation for `PatternSyntax`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.PatternSyntax.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.patternSyntaxWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_pattern_syntax_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Pattern_White_Space` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool patternWhiteSpaceForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_pattern_white_space_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Pattern_White_Space` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `PatternWhiteSpace`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.PatternWhiteSpace.html) for more information.
+ factory CodePointSetData.patternWhiteSpace() {
+ final result = _icu4x_CodePointSetData_create_pattern_white_space_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `pattern_white_space`](https://docs.rs/icu/latest/icu/properties/sets/fn.pattern_white_space.html) for more information.
+ /// Create a set for the `Pattern_White_Space` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.patternWhiteSpace(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_pattern_white_space(
- provider._ffi,
- );
+ /// See the [Rust documentation for `PatternWhiteSpace`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.PatternWhiteSpace.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.patternWhiteSpaceWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_pattern_white_space_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `prepended_concatenation_mark`](https://docs.rs/icu/latest/icu/properties/sets/fn.prepended_concatenation_mark.html) for more information.
+ /// Get the `Prepended_Concatenation_Mark` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool prependedConcatenationMarkForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_prepended_concatenation_mark_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Prepended_Concatenation_Mark` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `PrependedConcatenationMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.PrependedConcatenationMark.html) for more information.
+ factory CodePointSetData.prependedConcatenationMark() {
+ final result = _icu4x_CodePointSetData_create_prepended_concatenation_mark_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Prepended_Concatenation_Mark` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `PrependedConcatenationMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.PrependedConcatenationMark.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.prependedConcatenationMark(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_prepended_concatenation_mark(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.prependedConcatenationMarkWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_prepended_concatenation_mark_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `print`](https://docs.rs/icu/latest/icu/properties/sets/fn.print.html) for more information.
+ /// Get the `Print` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool printForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_print_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Print` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Print`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Print.html) for more information.
+ factory CodePointSetData.print() {
+ final result = _icu4x_CodePointSetData_create_print_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Print` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Print`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Print.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.print(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_print(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.printWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_print_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Quotation_Mark` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool quotationMarkForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_quotation_mark_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Quotation_Mark` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `QuotationMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.QuotationMark.html) for more information.
+ factory CodePointSetData.quotationMark() {
+ final result = _icu4x_CodePointSetData_create_quotation_mark_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `quotation_mark`](https://docs.rs/icu/latest/icu/properties/sets/fn.quotation_mark.html) for more information.
+ /// Create a set for the `Quotation_Mark` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.quotationMark(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_quotation_mark(provider._ffi);
+ /// See the [Rust documentation for `QuotationMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.QuotationMark.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.quotationMarkWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_quotation_mark_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Radical` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool radicalForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_radical_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Radical` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Radical`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Radical.html) for more information.
+ factory CodePointSetData.radical() {
+ final result = _icu4x_CodePointSetData_create_radical_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `radical`](https://docs.rs/icu/latest/icu/properties/sets/fn.radical.html) for more information.
+ /// Create a set for the `Radical` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.radical(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_radical(provider._ffi);
+ /// See the [Rust documentation for `Radical`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Radical.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.radicalWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_radical_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `regional_indicator`](https://docs.rs/icu/latest/icu/properties/sets/fn.regional_indicator.html) for more information.
+ /// Get the `Regional_Indicator` value for a given character, using compiled data
///
- /// Throws [Error] on failure.
- factory CodePointSetData.regionalIndicator(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_regional_indicator(
- provider._ffi,
- );
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool regionalIndicatorForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_regional_indicator_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Regional_Indicator` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.RegionalIndicator.html) for more information.
+ factory CodePointSetData.regionalIndicator() {
+ final result = _icu4x_CodePointSetData_create_regional_indicator_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Regional_Indicator` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.RegionalIndicator.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.regionalIndicatorWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_regional_indicator_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Soft_Dotted` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool softDottedForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_soft_dotted_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Soft_Dotted` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `SoftDotted`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SoftDotted.html) for more information.
+ factory CodePointSetData.softDotted() {
+ final result = _icu4x_CodePointSetData_create_soft_dotted_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `soft_dotted`](https://docs.rs/icu/latest/icu/properties/sets/fn.soft_dotted.html) for more information.
+ /// Create a set for the `Soft_Dotted` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.softDotted(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_soft_dotted(provider._ffi);
+ /// See the [Rust documentation for `SoftDotted`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SoftDotted.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.softDottedWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_soft_dotted_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Segment_Starter` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool segmentStarterForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_segment_starter_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Segment_Starter` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `SegmentStarter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SegmentStarter.html) for more information.
+ factory CodePointSetData.segmentStarter() {
+ final result = _icu4x_CodePointSetData_create_segment_starter_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `segment_starter`](https://docs.rs/icu/latest/icu/properties/sets/fn.segment_starter.html) for more information.
+ /// Create a set for the `Segment_Starter` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.segmentStarter(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_segment_starter(provider._ffi);
+ /// See the [Rust documentation for `SegmentStarter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SegmentStarter.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.segmentStarterWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_segment_starter_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Case_Sensitive` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool caseSensitiveForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_case_sensitive_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Case_Sensitive` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `CaseSensitive`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CaseSensitive.html) for more information.
+ factory CodePointSetData.caseSensitive() {
+ final result = _icu4x_CodePointSetData_create_case_sensitive_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `case_sensitive`](https://docs.rs/icu/latest/icu/properties/sets/fn.case_sensitive.html) for more information.
+ /// Create a set for the `Case_Sensitive` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.caseSensitive(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_case_sensitive(provider._ffi);
+ /// See the [Rust documentation for `CaseSensitive`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.CaseSensitive.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.caseSensitiveWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_case_sensitive_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Sentence_Terminal` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool sentenceTerminalForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_sentence_terminal_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Sentence_Terminal` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `SentenceTerminal`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceTerminal.html) for more information.
+ factory CodePointSetData.sentenceTerminal() {
+ final result = _icu4x_CodePointSetData_create_sentence_terminal_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `sentence_terminal`](https://docs.rs/icu/latest/icu/properties/sets/fn.sentence_terminal.html) for more information.
+ /// Create a set for the `Sentence_Terminal` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.sentenceTerminal(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_sentence_terminal(provider._ffi);
+ /// See the [Rust documentation for `SentenceTerminal`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceTerminal.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.sentenceTerminalWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_sentence_terminal_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `terminal_punctuation`](https://docs.rs/icu/latest/icu/properties/sets/fn.terminal_punctuation.html) for more information.
+ /// Get the `Terminal_Punctuation` value for a given character, using compiled data
///
- /// Throws [Error] on failure.
- factory CodePointSetData.terminalPunctuation(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_terminal_punctuation(
- provider._ffi,
- );
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool terminalPunctuationForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_terminal_punctuation_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Terminal_Punctuation` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `TerminalPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.TerminalPunctuation.html) for more information.
+ factory CodePointSetData.terminalPunctuation() {
+ final result = _icu4x_CodePointSetData_create_terminal_punctuation_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Terminal_Punctuation` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `TerminalPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.TerminalPunctuation.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.terminalPunctuationWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_terminal_punctuation_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Unified_Ideograph` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool unifiedIdeographForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_unified_ideograph_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Unified_Ideograph` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `UnifiedIdeograph`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.UnifiedIdeograph.html) for more information.
+ factory CodePointSetData.unifiedIdeograph() {
+ final result = _icu4x_CodePointSetData_create_unified_ideograph_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `unified_ideograph`](https://docs.rs/icu/latest/icu/properties/sets/fn.unified_ideograph.html) for more information.
+ /// Create a set for the `Unified_Ideograph` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.unifiedIdeograph(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_unified_ideograph(provider._ffi);
+ /// See the [Rust documentation for `UnifiedIdeograph`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.UnifiedIdeograph.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.unifiedIdeographWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_unified_ideograph_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Uppercase` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool uppercaseForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_uppercase_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Uppercase` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Uppercase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Uppercase.html) for more information.
+ factory CodePointSetData.uppercase() {
+ final result = _icu4x_CodePointSetData_create_uppercase_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `uppercase`](https://docs.rs/icu/latest/icu/properties/sets/fn.uppercase.html) for more information.
+ /// Create a set for the `Uppercase` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.uppercase(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_uppercase(provider._ffi);
+ /// See the [Rust documentation for `Uppercase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Uppercase.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.uppercaseWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_uppercase_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `variation_selector`](https://docs.rs/icu/latest/icu/properties/sets/fn.variation_selector.html) for more information.
+ /// Get the `Variation_Selector` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool variationSelectorForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_variation_selector_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Variation_Selector` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `VariationSelector`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VariationSelector.html) for more information.
+ factory CodePointSetData.variationSelector() {
+ final result = _icu4x_CodePointSetData_create_variation_selector_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Variation_Selector` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `VariationSelector`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VariationSelector.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.variationSelector(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_variation_selector(
- provider._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.variationSelectorWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_variation_selector_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `White_Space` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool whiteSpaceForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_white_space_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `White_Space` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `WhiteSpace`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WhiteSpace.html) for more information.
+ factory CodePointSetData.whiteSpace() {
+ final result = _icu4x_CodePointSetData_create_white_space_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `white_space`](https://docs.rs/icu/latest/icu/properties/sets/fn.white_space.html) for more information.
+ /// Create a set for the `White_Space` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.whiteSpace(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_white_space(provider._ffi);
+ /// See the [Rust documentation for `WhiteSpace`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WhiteSpace.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.whiteSpaceWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_white_space_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `xdigit`](https://docs.rs/icu/latest/icu/properties/sets/fn.xdigit.html) for more information.
+ /// Get the `Xdigit` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool xdigitForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_xdigit_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Xdigit` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `Xdigit`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Xdigit.html) for more information.
+ factory CodePointSetData.xdigit() {
+ final result = _icu4x_CodePointSetData_create_xdigit_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
+ /// Create a set for the `Xdigit` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Xdigit`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Xdigit.html) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.xdigit(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_xdigit(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.xdigitWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_xdigit_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Xid_Continue` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool xidContinueForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_xid_continue_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Xid_Continue` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `XidContinue`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.XidContinue.html) for more information.
+ factory CodePointSetData.xidContinue() {
+ final result = _icu4x_CodePointSetData_create_xid_continue_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `xid_continue`](https://docs.rs/icu/latest/icu/properties/sets/fn.xid_continue.html) for more information.
+ /// Create a set for the `Xid_Continue` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.xidContinue(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_xid_continue(provider._ffi);
+ /// See the [Rust documentation for `XidContinue`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.XidContinue.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.xidContinueWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_xid_continue_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+ /// Get the `Xid_Start` value for a given character, using compiled data
+ ///
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.BinaryProperty.html#tymethod.for_char) for more information.
+ static bool xidStartForChar(Rune ch) {
+ final result = _icu4x_CodePointSetData_xid_start_for_char_mv1(ch);
+ return result;
+ }
+
+ /// Create a set for the `Xid_Start` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `XidStart`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.XidStart.html) for more information.
+ factory CodePointSetData.xidStart() {
+ final result = _icu4x_CodePointSetData_create_xid_start_mv1();
+ return CodePointSetData._fromFfi(result, []);
+ }
+
- /// See the [Rust documentation for `xid_start`](https://docs.rs/icu/latest/icu/properties/sets/fn.xid_start.html) for more information.
+ /// Create a set for the `Xid_Start` property, using a particular data source.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.xidStart(DataProvider provider) {
- final result = _ICU4XCodePointSetData_load_xid_start(provider._ffi);
+ /// See the [Rust documentation for `XidStart`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.XidStart.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.xidStartWithProvider(DataProvider provider) {
+ final result = _icu4x_CodePointSetData_create_xid_start_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
- /// Loads data for a property specified as a string as long as it is one of the
- /// [ECMA-262 binary properties][ecma] (not including Any, ASCII, and Assigned pseudoproperties).
- ///
- /// Returns `Error::PropertyUnexpectedPropertyNameError` in case the string does not
- /// match any property in the list
- ///
/// [ecma]: https://tc39.es/ecma262/#table-binary-unicode-properties
///
- /// See the [Rust documentation for `for_ecma262`](https://docs.rs/icu/latest/icu/properties/sets/fn.for_ecma262.html) for more information.
+ /// See the [Rust documentation for `new_for_ecma262`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointSetData.html#method.new_for_ecma262) for more information.
///
- /// Throws [Error] on failure.
- factory CodePointSetData.forEcma262(
- DataProvider provider,
- String propertyName,
- ) {
- final temp = ffi2.Arena();
- final propertyNameView = propertyName.utf8View;
- final result = _ICU4XCodePointSetData_load_for_ecma262(
- provider._ffi,
- propertyNameView.allocIn(temp),
- propertyNameView.length,
- );
- temp.releaseAll();
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.forEcma262(String propertyName) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_CodePointSetData_create_for_ecma262_mv1(propertyName._utf8AllocIn(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return CodePointSetData._fromFfi(result.union.ok, []);
}
+
+ /// [ecma]: https://tc39.es/ecma262/#table-binary-unicode-properties
+ ///
+ /// See the [Rust documentation for `new_for_ecma262`](https://docs.rs/icu/2.0.0/icu/properties/struct.CodePointSetData.html#method.new_for_ecma262) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory CodePointSetData.forEcma262WithProvider(DataProvider provider, String propertyName) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_CodePointSetData_create_for_ecma262_with_provider_mv1(provider._ffi, propertyName._utf8AllocIn(temp.arena));
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return CodePointSetData._fromFfi(result.union.ok, []);
+ }
+
}
-@_DiplomatFfiUse('ICU4XCodePointSetData_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_destroy',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCodePointSetData_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_CodePointSetData_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCodePointSetData_contains')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_contains',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_contains_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_contains_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XCodePointSetData_contains(
- ffi.Pointer<ffi.Opaque> self,
- Rune cp,
-);
+external bool _icu4x_CodePointSetData_contains_mv1(ffi.Pointer<ffi.Opaque> self, Rune cp);
-@_DiplomatFfiUse('ICU4XCodePointSetData_iter_ranges')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_iter_ranges',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_iter_ranges_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_iter_ranges_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCodePointSetData_iter_ranges(
- ffi.Pointer<ffi.Opaque> self,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_iter_ranges_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XCodePointSetData_iter_ranges_complemented')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_iter_ranges_complemented',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_iter_ranges_complemented_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_iter_ranges_complemented_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XCodePointSetData_iter_ranges_complemented(ffi.Pointer<ffi.Opaque> self);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_iter_ranges_complemented_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_for_general_category_group')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_for_general_category_group',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_general_category_group_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(_GeneralCategoryGroupFfi)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_general_category_group_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XCodePointSetData_load_for_general_category_group(
- ffi.Pointer<ffi.Opaque> provider,
- int group,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_general_category_group_mv1(_GeneralCategoryGroupFfi group);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_ascii_hex_digit')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_ascii_hex_digit',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_general_category_group_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_general_category_group_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ascii_hex_digit(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_general_category_group_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, int group);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_alnum')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_alnum',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_ascii_hex_digit_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_ascii_hex_digit_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_ascii_hex_digit_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ascii_hex_digit_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ascii_hex_digit_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_ascii_hex_digit_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ascii_hex_digit_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ascii_hex_digit_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_ascii_hex_digit_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_alnum_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_alnum_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_alnum_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_alnum_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_alnum_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_alnum_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_alnum_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_alnum_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_alnum_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_alphabetic_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_alphabetic_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_alphabetic_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_alphabetic_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_alphabetic_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_alphabetic_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_alphabetic_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_alphabetic_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_alphabetic_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_bidi_control_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_bidi_control_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_bidi_control_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_bidi_control_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_bidi_control_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_bidi_control_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_bidi_control_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_bidi_control_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_bidi_control_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_bidi_mirrored_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_bidi_mirrored_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_bidi_mirrored_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_bidi_mirrored_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_bidi_mirrored_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_bidi_mirrored_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_bidi_mirrored_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_bidi_mirrored_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_bidi_mirrored_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_blank_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_blank_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_blank_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_blank_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_blank_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_blank_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_blank_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_blank_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_blank_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_cased_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_cased_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_cased_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_cased_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_cased_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_cased_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_cased_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_cased_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_cased_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_case_ignorable_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_case_ignorable_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_case_ignorable_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_case_ignorable_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_case_ignorable_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_case_ignorable_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_case_ignorable_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_case_ignorable_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_case_ignorable_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_full_composition_exclusion_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_full_composition_exclusion_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_full_composition_exclusion_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_full_composition_exclusion_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_full_composition_exclusion_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_full_composition_exclusion_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_full_composition_exclusion_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_full_composition_exclusion_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_full_composition_exclusion_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_changes_when_casefolded_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_changes_when_casefolded_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_changes_when_casefolded_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_casefolded_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_casefolded_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_changes_when_casefolded_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_casefolded_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_casefolded_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_changes_when_casefolded_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_changes_when_casemapped_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_changes_when_casemapped_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_changes_when_casemapped_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_casemapped_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_casemapped_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_changes_when_casemapped_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_casemapped_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_casemapped_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_changes_when_casemapped_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_changes_when_nfkc_casefolded_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_changes_when_nfkc_casefolded_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_changes_when_nfkc_casefolded_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_changes_when_nfkc_casefolded_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_changes_when_lowercased_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_changes_when_lowercased_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_changes_when_lowercased_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_lowercased_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_lowercased_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_changes_when_lowercased_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_lowercased_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_lowercased_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_changes_when_lowercased_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_changes_when_titlecased_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_changes_when_titlecased_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_changes_when_titlecased_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_titlecased_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_titlecased_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_changes_when_titlecased_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_titlecased_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_titlecased_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_changes_when_titlecased_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_changes_when_uppercased_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_changes_when_uppercased_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_changes_when_uppercased_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_uppercased_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_uppercased_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_changes_when_uppercased_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_changes_when_uppercased_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_changes_when_uppercased_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_changes_when_uppercased_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_dash_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_dash_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_dash_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_dash_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_dash_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_dash_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_dash_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_dash_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_dash_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_deprecated_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_deprecated_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_deprecated_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_deprecated_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_deprecated_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_deprecated_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_deprecated_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_deprecated_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_deprecated_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_default_ignorable_code_point_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_default_ignorable_code_point_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_default_ignorable_code_point_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_default_ignorable_code_point_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_default_ignorable_code_point_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_default_ignorable_code_point_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_default_ignorable_code_point_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_default_ignorable_code_point_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_default_ignorable_code_point_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_diacritic_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_diacritic_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_diacritic_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_diacritic_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_diacritic_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_diacritic_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_diacritic_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_diacritic_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_diacritic_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_emoji_modifier_base_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_emoji_modifier_base_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_emoji_modifier_base_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_modifier_base_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_modifier_base_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_emoji_modifier_base_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_modifier_base_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_modifier_base_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_emoji_modifier_base_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_emoji_component_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_emoji_component_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_emoji_component_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_component_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_component_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_emoji_component_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_component_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_component_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_emoji_component_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_emoji_modifier_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_emoji_modifier_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_emoji_modifier_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_modifier_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_modifier_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_emoji_modifier_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_modifier_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_modifier_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_emoji_modifier_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_emoji_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_emoji_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_emoji_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_emoji_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_emoji_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_emoji_presentation_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_emoji_presentation_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_emoji_presentation_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_presentation_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_presentation_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_emoji_presentation_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_emoji_presentation_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_emoji_presentation_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_emoji_presentation_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_extender_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_extender_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_extender_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_extender_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_extender_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_extender_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_extender_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_extender_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_extender_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_extended_pictographic_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_extended_pictographic_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_extended_pictographic_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_extended_pictographic_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_extended_pictographic_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_extended_pictographic_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_extended_pictographic_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_extended_pictographic_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_extended_pictographic_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_graph_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_graph_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_graph_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_graph_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_graph_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_graph_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_graph_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_graph_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_graph_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_grapheme_base_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_grapheme_base_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_grapheme_base_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_grapheme_base_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_grapheme_base_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_grapheme_base_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_grapheme_base_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_grapheme_base_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_grapheme_base_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_grapheme_extend_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_grapheme_extend_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_grapheme_extend_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_grapheme_extend_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_grapheme_extend_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_grapheme_extend_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_grapheme_extend_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_grapheme_extend_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_grapheme_extend_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_grapheme_link_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_grapheme_link_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_grapheme_link_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_grapheme_link_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_grapheme_link_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_grapheme_link_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_grapheme_link_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_grapheme_link_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_grapheme_link_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_hex_digit_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_hex_digit_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_hex_digit_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_hex_digit_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_hex_digit_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_hex_digit_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_hex_digit_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_hex_digit_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_hex_digit_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_hyphen_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_hyphen_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_hyphen_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_hyphen_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_hyphen_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_hyphen_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_hyphen_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_hyphen_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_hyphen_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_id_continue_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_id_continue_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_id_continue_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_id_continue_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_id_continue_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_id_continue_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_id_continue_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_id_continue_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_id_continue_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_ideographic_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_ideographic_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_ideographic_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ideographic_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ideographic_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_ideographic_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ideographic_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ideographic_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_ideographic_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_id_start_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_id_start_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_id_start_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_id_start_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_id_start_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_id_start_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_id_start_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_id_start_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_id_start_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_ids_binary_operator_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_ids_binary_operator_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_ids_binary_operator_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ids_binary_operator_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ids_binary_operator_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_ids_binary_operator_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ids_binary_operator_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ids_binary_operator_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_ids_binary_operator_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_ids_trinary_operator_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_ids_trinary_operator_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_ids_trinary_operator_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ids_trinary_operator_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ids_trinary_operator_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_ids_trinary_operator_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_ids_trinary_operator_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_ids_trinary_operator_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_ids_trinary_operator_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_join_control_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_join_control_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_join_control_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_join_control_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_join_control_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_join_control_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_join_control_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_join_control_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_join_control_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_logical_order_exception_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_logical_order_exception_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_logical_order_exception_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_logical_order_exception_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_logical_order_exception_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_logical_order_exception_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_logical_order_exception_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_logical_order_exception_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_logical_order_exception_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_lowercase_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_lowercase_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_lowercase_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_lowercase_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_lowercase_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_lowercase_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_lowercase_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_lowercase_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_lowercase_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_math_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_math_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_math_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_math_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_math_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_math_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_math_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_math_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_math_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_noncharacter_code_point_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_noncharacter_code_point_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_noncharacter_code_point_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_noncharacter_code_point_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_noncharacter_code_point_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_noncharacter_code_point_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_noncharacter_code_point_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_noncharacter_code_point_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_noncharacter_code_point_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_nfc_inert_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_nfc_inert_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_nfc_inert_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfc_inert_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfc_inert_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_nfc_inert_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfc_inert_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfc_inert_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_nfc_inert_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_nfd_inert_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_nfd_inert_for_char_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_CodePointSetData_nfd_inert_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfd_inert_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfd_inert_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_nfd_inert_mv1();
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfd_inert_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfd_inert_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_nfd_inert_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_CodePointSetData_nfkc_inert_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_nfkc_inert_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_alnum(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_nfkc_inert_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_alphabetic')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_alphabetic',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfkc_inert_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfkc_inert_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_alphabetic(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_nfkc_inert_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_bidi_control')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_bidi_control',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfkc_inert_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfkc_inert_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_bidi_control(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_nfkc_inert_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_bidi_mirrored')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_bidi_mirrored',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_nfkd_inert_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_nfkd_inert_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_bidi_mirrored(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_nfkd_inert_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_blank')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_blank',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfkd_inert_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfkd_inert_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_blank(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_nfkd_inert_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_cased')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_cased',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_nfkd_inert_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_nfkd_inert_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_cased(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_nfkd_inert_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_case_ignorable')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_case_ignorable',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_pattern_syntax_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_pattern_syntax_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_case_ignorable(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_pattern_syntax_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_full_composition_exclusion')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_full_composition_exclusion',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_pattern_syntax_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_pattern_syntax_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XCodePointSetData_load_full_composition_exclusion(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_pattern_syntax_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_changes_when_casefolded')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_changes_when_casefolded',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_pattern_syntax_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_pattern_syntax_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_casefolded(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_pattern_syntax_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_changes_when_casemapped')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_changes_when_casemapped',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_pattern_white_space_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_pattern_white_space_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_casemapped(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_pattern_white_space_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_changes_when_nfkc_casefolded')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_changes_when_nfkc_casefolded',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_pattern_white_space_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_pattern_white_space_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_pattern_white_space_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_changes_when_lowercased')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_changes_when_lowercased',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_pattern_white_space_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_pattern_white_space_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_lowercased(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_pattern_white_space_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_changes_when_titlecased')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_changes_when_titlecased',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_prepended_concatenation_mark_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_prepended_concatenation_mark_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_titlecased(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_prepended_concatenation_mark_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_changes_when_uppercased')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_changes_when_uppercased',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_prepended_concatenation_mark_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_prepended_concatenation_mark_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_uppercased(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_prepended_concatenation_mark_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_dash')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_dash',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_prepended_concatenation_mark_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_prepended_concatenation_mark_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_dash(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_prepended_concatenation_mark_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_deprecated')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_deprecated',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_print_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_print_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_deprecated(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_print_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_default_ignorable_code_point')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_default_ignorable_code_point',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_print_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_print_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XCodePointSetData_load_default_ignorable_code_point(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_print_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_diacritic')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_diacritic',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_print_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_print_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_diacritic(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_print_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_emoji_modifier_base')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_emoji_modifier_base',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_quotation_mark_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_quotation_mark_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_modifier_base(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_quotation_mark_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_emoji_component')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_emoji_component',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_quotation_mark_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_quotation_mark_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_component(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_quotation_mark_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_emoji_modifier')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_emoji_modifier',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_quotation_mark_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_quotation_mark_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_modifier(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_quotation_mark_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_emoji')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_emoji',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_radical_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_radical_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_radical_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_emoji_presentation')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_emoji_presentation',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_radical_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_radical_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_presentation(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_radical_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_extender')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_extender',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_radical_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_radical_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_extender(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_radical_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_extended_pictographic')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_extended_pictographic',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_regional_indicator_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_regional_indicator_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_extended_pictographic(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_regional_indicator_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_graph')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_graph',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_regional_indicator_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_regional_indicator_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_graph(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_regional_indicator_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_grapheme_base')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_grapheme_base',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_regional_indicator_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_regional_indicator_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_grapheme_base(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_regional_indicator_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_grapheme_extend')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_grapheme_extend',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_soft_dotted_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_soft_dotted_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_grapheme_extend(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_soft_dotted_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_grapheme_link')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_grapheme_link',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_soft_dotted_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_soft_dotted_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_grapheme_link(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_soft_dotted_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_hex_digit')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_hex_digit',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_soft_dotted_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_soft_dotted_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_hex_digit(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_soft_dotted_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_hyphen')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_hyphen',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_segment_starter_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_segment_starter_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_hyphen(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_segment_starter_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_id_continue')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_id_continue',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_segment_starter_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_segment_starter_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_id_continue(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_segment_starter_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_ideographic')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_ideographic',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_segment_starter_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_segment_starter_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ideographic(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_segment_starter_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_id_start')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_id_start',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_case_sensitive_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_case_sensitive_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_id_start(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_case_sensitive_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_ids_binary_operator')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_ids_binary_operator',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_case_sensitive_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_case_sensitive_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ids_binary_operator(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_case_sensitive_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_ids_trinary_operator')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_ids_trinary_operator',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_case_sensitive_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_case_sensitive_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ids_trinary_operator(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_case_sensitive_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_join_control')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_join_control',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_sentence_terminal_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_sentence_terminal_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_join_control(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_sentence_terminal_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_logical_order_exception')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_logical_order_exception',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_sentence_terminal_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_sentence_terminal_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_logical_order_exception(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_sentence_terminal_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_lowercase')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_lowercase',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_sentence_terminal_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_sentence_terminal_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_lowercase(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_sentence_terminal_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_math')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_math',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_terminal_punctuation_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_terminal_punctuation_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_math(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_terminal_punctuation_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_noncharacter_code_point')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_noncharacter_code_point',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_terminal_punctuation_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_terminal_punctuation_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_noncharacter_code_point(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_terminal_punctuation_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_nfc_inert')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_nfc_inert',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_terminal_punctuation_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_terminal_punctuation_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfc_inert(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_terminal_punctuation_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_nfd_inert')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_nfd_inert',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_unified_ideograph_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_unified_ideograph_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfd_inert(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_unified_ideograph_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_nfkc_inert')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_nfkc_inert',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_unified_ideograph_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_unified_ideograph_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfkc_inert(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_unified_ideograph_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_nfkd_inert')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_nfkd_inert',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_unified_ideograph_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_unified_ideograph_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfkd_inert(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_unified_ideograph_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_pattern_syntax')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_pattern_syntax',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_uppercase_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_uppercase_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_pattern_syntax(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_uppercase_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_pattern_white_space')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_pattern_white_space',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_uppercase_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_uppercase_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_pattern_white_space(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_uppercase_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_prepended_concatenation_mark')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_prepended_concatenation_mark',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_uppercase_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_uppercase_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XCodePointSetData_load_prepended_concatenation_mark(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_uppercase_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_print')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_print',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_variation_selector_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_variation_selector_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_print(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_variation_selector_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_quotation_mark')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_quotation_mark',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_variation_selector_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_variation_selector_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_quotation_mark(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_variation_selector_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_radical')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_radical',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_variation_selector_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_variation_selector_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_radical(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_variation_selector_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_regional_indicator')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_regional_indicator',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_white_space_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_white_space_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_regional_indicator(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_white_space_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_soft_dotted')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_soft_dotted',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_white_space_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_white_space_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_soft_dotted(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_white_space_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_segment_starter')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_segment_starter',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_white_space_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_white_space_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_segment_starter(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_white_space_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_case_sensitive')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_case_sensitive',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_xdigit_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_xdigit_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_case_sensitive(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_xdigit_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_sentence_terminal')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_sentence_terminal',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_xdigit_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_xdigit_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_sentence_terminal(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_xdigit_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_terminal_punctuation')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_terminal_punctuation',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_xdigit_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_xdigit_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_terminal_punctuation(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_xdigit_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_unified_ideograph')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_unified_ideograph',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_xid_continue_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_xid_continue_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_unified_ideograph(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_xid_continue_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_uppercase')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_uppercase',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_xid_continue_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_xid_continue_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_uppercase(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_xid_continue_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_variation_selector')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_variation_selector',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_xid_continue_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_xid_continue_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_variation_selector(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_xid_continue_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_white_space')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_white_space',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_xid_start_for_char_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_xid_start_for_char_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_white_space(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external bool _icu4x_CodePointSetData_xid_start_for_char_mv1(Rune ch);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_xdigit')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_xdigit',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_xid_start_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_xid_start_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_xdigit(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_CodePointSetData_create_xid_start_mv1();
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_xid_continue')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_xid_continue',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_xid_start_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_xid_start_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_xid_continue(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_xid_start_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_xid_start')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCodePointSetData_load_xid_start',
-)
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_for_ecma262_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_for_ecma262_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_xid_start(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_for_ecma262_mv1(_SliceUtf8 propertyName);
-@_DiplomatFfiUse('ICU4XCodePointSetData_load_for_ecma262')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_for_ecma262')
+@_DiplomatFfiUse('icu4x_CodePointSetData_create_for_ecma262_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CodePointSetData_create_for_ecma262_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_for_ecma262(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Uint8> propertyNameData,
- int propertyNameLength,
-);
+external _ResultOpaqueInt32 _icu4x_CodePointSetData_create_for_ecma262_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, _SliceUtf8 propertyName);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Collator.g.dart b/pkgs/intl4x/lib/src/bindings/Collator.g.dart
index c1e58c2..0718b52 100644
--- a/pkgs/intl4x/lib/src/bindings/Collator.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Collator.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `Collator`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html) for more information.
+/// See the [Rust documentation for `Collator`](https://docs.rs/icu/2.0.0/icu/collator/struct.Collator.html) for more information.
final class Collator implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,30 +21,33 @@
}
}
- @_DiplomatFfiUse('ICU4XCollator_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCollator_destroy),
- );
+ @_DiplomatFfiUse('icu4x_Collator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Collator_destroy_mv1));
- /// Construct a new Collator instance.
+ /// Construct a new Collator instance using compiled data.
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.try_new) for more information.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/collator/struct.Collator.html#method.try_new) for more information.
///
- /// Throws [Error] on failure.
- factory Collator(
- DataProvider provider,
- Locale locale,
- CollatorOptions options,
- ) {
- final temp = ffi2.Arena();
- final result = _ICU4XCollator_create_v1(
- provider._ffi,
- locale._ffi,
- options._toFfi(temp),
- );
- temp.releaseAll();
+ /// Throws [DataError] on failure.
+ factory Collator(Locale locale, CollatorOptions options) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Collator_create_v1_mv1(locale._ffi, options._toFfi(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return Collator._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct a new Collator instance using a particular data source.
+ ///
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/collator/struct.Collator.html#method.try_new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory Collator.createWithProvider(DataProvider provider, Locale locale, CollatorOptions options) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Collator_create_v1_with_provider_mv1(provider._ffi, locale._ffi, options._toFfi(temp.arena));
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return Collator._fromFfi(result.union.ok, []);
}
@@ -53,19 +57,10 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `compare_utf16`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare_utf16) for more information.
+ /// See the [Rust documentation for `compare_utf16`](https://docs.rs/icu/2.0.0/icu/collator/struct.CollatorBorrowed.html#method.compare_utf16) for more information.
int compare(String left, String right) {
- final temp = ffi2.Arena();
- final leftView = left.utf16View;
- final rightView = right.utf16View;
- final result = _ICU4XCollator_compare_utf16_(
- _ffi,
- leftView.allocIn(temp),
- leftView.length,
- rightView.allocIn(temp),
- rightView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_Collator_compare_utf16_mv1(_ffi, left._utf16AllocIn(temp.arena), right._utf16AllocIn(temp.arena));
return result;
}
@@ -73,61 +68,37 @@
/// and the options from locale data were combined. None of the struct fields
/// will have `Auto` as the value.
///
- /// See the [Rust documentation for `resolved_options`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.resolved_options) for more information.
- ResolvedCollatorOptions get resolvedOptions {
- final result = _ICU4XCollator_resolved_options(_ffi);
- return ResolvedCollatorOptions._fromFfi(result);
+ /// See the [Rust documentation for `resolved_options`](https://docs.rs/icu/2.0.0/icu/collator/struct.CollatorBorrowed.html#method.resolved_options) for more information.
+ CollatorResolvedOptions get resolvedOptions {
+ final result = _icu4x_Collator_resolved_options_v1_mv1(_ffi);
+ return CollatorResolvedOptions._fromFfi(result);
}
+
}
-@_DiplomatFfiUse('ICU4XCollator_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCollator_destroy',
-)
+@_DiplomatFfiUse('icu4x_Collator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Collator_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XCollator_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_Collator_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XCollator_create_v1')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- _CollatorOptionsFfi,
- )
->(isLeaf: true, symbol: 'ICU4XCollator_create_v1')
+@_DiplomatFfiUse('icu4x_Collator_create_v1_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _CollatorOptionsFfi)>(isLeaf: true, symbol: 'icu4x_Collator_create_v1_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCollator_create_v1(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- _CollatorOptionsFfi options,
-);
+external _ResultOpaqueInt32 _icu4x_Collator_create_v1_mv1(ffi.Pointer<ffi.Opaque> locale, _CollatorOptionsFfi options);
-@_DiplomatFfiUse('ICU4XCollator_compare_utf16_')
-@ffi.Native<
- ffi.Int8 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint16>,
- ffi.Size,
- ffi.Pointer<ffi.Uint16>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XCollator_compare_utf16_')
+@_DiplomatFfiUse('icu4x_Collator_create_v1_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _CollatorOptionsFfi)>(isLeaf: true, symbol: 'icu4x_Collator_create_v1_with_provider_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XCollator_compare_utf16_(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint16> leftData,
- int leftLength,
- ffi.Pointer<ffi.Uint16> rightData,
- int rightLength,
-);
+external _ResultOpaqueInt32 _icu4x_Collator_create_v1_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _CollatorOptionsFfi options);
-@_DiplomatFfiUse('ICU4XCollator_resolved_options')
-@ffi.Native<_ResolvedCollatorOptionsFfi Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCollator_resolved_options',
-)
+@_DiplomatFfiUse('icu4x_Collator_compare_utf16_mv1')
+@ffi.Native<ffi.Int8 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_Collator_compare_utf16_mv1')
// ignore: non_constant_identifier_names
-external _ResolvedCollatorOptionsFfi _ICU4XCollator_resolved_options(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_Collator_compare_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 left, _SliceUtf16 right);
+
+@_DiplomatFfiUse('icu4x_Collator_resolved_options_v1_mv1')
+@ffi.Native<_CollatorResolvedOptionsFfi Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Collator_resolved_options_v1_mv1')
+// ignore: non_constant_identifier_names
+external _CollatorResolvedOptionsFfi _icu4x_Collator_resolved_options_v1_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorAlternateHandling.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorAlternateHandling.g.dart
index 9bc6ca1..79f7bba 100644
--- a/pkgs/intl4x/lib/src/bindings/CollatorAlternateHandling.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CollatorAlternateHandling.g.dart
@@ -1,6 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `AlternateHandling`](https://docs.rs/icu/latest/icu/collator/enum.AlternateHandling.html) for more information.
-enum CollatorAlternateHandling { auto, nonIgnorable, shifted }
+/// See the [Rust documentation for `AlternateHandling`](https://docs.rs/icu/2.0.0/icu/collator/options/enum.AlternateHandling.html) for more information.
+enum CollatorAlternateHandling {
+
+ nonIgnorable,
+
+ shifted;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorBackwardSecondLevel.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorBackwardSecondLevel.g.dart
deleted file mode 100644
index 3129e9d..0000000
--- a/pkgs/intl4x/lib/src/bindings/CollatorBackwardSecondLevel.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `BackwardSecondLevel`](https://docs.rs/icu/latest/icu/collator/enum.BackwardSecondLevel.html) for more information.
-enum CollatorBackwardSecondLevel { auto, off, on }
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorCaseFirst.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorCaseFirst.g.dart
index 70b7dc0..285c942 100644
--- a/pkgs/intl4x/lib/src/bindings/CollatorCaseFirst.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CollatorCaseFirst.g.dart
@@ -1,6 +1,17 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `CaseFirst`](https://docs.rs/icu/latest/icu/collator/enum.CaseFirst.html) for more information.
-enum CollatorCaseFirst { auto, off, lowerFirst, upperFirst }
+/// See the [Rust documentation for `CollationCaseFirst`](https://docs.rs/icu/2.0.0/icu/collator/preferences/enum.CollationCaseFirst.html) for more information.
+enum CollatorCaseFirst {
+
+ off,
+
+ lower,
+
+ upper;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorCaseLevel.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorCaseLevel.g.dart
index 260b1d7..96f8345 100644
--- a/pkgs/intl4x/lib/src/bindings/CollatorCaseLevel.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CollatorCaseLevel.g.dart
@@ -1,6 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `CaseLevel`](https://docs.rs/icu/latest/icu/collator/enum.CaseLevel.html) for more information.
-enum CollatorCaseLevel { auto, off, on }
+/// See the [Rust documentation for `CaseLevel`](https://docs.rs/icu/2.0.0/icu/collator/options/enum.CaseLevel.html) for more information.
+enum CollatorCaseLevel {
+
+ off,
+
+ on;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorMaxVariable.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorMaxVariable.g.dart
index 0768e62..5869498 100644
--- a/pkgs/intl4x/lib/src/bindings/CollatorMaxVariable.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CollatorMaxVariable.g.dart
@@ -1,6 +1,19 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `MaxVariable`](https://docs.rs/icu/latest/icu/collator/enum.MaxVariable.html) for more information.
-enum CollatorMaxVariable { auto, space, punctuation, symbol, currency }
+/// See the [Rust documentation for `MaxVariable`](https://docs.rs/icu/2.0.0/icu/collator/options/enum.MaxVariable.html) for more information.
+enum CollatorMaxVariable {
+
+ space,
+
+ punctuation,
+
+ symbol,
+
+ currency;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorNumeric.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorNumeric.g.dart
deleted file mode 100644
index 50cae0c..0000000
--- a/pkgs/intl4x/lib/src/bindings/CollatorNumeric.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `Numeric`](https://docs.rs/icu/latest/icu/collator/enum.Numeric.html) for more information.
-enum CollatorNumeric { auto, off, on }
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorNumericOrdering.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorNumericOrdering.g.dart
new file mode 100644
index 0000000..af088e1
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/CollatorNumericOrdering.g.dart
@@ -0,0 +1,15 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `CollationNumericOrdering`](https://docs.rs/icu/2.0.0/icu/collator/preferences/enum.CollationNumericOrdering.html) for more information.
+enum CollatorNumericOrdering {
+
+ off,
+
+ on;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorOptions.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorOptions.g.dart
index 37a1dcb..401db08 100644
--- a/pkgs/intl4x/lib/src/bindings/CollatorOptions.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CollatorOptions.g.dart
@@ -1,43 +1,23 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
final class _CollatorOptionsFfi extends ffi.Struct {
- @ffi.Int32()
- external int strength;
- @ffi.Int32()
- external int alternateHandling;
- @ffi.Int32()
- external int caseFirst;
- @ffi.Int32()
- external int maxVariable;
- @ffi.Int32()
- external int caseLevel;
- @ffi.Int32()
- external int numeric;
- @ffi.Int32()
- external int backwardSecondLevel;
+ external _ResultInt32Void strength;
+ external _ResultInt32Void alternateHandling;
+ external _ResultInt32Void maxVariable;
+ external _ResultInt32Void caseLevel;
}
-/// See the [Rust documentation for `CollatorOptions`](https://docs.rs/icu/latest/icu/collator/struct.CollatorOptions.html) for more information.
+/// See the [Rust documentation for `CollatorOptions`](https://docs.rs/icu/2.0.0/icu/collator/options/struct.CollatorOptions.html) for more information.
final class CollatorOptions {
- CollatorStrength strength;
- CollatorAlternateHandling alternateHandling;
- CollatorCaseFirst caseFirst;
- CollatorMaxVariable maxVariable;
- CollatorCaseLevel caseLevel;
- CollatorNumeric numeric;
- CollatorBackwardSecondLevel backwardSecondLevel;
+ CollatorStrength? strength;
+ CollatorAlternateHandling? alternateHandling;
+ CollatorMaxVariable? maxVariable;
+ CollatorCaseLevel? caseLevel;
- CollatorOptions({
- required this.strength,
- required this.alternateHandling,
- required this.caseFirst,
- required this.maxVariable,
- required this.caseLevel,
- required this.numeric,
- required this.backwardSecondLevel,
- });
+ CollatorOptions({this.strength, this.alternateHandling, this.maxVariable, this.caseLevel});
// This struct contains borrowed fields, so this takes in a list of
// "edges" corresponding to where each lifetime's data may have been borrowed from
@@ -45,49 +25,42 @@
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
- CollatorOptions._fromFfi(_CollatorOptionsFfi ffi)
- : strength = CollatorStrength.values[ffi.strength],
- alternateHandling =
- CollatorAlternateHandling.values[ffi.alternateHandling],
- caseFirst = CollatorCaseFirst.values[ffi.caseFirst],
- maxVariable = CollatorMaxVariable.values[ffi.maxVariable],
- caseLevel = CollatorCaseLevel.values[ffi.caseLevel],
- numeric = CollatorNumeric.values[ffi.numeric],
- backwardSecondLevel =
- CollatorBackwardSecondLevel.values[ffi.backwardSecondLevel];
+ CollatorOptions._fromFfi(_CollatorOptionsFfi ffi) :
+ strength = ffi.strength.isOk ? CollatorStrength.values[ffi.strength.union.ok] : null,
+ alternateHandling = ffi.alternateHandling.isOk ? CollatorAlternateHandling.values[ffi.alternateHandling.union.ok] : null,
+ maxVariable = ffi.maxVariable.isOk ? CollatorMaxVariable.values[ffi.maxVariable.union.ok] : null,
+ caseLevel = ffi.caseLevel.isOk ? CollatorCaseLevel.values[ffi.caseLevel.union.ok] : null;
// ignore: unused_element
_CollatorOptionsFfi _toFfi(ffi.Allocator temp) {
final struct = ffi.Struct.create<_CollatorOptionsFfi>();
- struct.strength = strength.index;
- struct.alternateHandling = alternateHandling.index;
- struct.caseFirst = caseFirst.index;
- struct.maxVariable = maxVariable.index;
- struct.caseLevel = caseLevel.index;
- struct.numeric = numeric.index;
- struct.backwardSecondLevel = backwardSecondLevel.index;
+ CollatorStrength? strength = this.strength;
+ struct.strength = strength != null ? _ResultInt32Void.ok(strength.index) : _ResultInt32Void.err();
+ CollatorAlternateHandling? alternateHandling = this.alternateHandling;
+ struct.alternateHandling = alternateHandling != null ? _ResultInt32Void.ok(alternateHandling.index) : _ResultInt32Void.err();
+ CollatorMaxVariable? maxVariable = this.maxVariable;
+ struct.maxVariable = maxVariable != null ? _ResultInt32Void.ok(maxVariable.index) : _ResultInt32Void.err();
+ CollatorCaseLevel? caseLevel = this.caseLevel;
+ struct.caseLevel = caseLevel != null ? _ResultInt32Void.ok(caseLevel.index) : _ResultInt32Void.err();
return struct;
}
+
@override
bool operator ==(Object other) =>
other is CollatorOptions &&
other.strength == strength &&
other.alternateHandling == alternateHandling &&
- other.caseFirst == caseFirst &&
other.maxVariable == maxVariable &&
- other.caseLevel == caseLevel &&
- other.numeric == numeric &&
- other.backwardSecondLevel == backwardSecondLevel;
+ other.caseLevel == caseLevel;
@override
int get hashCode => Object.hashAll([
- strength,
- alternateHandling,
- caseFirst,
- maxVariable,
- caseLevel,
- numeric,
- backwardSecondLevel,
- ]);
+ strength,
+ alternateHandling,
+ maxVariable,
+ caseLevel,
+ ]);
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorResolvedOptions.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorResolvedOptions.g.dart
new file mode 100644
index 0000000..57bee77
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/CollatorResolvedOptions.g.dart
@@ -0,0 +1,78 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _CollatorResolvedOptionsFfi extends ffi.Struct {
+ @ffi.Int32()
+ external int strength;
+ @ffi.Int32()
+ external int alternateHandling;
+ @ffi.Int32()
+ external int caseFirst;
+ @ffi.Int32()
+ external int maxVariable;
+ @ffi.Int32()
+ external int caseLevel;
+ @ffi.Int32()
+ external int numeric;
+}
+
+/// See the [Rust documentation for `ResolvedCollatorOptions`](https://docs.rs/icu/2.0.0/icu/collator/options/struct.ResolvedCollatorOptions.html) for more information.
+final class CollatorResolvedOptions {
+ final CollatorStrength strength;
+ final CollatorAlternateHandling alternateHandling;
+ final CollatorCaseFirst caseFirst;
+ final CollatorMaxVariable maxVariable;
+ final CollatorCaseLevel caseLevel;
+ final CollatorNumericOrdering numeric;
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ CollatorResolvedOptions._fromFfi(_CollatorResolvedOptionsFfi ffi) :
+ strength = CollatorStrength.values[ffi.strength],
+ alternateHandling = CollatorAlternateHandling.values[ffi.alternateHandling],
+ caseFirst = CollatorCaseFirst.values[ffi.caseFirst],
+ maxVariable = CollatorMaxVariable.values[ffi.maxVariable],
+ caseLevel = CollatorCaseLevel.values[ffi.caseLevel],
+ numeric = CollatorNumericOrdering.values[ffi.numeric];
+
+ // ignore: unused_element
+ _CollatorResolvedOptionsFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_CollatorResolvedOptionsFfi>();
+ struct.strength = strength.index;
+ struct.alternateHandling = alternateHandling.index;
+ struct.caseFirst = caseFirst.index;
+ struct.maxVariable = maxVariable.index;
+ struct.caseLevel = caseLevel.index;
+ struct.numeric = numeric.index;
+ return struct;
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is CollatorResolvedOptions &&
+ other.strength == strength &&
+ other.alternateHandling == alternateHandling &&
+ other.caseFirst == caseFirst &&
+ other.maxVariable == maxVariable &&
+ other.caseLevel == caseLevel &&
+ other.numeric == numeric;
+
+ @override
+ int get hashCode => Object.hashAll([
+ strength,
+ alternateHandling,
+ caseFirst,
+ maxVariable,
+ caseLevel,
+ numeric,
+ ]);
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CollatorStrength.g.dart b/pkgs/intl4x/lib/src/bindings/CollatorStrength.g.dart
index f1f8275..6a746df 100644
--- a/pkgs/intl4x/lib/src/bindings/CollatorStrength.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/CollatorStrength.g.dart
@@ -1,10 +1,10 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `Strength`](https://docs.rs/icu/latest/icu/collator/enum.Strength.html) for more information.
+/// See the [Rust documentation for `Strength`](https://docs.rs/icu/2.0.0/icu/collator/options/enum.Strength.html) for more information.
enum CollatorStrength {
- auto,
primary,
@@ -14,5 +14,8 @@
quaternary,
- identical,
+ identical;
+
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ComposingNormalizer.g.dart b/pkgs/intl4x/lib/src/bindings/ComposingNormalizer.g.dart
index bdbd2df..36e89b7 100644
--- a/pkgs/intl4x/lib/src/bindings/ComposingNormalizer.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ComposingNormalizer.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `ComposingNormalizer`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html) for more information.
+/// See the [Rust documentation for `ComposingNormalizer`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizer.html) for more information.
final class ComposingNormalizer implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,33 +21,47 @@
}
}
- @_DiplomatFfiUse('ICU4XComposingNormalizer_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XComposingNormalizer_destroy),
- );
+ @_DiplomatFfiUse('icu4x_ComposingNormalizer_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ComposingNormalizer_destroy_mv1));
- /// Construct a new ICU4XComposingNormalizer instance for NFC
+ /// Construct a new ComposingNormalizer instance for NFC using compiled data.
///
- /// See the [Rust documentation for `new_nfc`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfc) for more information.
+ /// See the [Rust documentation for `new_nfc`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfc) for more information.
+ factory ComposingNormalizer.nfc() {
+ final result = _icu4x_ComposingNormalizer_create_nfc_mv1();
+ return ComposingNormalizer._fromFfi(result, []);
+ }
+
+ /// Construct a new ComposingNormalizer instance for NFC using a particular data source.
///
- /// Throws [Error] on failure.
- factory ComposingNormalizer.nfc(DataProvider provider) {
- final result = _ICU4XComposingNormalizer_create_nfc(provider._ffi);
+ /// See the [Rust documentation for `new_nfc`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfc) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ComposingNormalizer.nfcWithProvider(DataProvider provider) {
+ final result = _icu4x_ComposingNormalizer_create_nfc_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return ComposingNormalizer._fromFfi(result.union.ok, []);
}
- /// Construct a new ICU4XComposingNormalizer instance for NFKC
+ /// Construct a new ComposingNormalizer instance for NFKC using compiled data.
///
- /// See the [Rust documentation for `new_nfkc`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfkc) for more information.
+ /// See the [Rust documentation for `new_nfkc`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfkc) for more information.
+ factory ComposingNormalizer.nfkc() {
+ final result = _icu4x_ComposingNormalizer_create_nfkc_mv1();
+ return ComposingNormalizer._fromFfi(result, []);
+ }
+
+ /// Construct a new ComposingNormalizer instance for NFKC using a particular data source.
///
- /// Throws [Error] on failure.
- factory ComposingNormalizer.nfkc(DataProvider provider) {
- final result = _ICU4XComposingNormalizer_create_nfkc(provider._ffi);
+ /// See the [Rust documentation for `new_nfkc`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfkc) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ComposingNormalizer.nfkcWithProvider(DataProvider provider) {
+ final result = _icu4x_ComposingNormalizer_create_nfkc_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return ComposingNormalizer._fromFfi(result.union.ok, []);
}
@@ -56,24 +71,12 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.normalize_utf8) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizerBorrowed.html#method.normalize_utf8) for more information.
String normalize(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XComposingNormalizer_normalize(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_ComposingNormalizer_normalize_mv1(_ffi, s._utf8AllocIn(temp.arena), write._ffi);
+ return write.finalize();
}
/// Check if a string is normalized
@@ -81,72 +84,62 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `is_normalized_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.is_normalized_utf8) for more information.
+ /// See the [Rust documentation for `is_normalized_utf16`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizerBorrowed.html#method.is_normalized_utf16) for more information.
bool isNormalized(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XComposingNormalizer_is_normalized(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_ComposingNormalizer_is_normalized_utf16_mv1(_ffi, s._utf16AllocIn(temp.arena));
return result;
}
+
+ /// Return the index a slice of potentially-invalid UTF-16 is normalized up to
+ ///
+ /// See the [Rust documentation for `split_normalized_utf16`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.ComposingNormalizerBorrowed.html#method.split_normalized_utf16) for more information.
+ int isNormalizedUpTo(String s) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_ComposingNormalizer_is_normalized_utf16_up_to_mv1(_ffi, s._utf16AllocIn(temp.arena));
+ return result;
+ }
+
}
-@_DiplomatFfiUse('ICU4XComposingNormalizer_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XComposingNormalizer_destroy',
-)
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XComposingNormalizer_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_ComposingNormalizer_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XComposingNormalizer_create_nfc')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XComposingNormalizer_create_nfc',
-)
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_create_nfc_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_create_nfc_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XComposingNormalizer_create_nfc(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_ComposingNormalizer_create_nfc_mv1();
-@_DiplomatFfiUse('ICU4XComposingNormalizer_create_nfkc')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XComposingNormalizer_create_nfkc',
-)
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_create_nfc_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_create_nfc_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XComposingNormalizer_create_nfkc(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_ComposingNormalizer_create_nfc_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XComposingNormalizer_normalize')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XComposingNormalizer_normalize')
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_create_nfkc_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_create_nfkc_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XComposingNormalizer_normalize(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_ComposingNormalizer_create_nfkc_mv1();
-@_DiplomatFfiUse('ICU4XComposingNormalizer_is_normalized')
-@ffi.Native<
- ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XComposingNormalizer_is_normalized')
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_create_nfkc_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_create_nfkc_with_provider_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XComposingNormalizer_is_normalized(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
-);
+external _ResultOpaqueInt32 _icu4x_ComposingNormalizer_create_nfkc_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_normalize_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_normalize_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_ComposingNormalizer_normalize_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> write);
+
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_is_normalized_utf16_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_is_normalized_utf16_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_ComposingNormalizer_is_normalized_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 s);
+
+@_DiplomatFfiUse('icu4x_ComposingNormalizer_is_normalized_utf16_up_to_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_ComposingNormalizer_is_normalized_utf16_up_to_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_ComposingNormalizer_is_normalized_utf16_up_to_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 s);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/CustomTimeZone.g.dart b/pkgs/intl4x/lib/src/bindings/CustomTimeZone.g.dart
deleted file mode 100644
index 2dc076b..0000000
--- a/pkgs/intl4x/lib/src/bindings/CustomTimeZone.g.dart
+++ /dev/null
@@ -1,731 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `CustomTimeZone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html) for more information.
-final class CustomTimeZone implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- CustomTimeZone._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XCustomTimeZone_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XCustomTimeZone_destroy),
- );
-
- /// Creates a time zone from an offset string.
- ///
- /// See the [Rust documentation for `from_str`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.from_str) for more information.
- ///
- /// Throws [Error] on failure.
- factory CustomTimeZone.fromString(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XCustomTimeZone_create_from_string(
- sView.allocIn(temp),
- sView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return CustomTimeZone._fromFfi(result.union.ok, []);
- }
-
- /// Creates a time zone with no information.
- ///
- /// See the [Rust documentation for `new_empty`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.new_empty) for more information.
- factory CustomTimeZone.empty() {
- final result = _ICU4XCustomTimeZone_create_empty();
- return CustomTimeZone._fromFfi(result, []);
- }
-
- /// Creates a time zone for UTC.
- ///
- /// See the [Rust documentation for `utc`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.utc) for more information.
- factory CustomTimeZone.utc() {
- final result = _ICU4XCustomTimeZone_create_utc();
- return CustomTimeZone._fromFfi(result, []);
- }
-
- /// Sets the `gmt_offset` field from offset seconds.
- ///
- /// Errors if the offset seconds are out of range.
- ///
- /// See the [Rust documentation for `try_from_offset_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.try_from_offset_seconds) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html)
- ///
- /// Throws [Error] on failure.
- void trySetGmtOffsetSeconds(int offsetSeconds) {
- final result = _ICU4XCustomTimeZone_try_set_gmt_offset_seconds(
- _ffi,
- offsetSeconds,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- }
-
- /// Clears the `gmt_offset` field.
- ///
- /// See the [Rust documentation for `offset_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html)
- void clearGmtOffset() {
- _ICU4XCustomTimeZone_clear_gmt_offset(_ffi);
- }
-
- /// Returns the value of the `gmt_offset` field as offset seconds.
- ///
- /// Errors if the `gmt_offset` field is empty.
- ///
- /// See the [Rust documentation for `offset_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html)
- ///
- /// Throws [Error] on failure.
- int get gmtOffsetSeconds {
- final result = _ICU4XCustomTimeZone_gmt_offset_seconds(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return result.union.ok;
- }
-
- /// Returns whether the `gmt_offset` field is positive.
- ///
- /// Errors if the `gmt_offset` field is empty.
- ///
- /// See the [Rust documentation for `is_positive`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_positive) for more information.
- ///
- /// Throws [Error] on failure.
- bool get isGmtOffsetPositive {
- final result = _ICU4XCustomTimeZone_is_gmt_offset_positive(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return result.union.ok;
- }
-
- /// Returns whether the `gmt_offset` field is zero.
- ///
- /// Errors if the `gmt_offset` field is empty (which is not the same as zero).
- ///
- /// See the [Rust documentation for `is_zero`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_zero) for more information.
- ///
- /// Throws [Error] on failure.
- bool get isGmtOffsetZero {
- final result = _ICU4XCustomTimeZone_is_gmt_offset_zero(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return result.union.ok;
- }
-
- /// Returns whether the `gmt_offset` field has nonzero minutes.
- ///
- /// Errors if the `gmt_offset` field is empty.
- ///
- /// See the [Rust documentation for `has_minutes`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_minutes) for more information.
- ///
- /// Throws [Error] on failure.
- bool get gmtOffsetHasMinutes {
- final result = _ICU4XCustomTimeZone_gmt_offset_has_minutes(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return result.union.ok;
- }
-
- /// Returns whether the `gmt_offset` field has nonzero seconds.
- ///
- /// Errors if the `gmt_offset` field is empty.
- ///
- /// See the [Rust documentation for `has_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_seconds) for more information.
- ///
- /// Throws [Error] on failure.
- bool get gmtOffsetHasSeconds {
- final result = _ICU4XCustomTimeZone_gmt_offset_has_seconds(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return result.union.ok;
- }
-
- /// Sets the `time_zone_id` field from a BCP-47 string.
- ///
- /// Errors if the string is not a valid BCP-47 time zone ID.
- ///
- /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html)
- ///
- /// Throws [Error] on failure.
- void trySetTimeZoneId(String id) {
- final temp = ffi2.Arena();
- final idView = id.utf8View;
- final result = _ICU4XCustomTimeZone_try_set_time_zone_id(
- _ffi,
- idView.allocIn(temp),
- idView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- }
-
- /// Sets the `time_zone_id` field from an IANA string by looking up
- /// the corresponding BCP-47 string.
- ///
- /// Errors if the string is not a valid BCP-47 time zone ID.
- ///
- /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/timezone/struct.IanaToBcp47MapperBorrowed.html#method.get) for more information.
- ///
- /// Throws [Error] on failure.
- void trySetIanaTimeZoneId(IanaToBcp47Mapper mapper, String id) {
- final temp = ffi2.Arena();
- final idView = id.utf8View;
- final result = _ICU4XCustomTimeZone_try_set_iana_time_zone_id(
- _ffi,
- mapper._ffi,
- idView.allocIn(temp),
- idView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- }
-
- /// Sets the `time_zone_id` field from an IANA string by looking up
- /// the corresponding BCP-47 string.
- ///
- /// Errors if the string is not a valid BCP-47 time zone ID.
- ///
- /// Throws [Error] on failure.
- void trySetIanaTimeZoneId2(TimeZoneIdMapper mapper, String id) {
- final temp = ffi2.Arena();
- final idView = id.utf8View;
- final result = _ICU4XCustomTimeZone_try_set_iana_time_zone_id_2(
- _ffi,
- mapper._ffi,
- idView.allocIn(temp),
- idView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- }
-
- /// Clears the `time_zone_id` field.
- ///
- /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html)
- void clearTimeZoneId() {
- _ICU4XCustomTimeZone_clear_time_zone_id(_ffi);
- }
-
- /// Writes the value of the `time_zone_id` field as a string.
- ///
- /// Errors if the `time_zone_id` field is empty.
- ///
- /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html)
- ///
- /// Throws [Error] on failure.
- String get timeZoneId {
- final writeable = _Writeable();
- final result = _ICU4XCustomTimeZone_time_zone_id(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// Sets the `metazone_id` field from a string.
- ///
- /// Errors if the string is not a valid BCP-47 metazone ID.
- ///
- /// See the [Rust documentation for `metazone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html)
- ///
- /// Throws [Error] on failure.
- void trySetMetazoneId(String id) {
- final temp = ffi2.Arena();
- final idView = id.utf8View;
- final result = _ICU4XCustomTimeZone_try_set_metazone_id(
- _ffi,
- idView.allocIn(temp),
- idView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- }
-
- /// Clears the `metazone_id` field.
- ///
- /// See the [Rust documentation for `metazone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html)
- void clearMetazoneId() {
- _ICU4XCustomTimeZone_clear_metazone_id(_ffi);
- }
-
- /// Writes the value of the `metazone_id` field as a string.
- ///
- /// Errors if the `metazone_id` field is empty.
- ///
- /// See the [Rust documentation for `metazone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html)
- ///
- /// Throws [Error] on failure.
- String get metazoneId {
- final writeable = _Writeable();
- final result = _ICU4XCustomTimeZone_metazone_id(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// Sets the `zone_variant` field from a string.
- ///
- /// Errors if the string is not a valid zone variant.
- ///
- /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html)
- ///
- /// Throws [Error] on failure.
- void trySetZoneVariant(String id) {
- final temp = ffi2.Arena();
- final idView = id.utf8View;
- final result = _ICU4XCustomTimeZone_try_set_zone_variant(
- _ffi,
- idView.allocIn(temp),
- idView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- }
-
- /// Clears the `zone_variant` field.
- ///
- /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html)
- void clearZoneVariant() {
- _ICU4XCustomTimeZone_clear_zone_variant(_ffi);
- }
-
- /// Writes the value of the `zone_variant` field as a string.
- ///
- /// Errors if the `zone_variant` field is empty.
- ///
- /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html)
- ///
- /// Throws [Error] on failure.
- String get zoneVariant {
- final writeable = _Writeable();
- final result = _ICU4XCustomTimeZone_zone_variant(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// Sets the `zone_variant` field to "standard" time, which may or may
- /// not correspond to a display name with "Standard" in its name.
- ///
- /// See the [Rust documentation for `standard`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant)
- void setStandardTime() {
- _ICU4XCustomTimeZone_set_standard_time(_ffi);
- }
-
- /// Sets the `zone_variant` field to "daylight" time, which may or may
- /// not correspond to a display name with "Daylight" in its name.
- ///
- /// See the [Rust documentation for `daylight`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant)
- void setDaylightTime() {
- _ICU4XCustomTimeZone_set_daylight_time(_ffi);
- }
-
- /// Returns whether the `zone_variant` field is standard time.
- ///
- /// Errors if the `zone_variant` field is empty.
- ///
- /// See the [Rust documentation for `standard`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant)
- ///
- /// Throws [Error] on failure.
- bool get isStandardTime {
- final result = _ICU4XCustomTimeZone_is_standard_time(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return result.union.ok;
- }
-
- /// Returns whether the `zone_variant` field is daylight time.
- ///
- /// Errors if the `zone_variant` field is empty.
- ///
- /// See the [Rust documentation for `daylight`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant)
- ///
- /// Throws [Error] on failure.
- bool get isDaylightTime {
- final result = _ICU4XCustomTimeZone_is_daylight_time(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return result.union.ok;
- }
-
- /// Sets the metazone based on the time zone and the local timestamp.
- ///
- /// See the [Rust documentation for `maybe_calculate_metazone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.maybe_calculate_metazone) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.compute_metazone_from_time_zone)
- void maybeCalculateMetazone(
- MetazoneCalculator metazoneCalculator,
- IsoDateTime localDatetime,
- ) {
- _ICU4XCustomTimeZone_maybe_calculate_metazone(
- _ffi,
- metazoneCalculator._ffi,
- localDatetime._ffi,
- );
- }
-}
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_create_from_string')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_create_from_string',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XCustomTimeZone_create_from_string(
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_create_empty')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_create_empty',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCustomTimeZone_create_empty();
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_create_utc')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_create_utc',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XCustomTimeZone_create_utc();
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_try_set_gmt_offset_seconds')
-@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_try_set_gmt_offset_seconds',
-)
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_gmt_offset_seconds(
- ffi.Pointer<ffi.Opaque> self,
- int offsetSeconds,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_clear_gmt_offset')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_clear_gmt_offset',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_clear_gmt_offset(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_gmt_offset_seconds')
-@ffi.Native<_ResultInt32Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_gmt_offset_seconds',
-)
-// ignore: non_constant_identifier_names
-external _ResultInt32Int32 _ICU4XCustomTimeZone_gmt_offset_seconds(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_is_gmt_offset_positive')
-@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_is_gmt_offset_positive',
-)
-// ignore: non_constant_identifier_names
-external _ResultBoolInt32 _ICU4XCustomTimeZone_is_gmt_offset_positive(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_is_gmt_offset_zero')
-@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_is_gmt_offset_zero',
-)
-// ignore: non_constant_identifier_names
-external _ResultBoolInt32 _ICU4XCustomTimeZone_is_gmt_offset_zero(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_gmt_offset_has_minutes')
-@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_gmt_offset_has_minutes',
-)
-// ignore: non_constant_identifier_names
-external _ResultBoolInt32 _ICU4XCustomTimeZone_gmt_offset_has_minutes(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_gmt_offset_has_seconds')
-@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_gmt_offset_has_seconds',
-)
-// ignore: non_constant_identifier_names
-external _ResultBoolInt32 _ICU4XCustomTimeZone_gmt_offset_has_seconds(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_try_set_time_zone_id')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_time_zone_id')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_time_zone_id(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> idData,
- int idLength,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_try_set_iana_time_zone_id')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_iana_time_zone_id')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_iana_time_zone_id(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> mapper,
- ffi.Pointer<ffi.Uint8> idData,
- int idLength,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_try_set_iana_time_zone_id_2')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_iana_time_zone_id_2')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_iana_time_zone_id_2(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> mapper,
- ffi.Pointer<ffi.Uint8> idData,
- int idLength,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_clear_time_zone_id')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_clear_time_zone_id',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_clear_time_zone_id(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_time_zone_id')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_time_zone_id')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_time_zone_id(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_try_set_metazone_id')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_metazone_id')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_metazone_id(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> idData,
- int idLength,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_clear_metazone_id')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_clear_metazone_id',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_clear_metazone_id(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_metazone_id')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_metazone_id')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_metazone_id(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_try_set_zone_variant')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_zone_variant')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_zone_variant(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> idData,
- int idLength,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_clear_zone_variant')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_clear_zone_variant',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_clear_zone_variant(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_zone_variant')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_zone_variant')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XCustomTimeZone_zone_variant(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_set_standard_time')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_set_standard_time',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_set_standard_time(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_set_daylight_time')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_set_daylight_time',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_set_daylight_time(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_is_standard_time')
-@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_is_standard_time',
-)
-// ignore: non_constant_identifier_names
-external _ResultBoolInt32 _ICU4XCustomTimeZone_is_standard_time(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_is_daylight_time')
-@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XCustomTimeZone_is_daylight_time',
-)
-// ignore: non_constant_identifier_names
-external _ResultBoolInt32 _ICU4XCustomTimeZone_is_daylight_time(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XCustomTimeZone_maybe_calculate_metazone')
-@ffi.Native<
- ffi.Void Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XCustomTimeZone_maybe_calculate_metazone')
-// ignore: non_constant_identifier_names
-external void _ICU4XCustomTimeZone_maybe_calculate_metazone(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> metazoneCalculator,
- ffi.Pointer<ffi.Opaque> localDatetime,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/DataError.g.dart b/pkgs/intl4x/lib/src/bindings/DataError.g.dart
new file mode 100644
index 0000000..38b1452
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DataError.g.dart
@@ -0,0 +1,29 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/icu_provider/2.0.0/icu_provider/struct.DataError.html), [2](https://docs.rs/icu_provider/2.0.0/icu_provider/enum.DataErrorKind.html)
+enum DataError {
+
+ unknown,
+
+ markerNotFound,
+
+ identifierNotFound,
+
+ invalidRequest,
+
+ inconsistentData,
+
+ downcast,
+
+ deserialize,
+
+ custom,
+
+ io;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DataProvider.g.dart b/pkgs/intl4x/lib/src/bindings/DataProvider.g.dart
index 3467158..a5eb37b 100644
--- a/pkgs/intl4x/lib/src/bindings/DataProvider.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DataProvider.g.dart
@@ -1,10 +1,16 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X data provider, capable of loading ICU4X data keys from some source.
///
-/// See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information.
+/// Currently the only source supported is loading from "blob" formatted data from a bytes buffer or the file system.
+///
+/// If you wish to use ICU4X's builtin "compiled data", use the version of the constructors that do not have `_with_provider`
+/// in their names.
+///
+/// See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/2.0.0/icu_provider/index.html) for more information.
final class DataProvider implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,183 +28,84 @@
}
}
- @_DiplomatFfiUse('ICU4XDataProvider_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XDataProvider_destroy),
- );
+ @_DiplomatFfiUse('icu4x_DataProvider_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_DataProvider_destroy_mv1));
- /// Constructs an [`DataProvider`] that uses compiled data.
+ /// See the [Rust documentation for `try_new_from_blob`](https://docs.rs/icu_provider_blob/2.0.0/icu_provider_blob/struct.BlobDataProvider.html#method.try_new_from_blob) for more information.
///
- /// Requires the `compiled_data` feature.
- ///
- /// This provider cannot be modified or combined with other providers, so `enable_fallback`,
- /// `enabled_fallback_with`, `fork_by_locale`, and `fork_by_key` will return `Err`s.
- factory DataProvider.compiled() {
- final result = _ICU4XDataProvider_create_compiled();
- return DataProvider._fromFfi(result, []);
- }
-
- /// Constructs a `BlobDataProvider` and returns it as an [`DataProvider`].
- ///
- /// See the [Rust documentation for `BlobDataProvider`](https://docs.rs/icu_provider_blob/latest/icu_provider_blob/struct.BlobDataProvider.html) for more information.
- ///
- /// Throws [Error] on failure.
+ /// Throws [DataError] on failure.
factory DataProvider.fromByteSlice(ByteBuffer blob) {
- final temp = ffi2.Arena();
- final blobView = blob;
- final result = _ICU4XDataProvider_create_from_byte_slice(
- blobView.allocIn(temp),
- blobView.length,
- );
- temp.releaseAll();
+ final result = _icu4x_DataProvider_from_owned_byte_slice_mv1(blob.asUint8List()._uint8AllocIn(_RustAlloc()));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return DataProvider._fromFfi(result.union.ok, []);
}
- /// Constructs an empty [`DataProvider`].
- ///
- /// See the [Rust documentation for `EmptyDataProvider`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/empty/struct.EmptyDataProvider.html) for more information.
- factory DataProvider.empty() {
- final result = _ICU4XDataProvider_create_empty();
- return DataProvider._fromFfi(result, []);
- }
-
/// Creates a provider that tries the current provider and then, if the current provider
/// doesn't support the data key, another provider `other`.
///
/// This takes ownership of the `other` provider, leaving an empty provider in its place.
///
- /// The providers must be the same type (Any or Buffer). This condition is satisfied if
- /// both providers originate from the same constructor, such as `create_from_byte_slice`
- /// or `create_fs`. If the condition is not upheld, a runtime error occurs.
+ /// See the [Rust documentation for `ForkByMarkerProvider`](https://docs.rs/icu_provider_adapters/2.0.0/icu_provider_adapters/fork/type.ForkByMarkerProvider.html) for more information.
///
- /// See the [Rust documentation for `ForkByKeyProvider`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/type.ForkByKeyProvider.html) for more information.
- ///
- /// Throws [Error] on failure.
- void forkByKey(DataProvider other) {
- final result = _ICU4XDataProvider_fork_by_key(_ffi, other._ffi);
+ /// Throws [DataError] on failure.
+ void forkByMarker(DataProvider other) {
+ final result = _icu4x_DataProvider_fork_by_marker_mv1(_ffi, other._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
}
/// Same as `fork_by_key` but forks by locale instead of key.
///
- /// See the [Rust documentation for `MissingLocalePredicate`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/predicates/struct.MissingLocalePredicate.html) for more information.
+ /// See the [Rust documentation for `IdentifierNotFoundPredicate`](https://docs.rs/icu_provider_adapters/2.0.0/icu_provider_adapters/fork/predicates/struct.IdentifierNotFoundPredicate.html) for more information.
///
- /// Throws [Error] on failure.
+ /// Throws [DataError] on failure.
void forkByLocale(DataProvider other) {
- final result = _ICU4XDataProvider_fork_by_locale(_ffi, other._ffi);
+ final result = _icu4x_DataProvider_fork_by_locale_mv1(_ffi, other._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
}
- /// Enables locale fallbacking for data requests made to this provider.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu_provider_adapters/2.0.0/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.new) for more information.
///
- /// Note that the test provider (from `create_test`) already has fallbacking enabled.
+ /// Additional information: [1](https://docs.rs/icu_provider_adapters/2.0.0/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html)
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.try_new) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html)
- ///
- /// Throws [Error] on failure.
- void enableLocaleFallback() {
- final result = _ICU4XDataProvider_enable_locale_fallback(_ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- }
-
- /// See the [Rust documentation for `new_with_fallbacker`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.new_with_fallbacker) for more information.
- ///
- /// Additional information: [1](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html)
- ///
- /// Throws [Error] on failure.
+ /// Throws [DataError] on failure.
void enableLocaleFallbackWith(LocaleFallbacker fallbacker) {
- final result = _ICU4XDataProvider_enable_locale_fallback_with(
- _ffi,
- fallbacker._ffi,
- );
+ final result = _icu4x_DataProvider_enable_locale_fallback_with_mv1(_ffi, fallbacker._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
}
+
}
-@_DiplomatFfiUse('ICU4XDataProvider_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XDataProvider_destroy',
-)
+@_DiplomatFfiUse('icu4x_DataProvider_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DataProvider_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XDataProvider_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_DataProvider_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XDataProvider_create_compiled')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XDataProvider_create_compiled',
-)
+@_DiplomatFfiUse('icu4x_DataProvider_from_owned_byte_slice_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUint8)>(isLeaf: true, symbol: 'icu4x_DataProvider_from_owned_byte_slice_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDataProvider_create_compiled();
+external _ResultOpaqueInt32 _icu4x_DataProvider_from_owned_byte_slice_mv1(_SliceUint8 blob);
-@_DiplomatFfiUse('ICU4XDataProvider_create_from_byte_slice')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XDataProvider_create_from_byte_slice',
-)
+@_DiplomatFfiUse('icu4x_DataProvider_fork_by_marker_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DataProvider_fork_by_marker_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDataProvider_create_from_byte_slice(
- ffi.Pointer<ffi.Uint8> blobData,
- int blobLength,
-);
+external _ResultVoidInt32 _icu4x_DataProvider_fork_by_marker_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> other);
-@_DiplomatFfiUse('ICU4XDataProvider_create_empty')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XDataProvider_create_empty',
-)
+@_DiplomatFfiUse('icu4x_DataProvider_fork_by_locale_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DataProvider_fork_by_locale_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDataProvider_create_empty();
+external _ResultVoidInt32 _icu4x_DataProvider_fork_by_locale_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> other);
-@_DiplomatFfiUse('ICU4XDataProvider_fork_by_key')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XDataProvider_fork_by_key')
+@_DiplomatFfiUse('icu4x_DataProvider_enable_locale_fallback_with_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DataProvider_enable_locale_fallback_with_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDataProvider_fork_by_key(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> other,
-);
+external _ResultVoidInt32 _icu4x_DataProvider_enable_locale_fallback_with_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> fallbacker);
-@_DiplomatFfiUse('ICU4XDataProvider_fork_by_locale')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XDataProvider_fork_by_locale')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDataProvider_fork_by_locale(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> other,
-);
-
-@_DiplomatFfiUse('ICU4XDataProvider_enable_locale_fallback')
-@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDataProvider_enable_locale_fallback',
-)
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDataProvider_enable_locale_fallback(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XDataProvider_enable_locale_fallback_with')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XDataProvider_enable_locale_fallback_with')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDataProvider_enable_locale_fallback_with(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> fallbacker,
-);
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Date.g.dart b/pkgs/intl4x/lib/src/bindings/Date.g.dart
index 90575ca..cd31ed4 100644
--- a/pkgs/intl4x/lib/src/bindings/Date.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Date.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X Date object capable of containing a date and time for any calendar.
+/// An ICU4X Date object capable of containing a date for any calendar.
///
-/// See the [Rust documentation for `Date`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html) for more information.
+/// See the [Rust documentation for `Date`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html) for more information.
final class Date implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,128 +23,112 @@
}
}
- @_DiplomatFfiUse('ICU4XDate_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XDate_destroy),
- );
+ @_DiplomatFfiUse('icu4x_Date_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Date_destroy_mv1));
- /// Creates a new [`Date`] representing the ISO date and time
+ /// Creates a new [Date] representing the ISO date
/// given but in a given calendar
///
- /// See the [Rust documentation for `new_from_iso`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.new_from_iso) for more information.
+ /// See the [Rust documentation for `new_from_iso`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.new_from_iso) for more information.
///
- /// Throws [Error] on failure.
- factory Date.fromIsoInCalendar(
- int year,
- int month,
- int day,
- Calendar calendar,
- ) {
- final result = _ICU4XDate_create_from_iso_in_calendar(
- year,
- month,
- day,
- calendar._ffi,
- );
+ /// Throws [CalendarError] on failure.
+ factory Date.fromIsoInCalendar(int isoYear, int isoMonth, int isoDay, Calendar calendar) {
+ final result = _icu4x_Date_from_iso_in_calendar_mv1(isoYear, isoMonth, isoDay, calendar._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw CalendarError.values[result.union.err];
}
return Date._fromFfi(result.union.ok, []);
}
- /// Creates a new [`Date`] from the given codes, which are interpreted in the given calendar system
+ /// Creates a new [Date] from the given codes, which are interpreted in the given calendar system
///
- /// See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.try_new_from_codes) for more information.
+ /// An empty era code will treat the year as an extended year
///
- /// Throws [Error] on failure.
- factory Date.fromCodesInCalendar(
- String eraCode,
- int year,
- String monthCode,
- int day,
- Calendar calendar,
- ) {
- final temp = ffi2.Arena();
- final eraCodeView = eraCode.utf8View;
- final monthCodeView = monthCode.utf8View;
- final result = _ICU4XDate_create_from_codes_in_calendar(
- eraCodeView.allocIn(temp),
- eraCodeView.length,
- year,
- monthCodeView.allocIn(temp),
- monthCodeView.length,
- day,
- calendar._ffi,
- );
- temp.releaseAll();
+ /// See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.try_new_from_codes) for more information.
+ ///
+ /// Throws [CalendarError] on failure.
+ factory Date.fromCodesInCalendar(String eraCode, int year, String monthCode, int day, Calendar calendar) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Date_from_codes_in_calendar_mv1(eraCode._utf8AllocIn(temp.arena), year, monthCode._utf8AllocIn(temp.arena), day, calendar._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw CalendarError.values[result.union.err];
+ }
+ return Date._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new [Date] from the given Rata Die
+ ///
+ /// See the [Rust documentation for `from_rata_die`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.from_rata_die) for more information.
+ ///
+ /// Throws [CalendarError] on failure.
+ factory Date.fromRataDie(int rd, Calendar calendar) {
+ final result = _icu4x_Date_from_rata_die_mv1(rd, calendar._ffi);
+ if (!result.isOk) {
+ throw CalendarError.values[result.union.err];
+ }
+ return Date._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new [Date] from an IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.try_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory Date.fromString(String v, Calendar calendar) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Date_from_string_mv1(v._utf8AllocIn(temp.arena), calendar._ffi);
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
}
return Date._fromFfi(result.union.ok, []);
}
/// Convert this date to one in a different calendar
///
- /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar) for more information.
+ /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.to_calendar) for more information.
Date toCalendar(Calendar calendar) {
- final result = _ICU4XDate_to_calendar(_ffi, calendar._ffi);
+ final result = _icu4x_Date_to_calendar_mv1(_ffi, calendar._ffi);
return Date._fromFfi(result, []);
}
/// Converts this date to ISO
///
- /// See the [Rust documentation for `to_iso`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_iso) for more information.
+ /// See the [Rust documentation for `to_iso`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.to_iso) for more information.
IsoDate toIso() {
- final result = _ICU4XDate_to_iso(_ffi);
+ final result = _icu4x_Date_to_iso_mv1(_ffi);
return IsoDate._fromFfi(result, []);
}
+ /// Returns this date's Rata Die
+ ///
+ /// See the [Rust documentation for `to_rata_die`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.to_rata_die) for more information.
+ int get rataDie {
+ final result = _icu4x_Date_to_rata_die_mv1(_ffi);
+ return result;
+ }
+
/// Returns the 1-indexed day in the year for this date
///
- /// See the [Rust documentation for `day_of_year_info`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_year_info) for more information.
+ /// See the [Rust documentation for `day_of_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.day_of_year) for more information.
int get dayOfYear {
- final result = _ICU4XDate_day_of_year(_ffi);
+ final result = _icu4x_Date_day_of_year_mv1(_ffi);
return result;
}
/// Returns the 1-indexed day in the month for this date
///
- /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information.
+ /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.day_of_month) for more information.
int get dayOfMonth {
- final result = _ICU4XDate_day_of_month(_ffi);
+ final result = _icu4x_Date_day_of_month_mv1(_ffi);
return result;
}
/// Returns the day in the week for this day
///
- /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information.
- IsoWeekday get dayOfWeek {
- final result = _ICU4XDate_day_of_week(_ffi);
- return IsoWeekday.values.firstWhere((v) => v._ffi == result);
- }
-
- /// Returns the week number in this month, 1-indexed, based on what
- /// is considered the first day of the week (often a locale preference).
- ///
- /// `first_weekday` can be obtained via `first_weekday()` on [`WeekCalculator`]
- ///
- /// See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information.
- int weekOfMonth(IsoWeekday firstWeekday) {
- final result = _ICU4XDate_week_of_month(_ffi, firstWeekday._ffi);
- return result;
- }
-
- /// Returns the week number in this year, using week data
- ///
- /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information.
- ///
- /// Throws [Error] on failure.
- WeekOf weekOfYear(WeekCalculator calculator) {
- final result = _ICU4XDate_week_of_year(_ffi, calculator._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return WeekOf._fromFfi(result.union.ok);
+ /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.day_of_week) for more information.
+ Weekday get dayOfWeek {
+ final result = _icu4x_Date_day_of_week_mv1(_ffi);
+ return Weekday.values.firstWhere((v) => v._ffi == result);
}
/// Returns 1-indexed number of the month of this date in its year
@@ -152,269 +137,215 @@
/// having the same ordinal month across years; use month_code if you care
/// about month identity.
///
- /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
+ /// See the [Rust documentation for `month`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.month) for more information.
+ ///
+ /// See the [Rust documentation for `ordinal`](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.MonthInfo.html#structfield.ordinal) for more information.
int get ordinalMonth {
- final result = _ICU4XDate_ordinal_month(_ffi);
+ final result = _icu4x_Date_ordinal_month_mv1(_ffi);
return result;
}
/// Returns the month code for this date. Typically something
/// like "M01", "M02", but can be more complicated for lunar calendars.
///
- /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
+ /// See the [Rust documentation for `standard_code`](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.MonthInfo.html#structfield.standard_code) for more information.
///
- /// Throws [Error] on failure.
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.month)
String get monthCode {
- final writeable = _Writeable();
- final result = _ICU4XDate_month_code(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final write = _Write();
+ _icu4x_Date_month_code_mv1(_ffi, write._ffi);
+ return write.finalize();
+ }
+
+ /// Returns the month number of this month.
+ ///
+ /// See the [Rust documentation for `month_number`](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.MonthInfo.html#method.month_number) for more information.
+ int get monthNumber {
+ final result = _icu4x_Date_month_number_mv1(_ffi);
+ return result;
+ }
+
+ /// Returns whether the month is a leap month.
+ ///
+ /// See the [Rust documentation for `is_leap`](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.MonthInfo.html#method.is_leap) for more information.
+ bool get monthIsLeap {
+ final result = _icu4x_Date_month_is_leap_mv1(_ffi);
+ return result;
}
/// Returns the year number in the current era for this date
///
- /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information.
- int get yearInEra {
- final result = _ICU4XDate_year_in_era(_ffi);
+ /// For calendars without an era, returns the related ISO year.
+ ///
+ /// See the [Rust documentation for `era_year_or_related_iso`](https://docs.rs/icu/2.0.0/icu/calendar/types/enum.YearInfo.html#method.era_year_or_related_iso) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.EraYear.html#structfield.year), [2](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.CyclicYear.html#structfield.related_iso), [3](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.year)
+ int get eraYearOrRelatedIso {
+ final result = _icu4x_Date_era_year_or_related_iso_mv1(_ffi);
return result;
}
- /// Returns the era for this date,
+ /// Returns the extended year in the Date
///
- /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/struct.Date.html#method.year) for more information.
+ /// See the [Rust documentation for `extended_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.extended_year) for more information.
+ int get extendedYear {
+ final result = _icu4x_Date_extended_year_mv1(_ffi);
+ return result;
+ }
+
+ /// Returns the era for this date, or an empty string
///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/types/struct.Era.html)
+ /// See the [Rust documentation for `era`](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.EraYear.html#structfield.era) for more information.
///
- /// Throws [Error] on failure.
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.year)
String get era {
- final writeable = _Writeable();
- final result = _ICU4XDate_era(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final write = _Write();
+ _icu4x_Date_era_mv1(_ffi, write._ffi);
+ return write.finalize();
}
/// Returns the number of months in the year represented by this date
///
- /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information.
+ /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.months_in_year) for more information.
int get monthsInYear {
- final result = _ICU4XDate_months_in_year(_ffi);
+ final result = _icu4x_Date_months_in_year_mv1(_ffi);
return result;
}
/// Returns the number of days in the month represented by this date
///
- /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information.
+ /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.days_in_month) for more information.
int get daysInMonth {
- final result = _ICU4XDate_days_in_month(_ffi);
+ final result = _icu4x_Date_days_in_month_mv1(_ffi);
return result;
}
/// Returns the number of days in the year represented by this date
///
- /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information.
+ /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.days_in_year) for more information.
int get daysInYear {
- final result = _ICU4XDate_days_in_year(_ffi);
+ final result = _icu4x_Date_days_in_year_mv1(_ffi);
return result;
}
- /// Returns the [`Calendar`] object backing this date
+ /// Returns the [Calendar] object backing this date
///
- /// See the [Rust documentation for `calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar) for more information.
+ /// See the [Rust documentation for `calendar`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.calendar) for more information.
Calendar get calendar {
- final result = _ICU4XDate_calendar(_ffi);
+ final result = _icu4x_Date_calendar_mv1(_ffi);
return Calendar._fromFfi(result, []);
}
+
}
-@_DiplomatFfiUse('ICU4XDate_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_destroy',
-)
+@_DiplomatFfiUse('icu4x_Date_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Date_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XDate_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_Date_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XDate_create_from_iso_in_calendar')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Int32,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDate_create_from_iso_in_calendar')
+@_DiplomatFfiUse('icu4x_Date_from_iso_in_calendar_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int32, ffi.Uint8, ffi.Uint8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_from_iso_in_calendar_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDate_create_from_iso_in_calendar(
- int year,
- int month,
- int day,
- ffi.Pointer<ffi.Opaque> calendar,
-);
+external _ResultOpaqueInt32 _icu4x_Date_from_iso_in_calendar_mv1(int isoYear, int isoMonth, int isoDay, ffi.Pointer<ffi.Opaque> calendar);
-@_DiplomatFfiUse('ICU4XDate_create_from_codes_in_calendar')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Int32,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Uint8,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDate_create_from_codes_in_calendar')
+@_DiplomatFfiUse('icu4x_Date_from_codes_in_calendar_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8, ffi.Int32, _SliceUtf8, ffi.Uint8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_from_codes_in_calendar_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDate_create_from_codes_in_calendar(
- ffi.Pointer<ffi.Uint8> eraCodeData,
- int eraCodeLength,
- int year,
- ffi.Pointer<ffi.Uint8> monthCodeData,
- int monthCodeLength,
- int day,
- ffi.Pointer<ffi.Opaque> calendar,
-);
+external _ResultOpaqueInt32 _icu4x_Date_from_codes_in_calendar_mv1(_SliceUtf8 eraCode, int year, _SliceUtf8 monthCode, int day, ffi.Pointer<ffi.Opaque> calendar);
-@_DiplomatFfiUse('ICU4XDate_to_calendar')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDate_to_calendar')
+@_DiplomatFfiUse('icu4x_Date_from_rata_die_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int64, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_from_rata_die_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDate_to_calendar(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calendar,
-);
+external _ResultOpaqueInt32 _icu4x_Date_from_rata_die_mv1(int rd, ffi.Pointer<ffi.Opaque> calendar);
-@_DiplomatFfiUse('ICU4XDate_to_iso')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_to_iso',
-)
+@_DiplomatFfiUse('icu4x_Date_from_string_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_from_string_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDate_to_iso(
- ffi.Pointer<ffi.Opaque> self,
-);
+external _ResultOpaqueInt32 _icu4x_Date_from_string_mv1(_SliceUtf8 v, ffi.Pointer<ffi.Opaque> calendar);
-@_DiplomatFfiUse('ICU4XDate_day_of_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_day_of_year',
-)
+@_DiplomatFfiUse('icu4x_Date_to_calendar_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_to_calendar_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_day_of_year(ffi.Pointer<ffi.Opaque> self);
+external ffi.Pointer<ffi.Opaque> _icu4x_Date_to_calendar_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> calendar);
-@_DiplomatFfiUse('ICU4XDate_day_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_day_of_month',
-)
+@_DiplomatFfiUse('icu4x_Date_to_iso_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_to_iso_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_day_of_month(ffi.Pointer<ffi.Opaque> self);
+external ffi.Pointer<ffi.Opaque> _icu4x_Date_to_iso_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_day_of_week')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_day_of_week',
-)
+@_DiplomatFfiUse('icu4x_Date_to_rata_die_mv1')
+@ffi.Native<ffi.Int64 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_to_rata_die_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_day_of_week(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_Date_to_rata_die_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_week_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XDate_week_of_month',
-)
+@_DiplomatFfiUse('icu4x_Date_day_of_year_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_day_of_year_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_week_of_month(
- ffi.Pointer<ffi.Opaque> self,
- int firstWeekday,
-);
+external int _icu4x_Date_day_of_year_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_week_of_year')
-@ffi.Native<
- _ResultWeekOfFfiInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDate_week_of_year')
+@_DiplomatFfiUse('icu4x_Date_day_of_month_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_day_of_month_mv1')
// ignore: non_constant_identifier_names
-external _ResultWeekOfFfiInt32 _ICU4XDate_week_of_year(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calculator,
-);
+external int _icu4x_Date_day_of_month_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_ordinal_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_ordinal_month',
-)
+@_DiplomatFfiUse('icu4x_Date_day_of_week_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_day_of_week_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_ordinal_month(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_Date_day_of_week_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_month_code')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XDate_month_code')
+@_DiplomatFfiUse('icu4x_Date_ordinal_month_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_ordinal_month_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDate_month_code(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external int _icu4x_Date_ordinal_month_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_year_in_era')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_year_in_era',
-)
+@_DiplomatFfiUse('icu4x_Date_month_code_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_month_code_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_year_in_era(ffi.Pointer<ffi.Opaque> self);
+external void _icu4x_Date_month_code_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XDate_era')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XDate_era')
+@_DiplomatFfiUse('icu4x_Date_month_number_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_month_number_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDate_era(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external int _icu4x_Date_month_number_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_months_in_year')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_months_in_year',
-)
+@_DiplomatFfiUse('icu4x_Date_month_is_leap_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_month_is_leap_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_months_in_year(ffi.Pointer<ffi.Opaque> self);
+external bool _icu4x_Date_month_is_leap_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_days_in_month')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_days_in_month',
-)
+@_DiplomatFfiUse('icu4x_Date_era_year_or_related_iso_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_era_year_or_related_iso_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_days_in_month(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_Date_era_year_or_related_iso_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_days_in_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_days_in_year',
-)
+@_DiplomatFfiUse('icu4x_Date_extended_year_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_extended_year_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XDate_days_in_year(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_Date_extended_year_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XDate_calendar')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDate_calendar',
-)
+@_DiplomatFfiUse('icu4x_Date_era_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_era_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDate_calendar(
- ffi.Pointer<ffi.Opaque> self,
-);
+external void _icu4x_Date_era_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
+
+@_DiplomatFfiUse('icu4x_Date_months_in_year_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_months_in_year_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Date_months_in_year_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Date_days_in_month_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_days_in_month_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Date_days_in_month_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Date_days_in_year_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_days_in_year_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Date_days_in_year_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Date_calendar_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Date_calendar_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_Date_calendar_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/DateFormatter.g.dart
index 7d868a1..92e6edc 100644
--- a/pkgs/intl4x/lib/src/bindings/DateFormatter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DateFormatter.g.dart
@@ -1,11 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X DateFormatter object capable of formatting a [`Date`] as a string,
-/// using some calendar specified at runtime in the locale.
-///
-/// See the [Rust documentation for `DateFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html) for more information.
+/// See the [Rust documentation for `DateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html) for more information.
final class DateFormatter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -23,188 +21,443 @@
}
}
- @_DiplomatFfiUse('ICU4XDateFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XDateFormatter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_DateFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_DateFormatter_destroy_mv1));
- /// Creates a new [`DateFormatter`] from locale data.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// See the [Rust documentation for `try_new_with_length`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.try_new_with_length) for more information.
+ /// See the [Rust documentation for `D`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html) for more information.
///
- /// Throws [Error] on failure.
- factory DateFormatter.withLength(
- DataProvider provider,
- Locale locale,
- DateLength dateLength,
- ) {
- final result = _ICU4XDateFormatter_create_with_length(
- provider._ffi,
- locale._ffi,
- dateLength.index,
- );
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.d(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_d_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return DateFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`Date`] to a string.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information.
+ /// See the [Rust documentation for `D`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html) for more information.
///
- /// Throws [Error] on failure.
- String formatDate(Date value) {
- final writeable = _Writeable();
- final result = _ICU4XDateFormatter_format_date(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.dWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_d_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return DateFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`IsoDate`] to a string.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// Will convert to this formatter's calendar first
+ /// See the [Rust documentation for `MD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html) for more information.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information.
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.for_length)
///
- /// Throws [Error] on failure.
- String formatIsoDate(IsoDate value) {
- final writeable = _Writeable();
- final result = _ICU4XDateFormatter_format_iso_date(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.md(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_md_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return DateFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`DateTime`] to a string.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information.
+ /// See the [Rust documentation for `MD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html) for more information.
///
- /// Throws [Error] on failure.
- String formatDatetime(DateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XDateFormatter_format_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.mdWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_md_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return DateFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`IsoDateTime`] to a string.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// Will convert to this formatter's calendar first
+ /// See the [Rust documentation for `YMD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html) for more information.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information.
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.for_length)
///
- /// Throws [Error] on failure.
- String formatIsoDatetime(IsoDateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XDateFormatter_format_iso_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.ymd(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_ymd_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return DateFormatter._fromFfi(result.union.ok, []);
}
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.ymdWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_ymd_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.de(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_de_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.deWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_de_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.mde(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_mde_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.mdeWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_mde_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.ymde(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_ymde_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.ymdeWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_ymde_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `E`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.e(Locale locale, [DateTimeLength? length]) {
+ final result = _icu4x_DateFormatter_create_e_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `E`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.eWithProvider(DataProvider provider, Locale locale, [DateTimeLength? length]) {
+ final result = _icu4x_DateFormatter_create_e_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `M`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.m(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_m_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `M`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.mWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatter_create_m_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YM`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.ym(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_ym_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YM`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.ymWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_ym_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `Y`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.y(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_y_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `Y`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatter.yWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatter_create_y_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information.
+ String formatIso(IsoDate isoDate) {
+ final write = _Write();
+ _icu4x_DateFormatter_format_iso_mv1(_ffi, isoDate._ffi, write._ffi);
+ return write.finalize();
+ }
+
+ /// See the [Rust documentation for `format_same_calendar`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.format_same_calendar) for more information.
+ ///
+ /// Throws [DateTimeMismatchedCalendarError] on failure.
+ String formatSameCalendar(Date date) {
+ final write = _Write();
+ final result = _icu4x_DateFormatter_format_same_calendar_mv1(_ffi, date._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeMismatchedCalendarError._fromFfi(result.union.err);
+ }
+ return write.finalize();
+ }
+
}
-@_DiplomatFfiUse('ICU4XDateFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XDateFormatter_destroy',
-)
+@_DiplomatFfiUse('icu4x_DateFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DateFormatter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XDateFormatter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_DateFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XDateFormatter_create_with_length')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XDateFormatter_create_with_length')
+@_DiplomatFfiUse('icu4x_DateFormatter_create_d_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_d_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDateFormatter_create_with_length(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int dateLength,
-);
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_d_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XDateFormatter_format_date')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateFormatter_format_date')
+@_DiplomatFfiUse('icu4x_DateFormatter_create_d_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_d_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateFormatter_format_date(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_d_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XDateFormatter_format_iso_date')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateFormatter_format_iso_date')
+@_DiplomatFfiUse('icu4x_DateFormatter_create_md_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_md_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateFormatter_format_iso_date(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_md_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XDateFormatter_format_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateFormatter_format_datetime')
+@_DiplomatFfiUse('icu4x_DateFormatter_create_md_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_md_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateFormatter_format_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_md_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XDateFormatter_format_iso_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateFormatter_format_iso_datetime')
+@_DiplomatFfiUse('icu4x_DateFormatter_create_ymd_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_ymd_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateFormatter_format_iso_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_ymd_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_ymd_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_ymd_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_ymd_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_de_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_de_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_de_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_de_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_de_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_de_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_mde_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_mde_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_mde_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_mde_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_mde_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_mde_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_ymde_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_ymde_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_ymde_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_ymde_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_ymde_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_ymde_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_e_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_e_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_e_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_e_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_e_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_e_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_m_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_m_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_m_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_m_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_m_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_m_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_ym_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_ym_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_ym_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_ym_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_ym_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_ym_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_y_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_y_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_y_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_create_y_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatter_create_y_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatter_create_y_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_format_iso_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateFormatter_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DateFormatter_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> write);
+
+@_DiplomatFfiUse('icu4x_DateFormatter_format_same_calendar_mv1')
+@ffi.Native<_ResultVoidDateTimeMismatchedCalendarErrorFfi Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateFormatter_format_same_calendar_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidDateTimeMismatchedCalendarErrorFfi _icu4x_DateFormatter_format_same_calendar_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> date, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateFormatterGregorian.g.dart b/pkgs/intl4x/lib/src/bindings/DateFormatterGregorian.g.dart
new file mode 100644
index 0000000..358d003
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DateFormatterGregorian.g.dart
@@ -0,0 +1,446 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information.
+final class DateFormatterGregorian implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ DateFormatterGregorian._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_DateFormatterGregorian_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_DateFormatterGregorian_destroy_mv1));
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `D`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.d(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_d_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `D`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.D.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.dWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_d_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.md(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_md_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MD.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.mdWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_md_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.ymd(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_ymd_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMD`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMD.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.ymdWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_ymd_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.de(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_de_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.deWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_de_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.mde(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_mde_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.mdeWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_mde_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.ymde(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_ymde_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDE`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDE.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.ymdeWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_ymde_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `E`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.e(Locale locale, [DateTimeLength? length]) {
+ final result = _icu4x_DateFormatterGregorian_create_e_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `E`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.E.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.eWithProvider(DataProvider provider, Locale locale, [DateTimeLength? length]) {
+ final result = _icu4x_DateFormatterGregorian_create_e_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `M`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.m(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_m_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `M`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.M.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.mWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateFormatterGregorian_create_m_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YM`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.ym(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_ym_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YM`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YM.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.ymWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_ym_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `Y`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.y(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_y_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `Y`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_alignment), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.with_year_style), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.Y.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateFormatterGregorian.yWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateFormatterGregorian_create_y_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
+ String formatIso(IsoDate isoDate) {
+ final write = _Write();
+ _icu4x_DateFormatterGregorian_format_iso_mv1(_ffi, isoDate._ffi, write._ffi);
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DateFormatterGregorian_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_d_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_d_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_d_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_d_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_d_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_d_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_md_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_md_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_md_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_md_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_md_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_md_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_ymd_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymd_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymd_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_ymd_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymd_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymd_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_de_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_de_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_de_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_de_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_de_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_de_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_mde_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_mde_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_mde_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_mde_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_mde_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_mde_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_ymde_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymde_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymde_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_ymde_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymde_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymde_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_e_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_e_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_e_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_e_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_e_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_e_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_m_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_m_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_m_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_m_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_m_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_m_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_ym_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ym_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ym_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_ym_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ym_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ym_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_y_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_y_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_y_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_create_y_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_y_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_y_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateFormatterGregorian_format_iso_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DateFormatterGregorian_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateLength.g.dart b/pkgs/intl4x/lib/src/bindings/DateLength.g.dart
deleted file mode 100644
index 8d05a32..0000000
--- a/pkgs/intl4x/lib/src/bindings/DateLength.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `Date`](https://docs.rs/icu/latest/icu/datetime/options/length/enum.Date.html) for more information.
-enum DateLength { full, long, medium, short }
diff --git a/pkgs/intl4x/lib/src/bindings/DateTime.g.dart b/pkgs/intl4x/lib/src/bindings/DateTime.g.dart
index 6e1a319..e2a29e4 100644
--- a/pkgs/intl4x/lib/src/bindings/DateTime.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DateTime.g.dart
@@ -1,574 +1,69 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X DateTime object capable of containing a date and time for any calendar.
-///
-/// See the [Rust documentation for `DateTime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html) for more information.
-final class DateTime implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- DateTime._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XDateTime_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XDateTime_destroy),
- );
-
- /// Creates a new [`DateTime`] representing the ISO date and time
- /// given but in a given calendar
- ///
- /// See the [Rust documentation for `new_from_iso`](https://docs.rs/icu/latest/icu/struct.DateTime.html#method.new_from_iso) for more information.
- ///
- /// Throws [Error] on failure.
- factory DateTime.fromIsoInCalendar(
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int nanosecond,
- Calendar calendar,
- ) {
- final result = _ICU4XDateTime_create_from_iso_in_calendar(
- year,
- month,
- day,
- hour,
- minute,
- second,
- nanosecond,
- calendar._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return DateTime._fromFfi(result.union.ok, []);
- }
-
- /// Creates a new [`DateTime`] from the given codes, which are interpreted in the given calendar system
- ///
- /// See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_from_codes) for more information.
- ///
- /// Throws [Error] on failure.
- factory DateTime.fromCodesInCalendar(
- String eraCode,
- int year,
- String monthCode,
- int day,
- int hour,
- int minute,
- int second,
- int nanosecond,
- Calendar calendar,
- ) {
- final temp = ffi2.Arena();
- final eraCodeView = eraCode.utf8View;
- final monthCodeView = monthCode.utf8View;
- final result = _ICU4XDateTime_create_from_codes_in_calendar(
- eraCodeView.allocIn(temp),
- eraCodeView.length,
- year,
- monthCodeView.allocIn(temp),
- monthCodeView.length,
- day,
- hour,
- minute,
- second,
- nanosecond,
- calendar._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return DateTime._fromFfi(result.union.ok, []);
- }
-
- /// Creates a new [`DateTime`] from an [`Date`] and [`Time`] object
- ///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new) for more information.
- factory DateTime.fromDateAndTime(Date date, Time time) {
- final result = _ICU4XDateTime_create_from_date_and_time(
- date._ffi,
- time._ffi,
- );
- return DateTime._fromFfi(result, []);
- }
-
- /// Gets a copy of the date contained in this object
- ///
- /// See the [Rust documentation for `date`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date) for more information.
- Date get date {
- final result = _ICU4XDateTime_date(_ffi);
- return Date._fromFfi(result, []);
- }
-
- /// Gets the time contained in this object
- ///
- /// See the [Rust documentation for `time`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time) for more information.
- Time get time {
- final result = _ICU4XDateTime_time(_ffi);
- return Time._fromFfi(result, []);
- }
-
- /// Converts this date to ISO
- ///
- /// See the [Rust documentation for `to_iso`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_iso) for more information.
- IsoDateTime toIso() {
- final result = _ICU4XDateTime_to_iso(_ffi);
- return IsoDateTime._fromFfi(result, []);
- }
-
- /// Convert this datetime to one in a different calendar
- ///
- /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar) for more information.
- DateTime toCalendar(Calendar calendar) {
- final result = _ICU4XDateTime_to_calendar(_ffi, calendar._ffi);
- return DateTime._fromFfi(result, []);
- }
-
- /// Returns the hour in this time
- ///
- /// See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.hour) for more information.
- int get hour {
- final result = _ICU4XDateTime_hour(_ffi);
- return result;
- }
-
- /// Returns the minute in this time
- ///
- /// See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.minute) for more information.
- int get minute {
- final result = _ICU4XDateTime_minute(_ffi);
- return result;
- }
-
- /// Returns the second in this time
- ///
- /// See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.second) for more information.
- int get second {
- final result = _ICU4XDateTime_second(_ffi);
- return result;
- }
-
- /// Returns the nanosecond in this time
- ///
- /// See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.nanosecond) for more information.
- int get nanosecond {
- final result = _ICU4XDateTime_nanosecond(_ffi);
- return result;
- }
-
- /// Returns the 1-indexed day in the year for this date
- ///
- /// See the [Rust documentation for `day_of_year_info`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_year_info) for more information.
- int get dayOfYear {
- final result = _ICU4XDateTime_day_of_year(_ffi);
- return result;
- }
-
- /// Returns the 1-indexed day in the month for this date
- ///
- /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information.
- int get dayOfMonth {
- final result = _ICU4XDateTime_day_of_month(_ffi);
- return result;
- }
-
- /// Returns the day in the week for this day
- ///
- /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information.
- IsoWeekday get dayOfWeek {
- final result = _ICU4XDateTime_day_of_week(_ffi);
- return IsoWeekday.values.firstWhere((v) => v._ffi == result);
- }
-
- /// Returns the week number in this month, 1-indexed, based on what
- /// is considered the first day of the week (often a locale preference).
- ///
- /// `first_weekday` can be obtained via `first_weekday()` on [`WeekCalculator`]
- ///
- /// See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information.
- int weekOfMonth(IsoWeekday firstWeekday) {
- final result = _ICU4XDateTime_week_of_month(_ffi, firstWeekday._ffi);
- return result;
- }
-
- /// Returns the week number in this year, using week data
- ///
- /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information.
- ///
- /// Throws [Error] on failure.
- WeekOf weekOfYear(WeekCalculator calculator) {
- final result = _ICU4XDateTime_week_of_year(_ffi, calculator._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return WeekOf._fromFfi(result.union.ok);
- }
-
- /// Returns 1-indexed number of the month of this date in its year
- ///
- /// Note that for lunar calendars this may not lead to the same month
- /// having the same ordinal month across years; use month_code if you care
- /// about month identity.
- ///
- /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
- int get ordinalMonth {
- final result = _ICU4XDateTime_ordinal_month(_ffi);
- return result;
- }
-
- /// Returns the month code for this date. Typically something
- /// like "M01", "M02", but can be more complicated for lunar calendars.
- ///
- /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
- ///
- /// Throws [Error] on failure.
- String get monthCode {
- final writeable = _Writeable();
- final result = _ICU4XDateTime_month_code(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// Returns the year number in the current era for this date
- ///
- /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information.
- int get yearInEra {
- final result = _ICU4XDateTime_year_in_era(_ffi);
- return result;
- }
-
- /// Returns the era for this date,
- ///
- /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information.
- ///
- /// Throws [Error] on failure.
- String get era {
- final writeable = _Writeable();
- final result = _ICU4XDateTime_era(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// Returns the number of months in the year represented by this date
- ///
- /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information.
- int get monthsInYear {
- final result = _ICU4XDateTime_months_in_year(_ffi);
- return result;
- }
-
- /// Returns the number of days in the month represented by this date
- ///
- /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information.
- int get daysInMonth {
- final result = _ICU4XDateTime_days_in_month(_ffi);
- return result;
- }
-
- /// Returns the number of days in the year represented by this date
- ///
- /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information.
- int get daysInYear {
- final result = _ICU4XDateTime_days_in_year(_ffi);
- return result;
- }
-
- /// Returns the [`Calendar`] object backing this date
- ///
- /// See the [Rust documentation for `calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar) for more information.
- Calendar get calendar {
- final result = _ICU4XDateTime_calendar(_ffi);
- return Calendar._fromFfi(result, []);
- }
+final class _DateTimeFfi extends ffi.Struct {
+ external ffi.Pointer<ffi.Opaque> date;
+ external ffi.Pointer<ffi.Opaque> time;
}
-@_DiplomatFfiUse('ICU4XDateTime_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XDateTime_destroy(ffi.Pointer<ffi.Void> self);
+/// An ICU4X DateTime object capable of containing a date and time for any calendar.
+///
+/// See the [Rust documentation for `DateTime`](https://docs.rs/icu/2.0.0/icu/time/struct.DateTime.html) for more information.
+final class DateTime {
+ final Date date;
+ final Time time;
-@_DiplomatFfiUse('ICU4XDateTime_create_from_iso_in_calendar')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Int32,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint32,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateTime_create_from_iso_in_calendar')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDateTime_create_from_iso_in_calendar(
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int nanosecond,
- ffi.Pointer<ffi.Opaque> calendar,
-);
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ DateTime._fromFfi(_DateTimeFfi ffi) :
+ date = Date._fromFfi(ffi.date, []),
+ time = Time._fromFfi(ffi.time, []);
-@_DiplomatFfiUse('ICU4XDateTime_create_from_codes_in_calendar')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Int32,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint32,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateTime_create_from_codes_in_calendar')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDateTime_create_from_codes_in_calendar(
- ffi.Pointer<ffi.Uint8> eraCodeData,
- int eraCodeLength,
- int year,
- ffi.Pointer<ffi.Uint8> monthCodeData,
- int monthCodeLength,
- int day,
- int hour,
- int minute,
- int second,
- int nanosecond,
- ffi.Pointer<ffi.Opaque> calendar,
-);
+ // ignore: unused_element
+ _DateTimeFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_DateTimeFfi>();
+ struct.date = date._ffi;
+ struct.time = time._ffi;
+ return struct;
+ }
-@_DiplomatFfiUse('ICU4XDateTime_create_from_date_and_time')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateTime_create_from_date_and_time')
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDateTime_create_from_date_and_time(
- ffi.Pointer<ffi.Opaque> date,
- ffi.Pointer<ffi.Opaque> time,
-);
+ /// Creates a new [DateTime] from an IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.DateTime.html#method.try_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory DateTime.fromString(String v, Calendar calendar) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_DateTime_from_string_mv1(v._utf8AllocIn(temp.arena), calendar._ffi);
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return DateTime._fromFfi(result.union.ok);
+ }
-@_DiplomatFfiUse('ICU4XDateTime_date')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_date',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDateTime_date(
- ffi.Pointer<ffi.Opaque> self,
-);
-@_DiplomatFfiUse('ICU4XDateTime_time')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_time',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDateTime_time(
- ffi.Pointer<ffi.Opaque> self,
-);
+ @override
+ bool operator ==(Object other) =>
+ other is DateTime &&
+ other.date == date &&
+ other.time == time;
-@_DiplomatFfiUse('ICU4XDateTime_to_iso')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_to_iso',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDateTime_to_iso(
- ffi.Pointer<ffi.Opaque> self,
-);
+ @override
+ int get hashCode => Object.hashAll([
+ date,
+ time,
+ ]);
+}
-@_DiplomatFfiUse('ICU4XDateTime_to_calendar')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateTime_to_calendar')
+@_DiplomatFfiUse('icu4x_DateTime_from_string_mv1')
+@ffi.Native<_ResultDateTimeFfiInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateTime_from_string_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDateTime_to_calendar(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calendar,
-);
+external _ResultDateTimeFfiInt32 _icu4x_DateTime_from_string_mv1(_SliceUtf8 v, ffi.Pointer<ffi.Opaque> calendar);
-@_DiplomatFfiUse('ICU4XDateTime_hour')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_hour',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_hour(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_minute')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_minute',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_minute(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_second')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_second',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_second(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_nanosecond')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_nanosecond',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_nanosecond(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_day_of_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_day_of_year',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_day_of_year(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_day_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_day_of_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_day_of_month(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_day_of_week')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_day_of_week',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_day_of_week(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_week_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_week_of_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_week_of_month(
- ffi.Pointer<ffi.Opaque> self,
- int firstWeekday,
-);
-
-@_DiplomatFfiUse('ICU4XDateTime_week_of_year')
-@ffi.Native<
- _ResultWeekOfFfiInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateTime_week_of_year')
-// ignore: non_constant_identifier_names
-external _ResultWeekOfFfiInt32 _ICU4XDateTime_week_of_year(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calculator,
-);
-
-@_DiplomatFfiUse('ICU4XDateTime_ordinal_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_ordinal_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_ordinal_month(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_month_code')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XDateTime_month_code')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateTime_month_code(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XDateTime_year_in_era')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_year_in_era',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_year_in_era(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_era')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XDateTime_era')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateTime_era(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XDateTime_months_in_year')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_months_in_year',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_months_in_year(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_days_in_month')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_days_in_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_days_in_month(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_days_in_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_days_in_year',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XDateTime_days_in_year(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XDateTime_calendar')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTime_calendar',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XDateTime_calendar(
- ffi.Pointer<ffi.Opaque> self,
-);
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateTimeAlignment.g.dart b/pkgs/intl4x/lib/src/bindings/DateTimeAlignment.g.dart
new file mode 100644
index 0000000..332925f
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DateTimeAlignment.g.dart
@@ -0,0 +1,15 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `Alignment`](https://docs.rs/icu/2.0.0/icu/datetime/options/enum.Alignment.html) for more information.
+enum DateTimeAlignment {
+
+ auto,
+
+ column;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateTimeFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/DateTimeFormatter.g.dart
index e26cb90..a71c636 100644
--- a/pkgs/intl4x/lib/src/bindings/DateTimeFormatter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DateTimeFormatter.g.dart
@@ -1,11 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X DateFormatter object capable of formatting a [`DateTime`] as a string,
-/// using some calendar specified at runtime in the locale.
-///
-/// See the [Rust documentation for `DateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html) for more information.
+/// See the [Rust documentation for `DateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html) for more information.
final class DateTimeFormatter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -23,124 +21,323 @@
}
}
- @_DiplomatFfiUse('ICU4XDateTimeFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XDateTimeFormatter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_DateTimeFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_DateTimeFormatter_destroy_mv1));
- /// Creates a new [`DateTimeFormatter`] from locale data.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ /// See the [Rust documentation for `DT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html) for more information.
///
- /// Throws [Error] on failure.
- factory DateTimeFormatter.withLengths(
- DataProvider provider,
- Locale locale,
- DateLength dateLength,
- TimeLength timeLength,
- ) {
- final result = _ICU4XDateTimeFormatter_create_with_lengths(
- provider._ffi,
- locale._ffi,
- dateLength.index,
- timeLength.index,
- );
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.dt(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_dt_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return DateTimeFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`DateTime`] to a string.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information.
+ /// See the [Rust documentation for `DT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html) for more information.
///
- /// Throws [Error] on failure.
- String formatDatetime(DateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XDateTimeFormatter_format_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.dtWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_dt_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`IsoDateTime`] to a string.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
///
- /// Will convert to this formatter's calendar first
+ /// See the [Rust documentation for `MDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html) for more information.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information.
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.for_length)
///
- /// Throws [Error] on failure.
- String formatIsoDatetime(IsoDateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XDateTimeFormatter_format_iso_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.mdt(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_mdt_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
}
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.mdtWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_mdt_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.ymdt(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatter_create_ymdt_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.ymdtWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatter_create_ymdt_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.det(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_det_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.detWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_det_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.mdet(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_mdet_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.mdetWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_mdet_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.ymdet(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatter_create_ymdet_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.ymdetWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatter_create_ymdet_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `ET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.et(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_et_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `ET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatter.etWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatter_create_et_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information.
+ String formatIso(IsoDate isoDate, Time time) {
+ final write = _Write();
+ _icu4x_DateTimeFormatter_format_iso_mv1(_ffi, isoDate._ffi, time._ffi, write._ffi);
+ return write.finalize();
+ }
+
+ /// See the [Rust documentation for `format_same_calendar`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.format_same_calendar) for more information.
+ ///
+ /// Throws [DateTimeMismatchedCalendarError] on failure.
+ String formatSameCalendar(Date date, Time time) {
+ final write = _Write();
+ final result = _icu4x_DateTimeFormatter_format_same_calendar_mv1(_ffi, date._ffi, time._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeMismatchedCalendarError._fromFfi(result.union.err);
+ }
+ return write.finalize();
+ }
+
}
-@_DiplomatFfiUse('ICU4XDateTimeFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XDateTimeFormatter_destroy',
-)
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XDateTimeFormatter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_DateTimeFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XDateTimeFormatter_create_with_lengths')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XDateTimeFormatter_create_with_lengths')
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_dt_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_dt_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDateTimeFormatter_create_with_lengths(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int dateLength,
- int timeLength,
-);
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_dt_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XDateTimeFormatter_format_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateTimeFormatter_format_datetime')
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_dt_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_dt_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateTimeFormatter_format_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_dt_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XDateTimeFormatter_format_iso_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDateTimeFormatter_format_iso_datetime')
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_mdt_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_mdt_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDateTimeFormatter_format_iso_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_mdt_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_mdt_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_mdt_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_mdt_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_ymdt_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_ymdt_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_ymdt_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_ymdt_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_ymdt_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_ymdt_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_det_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_det_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_det_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_det_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_det_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_det_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_mdet_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_mdet_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_mdet_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_mdet_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_mdet_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_mdet_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_ymdet_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_ymdet_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_ymdet_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_ymdet_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_ymdet_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_ymdet_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_et_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_et_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_et_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_create_et_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_create_et_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatter_create_et_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_format_iso_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DateTimeFormatter_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> time, ffi.Pointer<ffi.Opaque> write);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatter_format_same_calendar_mv1')
+@ffi.Native<_ResultVoidDateTimeMismatchedCalendarErrorFfi Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatter_format_same_calendar_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidDateTimeMismatchedCalendarErrorFfi _icu4x_DateTimeFormatter_format_same_calendar_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> date, ffi.Pointer<ffi.Opaque> time, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateTimeFormatterGregorian.g.dart b/pkgs/intl4x/lib/src/bindings/DateTimeFormatterGregorian.g.dart
new file mode 100644
index 0000000..147844b
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DateTimeFormatterGregorian.g.dart
@@ -0,0 +1,326 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information.
+final class DateTimeFormatterGregorian implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ DateTimeFormatterGregorian._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_DateTimeFormatterGregorian_destroy_mv1));
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.dt(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_dt_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.dtWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_dt_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.mdt(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_mdt_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.mdtWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_mdt_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.ymdt(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_ymdt_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDT`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDT.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.ymdtWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_ymdt_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.det(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_det_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `DET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.DET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.detWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_det_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.mdet(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_mdet_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `MDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.MDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.mdetWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_mdet_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.ymdet(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_ymdet_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `YMDET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.with_year_style), [4](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.YMDET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.ymdetWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_ymdet_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `ET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.et(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_et_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
+ ///
+ /// See the [Rust documentation for `ET`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.ET.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory DateTimeFormatterGregorian.etWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_DateTimeFormatterGregorian_create_et_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return DateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
+ String formatIso(IsoDate isoDate, Time time) {
+ final write = _Write();
+ _icu4x_DateTimeFormatterGregorian_format_iso_mv1(_ffi, isoDate._ffi, time._ffi, write._ffi);
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DateTimeFormatterGregorian_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_dt_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_dt_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_dt_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_dt_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_dt_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_dt_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_mdt_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_mdt_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_mdt_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_mdt_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_mdt_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_mdt_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_ymdt_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_ymdt_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_ymdt_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_ymdt_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_ymdt_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_ymdt_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_det_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_det_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_det_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_det_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_det_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_det_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_mdet_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_mdet_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_mdet_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_mdet_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_mdet_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_mdet_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_ymdet_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_ymdet_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_ymdet_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_ymdet_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_ymdet_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_ymdet_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment, _ResultInt32Void yearStyle);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_et_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_et_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_et_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_create_et_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_create_et_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DateTimeFormatterGregorian_create_et_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_DateTimeFormatterGregorian_format_iso_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateTimeFormatterGregorian_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DateTimeFormatterGregorian_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> time, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateTimeFormatterLoadError.g.dart b/pkgs/intl4x/lib/src/bindings/DateTimeFormatterLoadError.g.dart
new file mode 100644
index 0000000..bc631b5
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DateTimeFormatterLoadError.g.dart
@@ -0,0 +1,68 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/enum.DateTimeFormatterLoadError.html), [2](https://docs.rs/icu/2.0.0/icu/datetime/pattern/enum.PatternLoadError.html), [3](https://docs.rs/icu_provider/2.0.0/icu_provider/struct.DataError.html), [4](https://docs.rs/icu_provider/2.0.0/icu_provider/enum.DataErrorKind.html)
+enum DateTimeFormatterLoadError {
+
+ unknown,
+
+ invalidDateFields,
+
+ unsupportedLength,
+
+ conflictingField,
+
+ formatterTooSpecific,
+
+ dataMarkerNotFound,
+
+ dataIdentifierNotFound,
+
+ dataInvalidRequest,
+
+ dataInconsistentData,
+
+ dataDowncast,
+
+ dataDeserialize,
+
+ dataCustom,
+
+ dataIo;
+
+ int get _ffi {
+ switch (this) {
+ case unknown:
+ return 0;
+ case invalidDateFields:
+ return 2049;
+ case unsupportedLength:
+ return 2051;
+ case conflictingField:
+ return 2057;
+ case formatterTooSpecific:
+ return 2058;
+ case dataMarkerNotFound:
+ return 1;
+ case dataIdentifierNotFound:
+ return 2;
+ case dataInvalidRequest:
+ return 3;
+ case dataInconsistentData:
+ return 4;
+ case dataDowncast:
+ return 5;
+ case dataDeserialize:
+ return 6;
+ case dataCustom:
+ return 7;
+ case dataIo:
+ return 8;
+ }
+ }
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateTimeLength.g.dart b/pkgs/intl4x/lib/src/bindings/DateTimeLength.g.dart
new file mode 100644
index 0000000..0a71957
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DateTimeLength.g.dart
@@ -0,0 +1,17 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `Length`](https://docs.rs/icu/2.0.0/icu/datetime/options/enum.Length.html) for more information.
+enum DateTimeLength {
+
+ long,
+
+ medium,
+
+ short;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateTimeMismatchedCalendarError.g.dart b/pkgs/intl4x/lib/src/bindings/DateTimeMismatchedCalendarError.g.dart
new file mode 100644
index 0000000..abef8a6
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DateTimeMismatchedCalendarError.g.dart
@@ -0,0 +1,52 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _DateTimeMismatchedCalendarErrorFfi extends ffi.Struct {
+ @ffi.Int32()
+ external int thisKind;
+ external _ResultInt32Void dateKind;
+}
+
+/// See the [Rust documentation for `MismatchedCalendarError`](https://docs.rs/icu/2.0.0/icu/datetime/struct.MismatchedCalendarError.html) for more information.
+final class DateTimeMismatchedCalendarError {
+ CalendarKind thisKind;
+ CalendarKind? dateKind;
+
+ DateTimeMismatchedCalendarError({required this.thisKind, this.dateKind});
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ DateTimeMismatchedCalendarError._fromFfi(_DateTimeMismatchedCalendarErrorFfi ffi) :
+ thisKind = CalendarKind.values.firstWhere((v) => v._ffi == ffi.thisKind),
+ dateKind = ffi.dateKind.isOk ? CalendarKind.values.firstWhere((v) => v._ffi == ffi.dateKind.union.ok) : null;
+
+ // ignore: unused_element
+ _DateTimeMismatchedCalendarErrorFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_DateTimeMismatchedCalendarErrorFfi>();
+ struct.thisKind = thisKind._ffi;
+ CalendarKind? dateKind = this.dateKind;
+ struct.dateKind = dateKind != null ? _ResultInt32Void.ok(dateKind._ffi) : _ResultInt32Void.err();
+ return struct;
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is DateTimeMismatchedCalendarError &&
+ other.thisKind == thisKind &&
+ other.dateKind == dateKind;
+
+ @override
+ int get hashCode => Object.hashAll([
+ thisKind,
+ dateKind,
+ ]);
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DateTimeWriteError.g.dart b/pkgs/intl4x/lib/src/bindings/DateTimeWriteError.g.dart
new file mode 100644
index 0000000..e64cc0d
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DateTimeWriteError.g.dart
@@ -0,0 +1,20 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// An error when formatting a datetime.
+///
+/// Currently the only reachable error here is a missing time zone variant. If you encounter
+/// that error, you need to call `with_variant` or `infer_variant` on your `TimeZoneInfo`.
+///
+/// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/unchecked/enum.FormattedDateTimeUncheckedError.html)
+enum DateTimeWriteError {
+
+ unknown,
+
+ missingTimeZoneVariant;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Decimal.g.dart b/pkgs/intl4x/lib/src/bindings/Decimal.g.dart
new file mode 100644
index 0000000..248c512
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/Decimal.g.dart
@@ -0,0 +1,412 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `Decimal`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html) for more information.
+final class Decimal implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ Decimal._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_Decimal_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Decimal_destroy_mv1));
+
+ /// Construct an [Decimal] from an integer.
+ ///
+ /// See the [Rust documentation for `Decimal`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html) for more information.
+ factory Decimal.fromInt(int v) {
+ final result = _icu4x_Decimal_from_int64_mv1(v);
+ return Decimal._fromFfi(result, []);
+ }
+
+ /// Construct an [Decimal] from an float, with a given power of 10 for the lower magnitude
+ ///
+ /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.try_from_f64) for more information.
+ ///
+ /// See the [Rust documentation for `FloatPrecision`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.FloatPrecision.html) for more information.
+ ///
+ /// Throws [DecimalLimitError] on failure.
+ factory Decimal.fromDoubleWithLowerMagnitude(double f, int magnitude) {
+ final result = _icu4x_Decimal_from_double_with_lower_magnitude_mv1(f, magnitude);
+ if (!result.isOk) {
+ throw DecimalLimitError();
+ }
+ return Decimal._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [Decimal] from an float, for a given number of significant digits
+ ///
+ /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.try_from_f64) for more information.
+ ///
+ /// See the [Rust documentation for `FloatPrecision`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.FloatPrecision.html) for more information.
+ ///
+ /// Throws [DecimalLimitError] on failure.
+ factory Decimal.fromDoubleWithSignificantDigits(double f, int digits) {
+ final result = _icu4x_Decimal_from_double_with_significant_digits_mv1(f, digits);
+ if (!result.isOk) {
+ throw DecimalLimitError();
+ }
+ return Decimal._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [Decimal] from an float, with enough digits to recover
+ /// the original floating point in IEEE 754 without needing trailing zeros
+ ///
+ /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.try_from_f64) for more information.
+ ///
+ /// See the [Rust documentation for `FloatPrecision`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.FloatPrecision.html) for more information.
+ ///
+ /// Throws [DecimalLimitError] on failure.
+ factory Decimal.fromDoubleWithRoundTripPrecision(double f) {
+ final result = _icu4x_Decimal_from_double_with_round_trip_precision_mv1(f);
+ if (!result.isOk) {
+ throw DecimalLimitError();
+ }
+ return Decimal._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [Decimal] from a string.
+ ///
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.try_from_str) for more information.
+ ///
+ /// Throws [DecimalParseError] on failure.
+ factory Decimal.fromString(String v) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Decimal_from_string_mv1(v._utf8AllocIn(temp.arena));
+ if (!result.isOk) {
+ throw DecimalParseError.values[result.union.err];
+ }
+ return Decimal._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `digit_at`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.digit_at) for more information.
+ int digitAt(int magnitude) {
+ final result = _icu4x_Decimal_digit_at_mv1(_ffi, magnitude);
+ return result;
+ }
+
+ /// See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.magnitude_range) for more information.
+ int get magnitudeStart {
+ final result = _icu4x_Decimal_magnitude_start_mv1(_ffi);
+ return result;
+ }
+
+ /// See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.magnitude_range) for more information.
+ int get magnitudeEnd {
+ final result = _icu4x_Decimal_magnitude_end_mv1(_ffi);
+ return result;
+ }
+
+ /// See the [Rust documentation for `nonzero_magnitude_start`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.nonzero_magnitude_start) for more information.
+ int get nonzeroMagnitudeStart {
+ final result = _icu4x_Decimal_nonzero_magnitude_start_mv1(_ffi);
+ return result;
+ }
+
+ /// See the [Rust documentation for `nonzero_magnitude_end`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.nonzero_magnitude_end) for more information.
+ int get nonzeroMagnitudeEnd {
+ final result = _icu4x_Decimal_nonzero_magnitude_end_mv1(_ffi);
+ return result;
+ }
+
+ /// See the [Rust documentation for `is_zero`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.is_zero) for more information.
+ bool get isZero {
+ final result = _icu4x_Decimal_is_zero_mv1(_ffi);
+ return result;
+ }
+
+ /// Multiply the [Decimal] by a given power of ten.
+ ///
+ /// See the [Rust documentation for `multiply_pow10`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.multiply_pow10) for more information.
+ void multiplyPow10(int power) {
+ _icu4x_Decimal_multiply_pow10_mv1(_ffi, power);
+ }
+
+ /// See the [Rust documentation for `sign`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.sign) for more information.
+ DecimalSign get sign {
+ final result = _icu4x_Decimal_sign_mv1(_ffi);
+ return DecimalSign.values[result];
+ }
+
+ /// Set the sign of the [Decimal].
+ ///
+ /// See the [Rust documentation for `set_sign`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.set_sign) for more information.
+ set sign(DecimalSign sign) {
+ _icu4x_Decimal_set_sign_mv1(_ffi, sign.index);
+ }
+
+ /// See the [Rust documentation for `apply_sign_display`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.apply_sign_display) for more information.
+ void applySignDisplay(DecimalSignDisplay signDisplay) {
+ _icu4x_Decimal_apply_sign_display_mv1(_ffi, signDisplay.index);
+ }
+
+ /// See the [Rust documentation for `trim_start`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.trim_start) for more information.
+ void trimStart() {
+ _icu4x_Decimal_trim_start_mv1(_ffi);
+ }
+
+ /// See the [Rust documentation for `trim_end`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.trim_end) for more information.
+ void trimEnd() {
+ _icu4x_Decimal_trim_end_mv1(_ffi);
+ }
+
+ /// See the [Rust documentation for `trim_end_if_integer`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.trim_end_if_integer) for more information.
+ void trimEndIfInteger() {
+ _icu4x_Decimal_trim_end_if_integer_mv1(_ffi);
+ }
+
+ /// Zero-pad the [Decimal] on the left to a particular position
+ ///
+ /// See the [Rust documentation for `pad_start`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.pad_start) for more information.
+ void padStart(int position) {
+ _icu4x_Decimal_pad_start_mv1(_ffi, position);
+ }
+
+ /// Zero-pad the [Decimal] on the right to a particular position
+ ///
+ /// See the [Rust documentation for `pad_end`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.pad_end) for more information.
+ void padEnd(int position) {
+ _icu4x_Decimal_pad_end_mv1(_ffi, position);
+ }
+
+ /// Truncate the [Decimal] on the left to a particular position, deleting digits if necessary. This is useful for, e.g. abbreviating years
+ /// ("2022" -> "22")
+ ///
+ /// See the [Rust documentation for `set_max_position`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.set_max_position) for more information.
+ void setMaxPosition(int position) {
+ _icu4x_Decimal_set_max_position_mv1(_ffi, position);
+ }
+
+ /// Round the number at a particular digit position.
+ ///
+ /// This uses half to even rounding, which resolves ties by selecting the nearest
+ /// even integer to the original value.
+ ///
+ /// See the [Rust documentation for `round`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.round) for more information.
+ void round(int position) {
+ _icu4x_Decimal_round_mv1(_ffi, position);
+ }
+
+ /// See the [Rust documentation for `ceil`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.ceil) for more information.
+ void ceil(int position) {
+ _icu4x_Decimal_ceil_mv1(_ffi, position);
+ }
+
+ /// See the [Rust documentation for `expand`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.expand) for more information.
+ void expand(int position) {
+ _icu4x_Decimal_expand_mv1(_ffi, position);
+ }
+
+ /// See the [Rust documentation for `floor`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.floor) for more information.
+ void floor(int position) {
+ _icu4x_Decimal_floor_mv1(_ffi, position);
+ }
+
+ /// See the [Rust documentation for `trunc`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.trunc) for more information.
+ void trunc(int position) {
+ _icu4x_Decimal_trunc_mv1(_ffi, position);
+ }
+
+ /// See the [Rust documentation for `round_with_mode`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.round_with_mode) for more information.
+ void roundWithMode(int position, DecimalSignedRoundingMode mode) {
+ _icu4x_Decimal_round_with_mode_mv1(_ffi, position, mode.index);
+ }
+
+ /// See the [Rust documentation for `round_with_mode_and_increment`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.round_with_mode_and_increment) for more information.
+ void roundWithModeAndIncrement(int position, DecimalSignedRoundingMode mode, DecimalRoundingIncrement increment) {
+ _icu4x_Decimal_round_with_mode_and_increment_mv1(_ffi, position, mode.index, increment.index);
+ }
+
+ /// Concatenates `other` to the end of `self`.
+ ///
+ /// If successful, `other` will be set to 0 and a successful status is returned.
+ ///
+ /// If not successful, `other` will be unchanged and an error is returned.
+ ///
+ /// See the [Rust documentation for `concatenate_end`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.concatenate_end) for more information.
+ bool concatenateEnd(Decimal other) {
+ final result = _icu4x_Decimal_concatenate_end_mv1(_ffi, other._ffi);
+ return result.isOk;
+ }
+
+ /// Format the [Decimal] as a string.
+ ///
+ /// See the [Rust documentation for `write_to`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/type.Decimal.html#method.write_to) for more information.
+ @override
+ String toString() {
+ final write = _Write();
+ _icu4x_Decimal_to_string_mv1(_ffi, write._ffi);
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_Decimal_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Decimal_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_from_int64_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Int64)>(isLeaf: true, symbol: 'icu4x_Decimal_from_int64_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_Decimal_from_int64_mv1(int v);
+
+@_DiplomatFfiUse('icu4x_Decimal_from_double_with_lower_magnitude_mv1')
+@ffi.Native<_ResultOpaqueDecimalLimitErrorFfi Function(ffi.Double, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_from_double_with_lower_magnitude_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueDecimalLimitErrorFfi _icu4x_Decimal_from_double_with_lower_magnitude_mv1(double f, int magnitude);
+
+@_DiplomatFfiUse('icu4x_Decimal_from_double_with_significant_digits_mv1')
+@ffi.Native<_ResultOpaqueDecimalLimitErrorFfi Function(ffi.Double, ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_Decimal_from_double_with_significant_digits_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueDecimalLimitErrorFfi _icu4x_Decimal_from_double_with_significant_digits_mv1(double f, int digits);
+
+@_DiplomatFfiUse('icu4x_Decimal_from_double_with_round_trip_precision_mv1')
+@ffi.Native<_ResultOpaqueDecimalLimitErrorFfi Function(ffi.Double)>(isLeaf: true, symbol: 'icu4x_Decimal_from_double_with_round_trip_precision_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueDecimalLimitErrorFfi _icu4x_Decimal_from_double_with_round_trip_precision_mv1(double f);
+
+@_DiplomatFfiUse('icu4x_Decimal_from_string_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Decimal_from_string_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_Decimal_from_string_mv1(_SliceUtf8 v);
+
+@_DiplomatFfiUse('icu4x_Decimal_digit_at_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_digit_at_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Decimal_digit_at_mv1(ffi.Pointer<ffi.Opaque> self, int magnitude);
+
+@_DiplomatFfiUse('icu4x_Decimal_magnitude_start_mv1')
+@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_magnitude_start_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Decimal_magnitude_start_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_magnitude_end_mv1')
+@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_magnitude_end_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Decimal_magnitude_end_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_nonzero_magnitude_start_mv1')
+@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_nonzero_magnitude_start_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Decimal_nonzero_magnitude_start_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_nonzero_magnitude_end_mv1')
+@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_nonzero_magnitude_end_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Decimal_nonzero_magnitude_end_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_is_zero_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_is_zero_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_Decimal_is_zero_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_multiply_pow10_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_multiply_pow10_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_multiply_pow10_mv1(ffi.Pointer<ffi.Opaque> self, int power);
+
+@_DiplomatFfiUse('icu4x_Decimal_sign_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_sign_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Decimal_sign_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_set_sign_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Decimal_set_sign_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_set_sign_mv1(ffi.Pointer<ffi.Opaque> self, int sign);
+
+@_DiplomatFfiUse('icu4x_Decimal_apply_sign_display_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Decimal_apply_sign_display_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_apply_sign_display_mv1(ffi.Pointer<ffi.Opaque> self, int signDisplay);
+
+@_DiplomatFfiUse('icu4x_Decimal_trim_start_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_trim_start_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_trim_start_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_trim_end_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_trim_end_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_trim_end_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_trim_end_if_integer_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_trim_end_if_integer_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_trim_end_if_integer_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Decimal_pad_start_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_pad_start_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_pad_start_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_pad_end_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_pad_end_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_pad_end_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_set_max_position_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_set_max_position_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_set_max_position_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_round_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_round_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_round_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_ceil_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_ceil_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_ceil_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_expand_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_expand_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_expand_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_floor_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_floor_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_floor_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_trunc_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(isLeaf: true, symbol: 'icu4x_Decimal_trunc_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_trunc_mv1(ffi.Pointer<ffi.Opaque> self, int position);
+
+@_DiplomatFfiUse('icu4x_Decimal_round_with_mode_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Decimal_round_with_mode_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_round_with_mode_mv1(ffi.Pointer<ffi.Opaque> self, int position, int mode);
+
+@_DiplomatFfiUse('icu4x_Decimal_round_with_mode_and_increment_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Decimal_round_with_mode_and_increment_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_round_with_mode_and_increment_mv1(ffi.Pointer<ffi.Opaque> self, int position, int mode, int increment);
+
+@_DiplomatFfiUse('icu4x_Decimal_concatenate_end_mv1')
+@ffi.Native<_ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_concatenate_end_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidVoid _icu4x_Decimal_concatenate_end_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> other);
+
+@_DiplomatFfiUse('icu4x_Decimal_to_string_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Decimal_to_string_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_Decimal_to_string_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalFormatter.g.dart
new file mode 100644
index 0000000..e32f6c7
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalFormatter.g.dart
@@ -0,0 +1,105 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// An ICU4X Decimal Format object, capable of formatting a [Decimal] as a string.
+///
+/// See the [Rust documentation for `DecimalFormatter`](https://docs.rs/icu/2.0.0/icu/decimal/struct.DecimalFormatter.html) for more information.
+final class DecimalFormatter implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ DecimalFormatter._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_DecimalFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_DecimalFormatter_destroy_mv1));
+
+ /// Creates a new [DecimalFormatter], using compiled data
+ ///
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/decimal/struct.DecimalFormatter.html#method.try_new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory DecimalFormatter.withGroupingStrategy(Locale locale, [DecimalGroupingStrategy? groupingStrategy]) {
+ final result = _icu4x_DecimalFormatter_create_with_grouping_strategy_mv1(locale._ffi, groupingStrategy != null ? _ResultInt32Void.ok(groupingStrategy.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return DecimalFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new [DecimalFormatter], using a particular data source.
+ ///
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/decimal/struct.DecimalFormatter.html#method.try_new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory DecimalFormatter.withGroupingStrategyAndProvider(DataProvider provider, Locale locale, [DecimalGroupingStrategy? groupingStrategy]) {
+ final result = _icu4x_DecimalFormatter_create_with_grouping_strategy_and_provider_mv1(provider._ffi, locale._ffi, groupingStrategy != null ? _ResultInt32Void.ok(groupingStrategy.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return DecimalFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new [DecimalFormatter] from preconstructed locale data.
+ ///
+ /// See the [Rust documentation for `DecimalSymbolsV1`](https://docs.rs/icu/2.0.0/icu/decimal/provider/struct.DecimalSymbolsV1.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ static DecimalFormatter createWithManualData(String plusSignPrefix, String plusSignSuffix, String minusSignPrefix, String minusSignSuffix, String decimalSeparator, String groupingSeparator, int primaryGroupSize, int secondaryGroupSize, int minGroupSize, core.List<Rune> digits, [DecimalGroupingStrategy? groupingStrategy]) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_DecimalFormatter_create_with_manual_data_mv1(plusSignPrefix._utf8AllocIn(temp.arena), plusSignSuffix._utf8AllocIn(temp.arena), minusSignPrefix._utf8AllocIn(temp.arena), minusSignSuffix._utf8AllocIn(temp.arena), decimalSeparator._utf8AllocIn(temp.arena), groupingSeparator._utf8AllocIn(temp.arena), primaryGroupSize, secondaryGroupSize, minGroupSize, digits._uint32AllocIn(temp.arena), groupingStrategy != null ? _ResultInt32Void.ok(groupingStrategy.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return DecimalFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Formats a [Decimal] to a string.
+ ///
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/decimal/struct.DecimalFormatter.html#method.format) for more information.
+ String format(Decimal value) {
+ final write = _Write();
+ _icu4x_DecimalFormatter_format_mv1(_ffi, value._ffi, write._ffi);
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_DecimalFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DecimalFormatter_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DecimalFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_DecimalFormatter_create_with_grouping_strategy_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DecimalFormatter_create_with_grouping_strategy_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DecimalFormatter_create_with_grouping_strategy_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void groupingStrategy);
+
+@_DiplomatFfiUse('icu4x_DecimalFormatter_create_with_grouping_strategy_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DecimalFormatter_create_with_grouping_strategy_and_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DecimalFormatter_create_with_grouping_strategy_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void groupingStrategy);
+
+@_DiplomatFfiUse('icu4x_DecimalFormatter_create_with_manual_data_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8, _SliceUtf8, _SliceUtf8, _SliceUtf8, _SliceUtf8, _SliceUtf8, ffi.Uint8, ffi.Uint8, ffi.Uint8, _SliceRune, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DecimalFormatter_create_with_manual_data_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_DecimalFormatter_create_with_manual_data_mv1(_SliceUtf8 plusSignPrefix, _SliceUtf8 plusSignSuffix, _SliceUtf8 minusSignPrefix, _SliceUtf8 minusSignSuffix, _SliceUtf8 decimalSeparator, _SliceUtf8 groupingSeparator, int primaryGroupSize, int secondaryGroupSize, int minGroupSize, _SliceRune digits, _ResultInt32Void groupingStrategy);
+
+@_DiplomatFfiUse('icu4x_DecimalFormatter_format_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DecimalFormatter_format_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DecimalFormatter_format_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> value, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalGroupingStrategy.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalGroupingStrategy.g.dart
new file mode 100644
index 0000000..e53f710
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalGroupingStrategy.g.dart
@@ -0,0 +1,19 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `GroupingStrategy`](https://docs.rs/icu/2.0.0/icu/decimal/options/enum.GroupingStrategy.html) for more information.
+enum DecimalGroupingStrategy {
+
+ auto,
+
+ never,
+
+ always,
+
+ min2;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalLimitError.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalLimitError.g.dart
new file mode 100644
index 0000000..b306f97
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalLimitError.g.dart
@@ -0,0 +1,20 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/struct.LimitError.html)
+final class DecimalLimitError {
+
+ DecimalLimitError();
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is DecimalLimitError;
+
+ @override
+ int get hashCode => 0;
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalParseError.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalParseError.g.dart
new file mode 100644
index 0000000..8f377e5
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalParseError.g.dart
@@ -0,0 +1,17 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.ParseError.html)
+enum DecimalParseError {
+
+ unknown,
+
+ limit,
+
+ syntax;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalRoundingIncrement.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalRoundingIncrement.g.dart
new file mode 100644
index 0000000..9b8cb1a
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalRoundingIncrement.g.dart
@@ -0,0 +1,21 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Increment used in a rounding operation.
+///
+/// See the [Rust documentation for `RoundingIncrement`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.RoundingIncrement.html) for more information.
+enum DecimalRoundingIncrement {
+
+ multiplesOf1,
+
+ multiplesOf2,
+
+ multiplesOf5,
+
+ multiplesOf25;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalSign.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalSign.g.dart
new file mode 100644
index 0000000..6cec98d
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalSign.g.dart
@@ -0,0 +1,19 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// The sign of a Decimal, as shown in formatting.
+///
+/// See the [Rust documentation for `Sign`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.Sign.html) for more information.
+enum DecimalSign {
+ /// No sign (implicitly positive, e.g., 1729).
+ none,
+ /// A negative sign, e.g., -1729.
+ negative,
+ /// An explicit positive sign, e.g., +1729.
+ positive;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalSignDisplay.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalSignDisplay.g.dart
new file mode 100644
index 0000000..6f4227f
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalSignDisplay.g.dart
@@ -0,0 +1,23 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// ECMA-402 compatible sign display preference.
+///
+/// See the [Rust documentation for `SignDisplay`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.SignDisplay.html) for more information.
+enum DecimalSignDisplay {
+
+ auto,
+
+ never,
+
+ always,
+
+ exceptZero,
+
+ negative;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecimalSignedRoundingMode.g.dart b/pkgs/intl4x/lib/src/bindings/DecimalSignedRoundingMode.g.dart
new file mode 100644
index 0000000..52a8f6f
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/DecimalSignedRoundingMode.g.dart
@@ -0,0 +1,31 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Mode used in a rounding operation for signed numbers.
+///
+/// See the [Rust documentation for `SignedRoundingMode`](https://docs.rs/fixed_decimal/0.7.0/fixed_decimal/enum.SignedRoundingMode.html) for more information.
+enum DecimalSignedRoundingMode {
+
+ expand,
+
+ trunc,
+
+ halfExpand,
+
+ halfTrunc,
+
+ halfEven,
+
+ ceil,
+
+ floor,
+
+ halfCeil,
+
+ halfFloor;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Decomposed.g.dart b/pkgs/intl4x/lib/src/bindings/Decomposed.g.dart
index a677f0c..8faf3d5 100644
--- a/pkgs/intl4x/lib/src/bindings/Decomposed.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Decomposed.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -13,7 +14,7 @@
/// `second` will be NUL when the decomposition expands to a single character
/// (which may or may not be the original one)
///
-/// See the [Rust documentation for `Decomposed`](https://docs.rs/icu/latest/icu/normalizer/properties/enum.Decomposed.html) for more information.
+/// See the [Rust documentation for `Decomposed`](https://docs.rs/icu/2.0.0/icu/normalizer/properties/enum.Decomposed.html) for more information.
final class Decomposed {
final Rune first;
final Rune second;
@@ -24,9 +25,9 @@
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
- Decomposed._fromFfi(_DecomposedFfi ffi)
- : first = ffi.first,
- second = ffi.second;
+ Decomposed._fromFfi(_DecomposedFfi ffi) :
+ first = ffi.first,
+ second = ffi.second;
// ignore: unused_element
_DecomposedFfi _toFfi(ffi.Allocator temp) {
@@ -36,10 +37,18 @@
return struct;
}
- @override
- bool operator ==(Object other) =>
- other is Decomposed && other.first == first && other.second == second;
@override
- int get hashCode => Object.hashAll([first, second]);
+ bool operator ==(Object other) =>
+ other is Decomposed &&
+ other.first == first &&
+ other.second == second;
+
+ @override
+ int get hashCode => Object.hashAll([
+ first,
+ second,
+ ]);
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DecomposingNormalizer.g.dart b/pkgs/intl4x/lib/src/bindings/DecomposingNormalizer.g.dart
index d861c57..43c12ae 100644
--- a/pkgs/intl4x/lib/src/bindings/DecomposingNormalizer.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DecomposingNormalizer.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `DecomposingNormalizer`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html) for more information.
+/// See the [Rust documentation for `DecomposingNormalizer`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizer.html) for more information.
final class DecomposingNormalizer implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,33 +21,47 @@
}
}
- @_DiplomatFfiUse('ICU4XDecomposingNormalizer_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XDecomposingNormalizer_destroy),
- );
+ @_DiplomatFfiUse('icu4x_DecomposingNormalizer_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_DecomposingNormalizer_destroy_mv1));
- /// Construct a new ICU4XDecomposingNormalizer instance for NFC
+ /// Construct a new DecomposingNormalizer instance for NFD using compiled data.
///
- /// See the [Rust documentation for `new_nfd`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.new_nfd) for more information.
+ /// See the [Rust documentation for `new_nfd`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizer.html#method.new_nfd) for more information.
+ factory DecomposingNormalizer.nfd() {
+ final result = _icu4x_DecomposingNormalizer_create_nfd_mv1();
+ return DecomposingNormalizer._fromFfi(result, []);
+ }
+
+ /// Construct a new DecomposingNormalizer instance for NFD using a particular data source.
///
- /// Throws [Error] on failure.
- factory DecomposingNormalizer.nfd(DataProvider provider) {
- final result = _ICU4XDecomposingNormalizer_create_nfd(provider._ffi);
+ /// See the [Rust documentation for `new_nfd`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizer.html#method.new_nfd) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory DecomposingNormalizer.nfdWithProvider(DataProvider provider) {
+ final result = _icu4x_DecomposingNormalizer_create_nfd_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return DecomposingNormalizer._fromFfi(result.union.ok, []);
}
- /// Construct a new ICU4XDecomposingNormalizer instance for NFKC
+ /// Construct a new DecomposingNormalizer instance for NFKD using compiled data.
///
- /// See the [Rust documentation for `new_nfkd`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.new_nfkd) for more information.
+ /// See the [Rust documentation for `new_nfkd`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizer.html#method.new_nfkd) for more information.
+ factory DecomposingNormalizer.nfkd() {
+ final result = _icu4x_DecomposingNormalizer_create_nfkd_mv1();
+ return DecomposingNormalizer._fromFfi(result, []);
+ }
+
+ /// Construct a new DecomposingNormalizer instance for NFKD using a particular data source.
///
- /// Throws [Error] on failure.
- factory DecomposingNormalizer.nfkd(DataProvider provider) {
- final result = _ICU4XDecomposingNormalizer_create_nfkd(provider._ffi);
+ /// See the [Rust documentation for `new_nfkd`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizer.html#method.new_nfkd) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory DecomposingNormalizer.nfkdWithProvider(DataProvider provider) {
+ final result = _icu4x_DecomposingNormalizer_create_nfkd_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return DecomposingNormalizer._fromFfi(result.union.ok, []);
}
@@ -56,24 +71,12 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.normalize_utf8) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizerBorrowed.html#method.normalize_utf8) for more information.
String normalize(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XDecomposingNormalizer_normalize(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_DecomposingNormalizer_normalize_mv1(_ffi, s._utf8AllocIn(temp.arena), write._ffi);
+ return write.finalize();
}
/// Check if a string is normalized
@@ -81,72 +84,62 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `is_normalized_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.is_normalized_utf8) for more information.
+ /// See the [Rust documentation for `is_normalized_utf16`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizerBorrowed.html#method.is_normalized_utf16) for more information.
bool isNormalized(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XDecomposingNormalizer_is_normalized(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_DecomposingNormalizer_is_normalized_utf16_mv1(_ffi, s._utf16AllocIn(temp.arena));
return result;
}
+
+ /// Return the index a slice of potentially-invalid UTF-16 is normalized up to
+ ///
+ /// See the [Rust documentation for `split_normalized_utf16`](https://docs.rs/icu/2.0.0/icu/normalizer/struct.DecomposingNormalizerBorrowed.html#method.split_normalized_utf16) for more information.
+ int isNormalizedUpTo(String s) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_DecomposingNormalizer_is_normalized_utf16_up_to_mv1(_ffi, s._utf16AllocIn(temp.arena));
+ return result;
+ }
+
}
-@_DiplomatFfiUse('ICU4XDecomposingNormalizer_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XDecomposingNormalizer_destroy',
-)
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XDecomposingNormalizer_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_DecomposingNormalizer_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XDecomposingNormalizer_create_nfd')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDecomposingNormalizer_create_nfd',
-)
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_create_nfd_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_create_nfd_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDecomposingNormalizer_create_nfd(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_DecomposingNormalizer_create_nfd_mv1();
-@_DiplomatFfiUse('ICU4XDecomposingNormalizer_create_nfkd')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XDecomposingNormalizer_create_nfkd',
-)
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_create_nfd_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_create_nfd_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XDecomposingNormalizer_create_nfkd(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_DecomposingNormalizer_create_nfd_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XDecomposingNormalizer_normalize')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XDecomposingNormalizer_normalize')
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_create_nfkd_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_create_nfkd_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XDecomposingNormalizer_normalize(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_DecomposingNormalizer_create_nfkd_mv1();
-@_DiplomatFfiUse('ICU4XDecomposingNormalizer_is_normalized')
-@ffi.Native<
- ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XDecomposingNormalizer_is_normalized')
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_create_nfkd_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_create_nfkd_with_provider_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XDecomposingNormalizer_is_normalized(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
-);
+external _ResultOpaqueInt32 _icu4x_DecomposingNormalizer_create_nfkd_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_normalize_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_normalize_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_DecomposingNormalizer_normalize_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> write);
+
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_is_normalized_utf16_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_is_normalized_utf16_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_DecomposingNormalizer_is_normalized_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 s);
+
+@_DiplomatFfiUse('icu4x_DecomposingNormalizer_is_normalized_utf16_up_to_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_DecomposingNormalizer_is_normalized_utf16_up_to_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_DecomposingNormalizer_is_normalized_utf16_up_to_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 s);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DisplayNamesFallback.g.dart b/pkgs/intl4x/lib/src/bindings/DisplayNamesFallback.g.dart
index f8af403..bb0176c 100644
--- a/pkgs/intl4x/lib/src/bindings/DisplayNamesFallback.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DisplayNamesFallback.g.dart
@@ -1,6 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `Fallback`](https://docs.rs/icu/latest/icu/displaynames/options/enum.Fallback.html) for more information.
-enum DisplayNamesFallback { code, none }
+/// See the [Rust documentation for `Fallback`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/enum.Fallback.html) for more information.
+enum DisplayNamesFallback {
+
+ code,
+
+ none;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DisplayNamesOptions.g.dart b/pkgs/intl4x/lib/src/bindings/DisplayNamesOptions.g.dart
index 2408867..a1a5c9d 100644
--- a/pkgs/intl4x/lib/src/bindings/DisplayNamesOptions.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DisplayNamesOptions.g.dart
@@ -1,27 +1,21 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
final class _DisplayNamesOptionsFfi extends ffi.Struct {
- @ffi.Int32()
- external int style;
- @ffi.Int32()
- external int fallback;
- @ffi.Int32()
- external int languageDisplay;
+ external _ResultInt32Void style;
+ external _ResultInt32Void fallback;
+ external _ResultInt32Void languageDisplay;
}
-/// See the [Rust documentation for `DisplayNamesOptions`](https://docs.rs/icu/latest/icu/displaynames/options/struct.DisplayNamesOptions.html) for more information.
+/// See the [Rust documentation for `DisplayNamesOptions`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.DisplayNamesOptions.html) for more information.
final class DisplayNamesOptions {
- DisplayNamesStyle style;
- DisplayNamesFallback fallback;
- LanguageDisplay languageDisplay;
+ DisplayNamesStyle? style;
+ DisplayNamesFallback? fallback;
+ LanguageDisplay? languageDisplay;
- DisplayNamesOptions({
- required this.style,
- required this.fallback,
- required this.languageDisplay,
- });
+ DisplayNamesOptions({this.style, this.fallback, this.languageDisplay});
// This struct contains borrowed fields, so this takes in a list of
// "edges" corresponding to where each lifetime's data may have been borrowed from
@@ -29,20 +23,24 @@
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
- DisplayNamesOptions._fromFfi(_DisplayNamesOptionsFfi ffi)
- : style = DisplayNamesStyle.values[ffi.style],
- fallback = DisplayNamesFallback.values[ffi.fallback],
- languageDisplay = LanguageDisplay.values[ffi.languageDisplay];
+ DisplayNamesOptions._fromFfi(_DisplayNamesOptionsFfi ffi) :
+ style = ffi.style.isOk ? DisplayNamesStyle.values[ffi.style.union.ok] : null,
+ fallback = ffi.fallback.isOk ? DisplayNamesFallback.values[ffi.fallback.union.ok] : null,
+ languageDisplay = ffi.languageDisplay.isOk ? LanguageDisplay.values[ffi.languageDisplay.union.ok] : null;
// ignore: unused_element
_DisplayNamesOptionsFfi _toFfi(ffi.Allocator temp) {
final struct = ffi.Struct.create<_DisplayNamesOptionsFfi>();
- struct.style = style.index;
- struct.fallback = fallback.index;
- struct.languageDisplay = languageDisplay.index;
+ DisplayNamesStyle? style = this.style;
+ struct.style = style != null ? _ResultInt32Void.ok(style.index) : _ResultInt32Void.err();
+ DisplayNamesFallback? fallback = this.fallback;
+ struct.fallback = fallback != null ? _ResultInt32Void.ok(fallback.index) : _ResultInt32Void.err();
+ LanguageDisplay? languageDisplay = this.languageDisplay;
+ struct.languageDisplay = languageDisplay != null ? _ResultInt32Void.ok(languageDisplay.index) : _ResultInt32Void.err();
return struct;
}
+
@override
bool operator ==(Object other) =>
other is DisplayNamesOptions &&
@@ -51,5 +49,11 @@
other.languageDisplay == languageDisplay;
@override
- int get hashCode => Object.hashAll([style, fallback, languageDisplay]);
+ int get hashCode => Object.hashAll([
+ style,
+ fallback,
+ languageDisplay,
+ ]);
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/DisplayNamesStyle.g.dart b/pkgs/intl4x/lib/src/bindings/DisplayNamesStyle.g.dart
index 40af5d0..2103a79 100644
--- a/pkgs/intl4x/lib/src/bindings/DisplayNamesStyle.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/DisplayNamesStyle.g.dart
@@ -1,6 +1,19 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `Style`](https://docs.rs/icu/latest/icu/displaynames/options/enum.Style.html) for more information.
-enum DisplayNamesStyle { auto, narrow, short, long, menu }
+/// See the [Rust documentation for `Style`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/enum.Style.html) for more information.
+enum DisplayNamesStyle {
+
+ narrow,
+
+ short,
+
+ long,
+
+ menu;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/EastAsianWidth.g.dart b/pkgs/intl4x/lib/src/bindings/EastAsianWidth.g.dart
new file mode 100644
index 0000000..2133544
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/EastAsianWidth.g.dart
@@ -0,0 +1,95 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html) for more information.
+enum EastAsianWidth {
+ /// See the [Rust documentation for `Neutral`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#associatedconstant.Neutral) for more information.
+ neutral,
+ /// See the [Rust documentation for `Ambiguous`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#associatedconstant.Ambiguous) for more information.
+ ambiguous,
+ /// See the [Rust documentation for `Halfwidth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#associatedconstant.Halfwidth) for more information.
+ halfwidth,
+ /// See the [Rust documentation for `Fullwidth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#associatedconstant.Fullwidth) for more information.
+ fullwidth,
+ /// See the [Rust documentation for `Narrow`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#associatedconstant.Narrow) for more information.
+ narrow,
+ /// See the [Rust documentation for `Wide`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#associatedconstant.Wide) for more information.
+ wide;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static EastAsianWidth forChar(Rune ch) {
+ final result = _icu4x_EastAsianWidth_for_char_mv1(ch);
+ return EastAsianWidth.values[result];
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_EastAsianWidth_long_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_EastAsianWidth_short_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_EastAsianWidth_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html#method.from_icu4c_value) for more information.
+ static EastAsianWidth? fromIntegerValue(int other) {
+ final result = _icu4x_EastAsianWidth_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return EastAsianWidth.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_EastAsianWidth_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_EastAsianWidth_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_EastAsianWidth_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_EastAsianWidth_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_EastAsianWidth_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_EastAsianWidth_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_EastAsianWidth_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_EastAsianWidth_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_EastAsianWidth_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_EastAsianWidth_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_EastAsianWidth_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_EastAsianWidth_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_EastAsianWidth_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_EastAsianWidth_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_EastAsianWidth_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/EmojiSetData.g.dart b/pkgs/intl4x/lib/src/bindings/EmojiSetData.g.dart
new file mode 100644
index 0000000..81cc851
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/EmojiSetData.g.dart
@@ -0,0 +1,100 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// An ICU4X Unicode Set Property object, capable of querying whether a code point is contained in a set based on a Unicode property.
+///
+/// See the [Rust documentation for `properties`](https://docs.rs/icu/2.0.0/icu/properties/index.html) for more information.
+///
+/// See the [Rust documentation for `EmojiSetData`](https://docs.rs/icu/2.0.0/icu/properties/struct.EmojiSetData.html) for more information.
+///
+/// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/properties/struct.EmojiSetData.html#method.new) for more information.
+///
+/// See the [Rust documentation for `EmojiSetDataBorrowed`](https://docs.rs/icu/2.0.0/icu/properties/struct.EmojiSetDataBorrowed.html) for more information.
+final class EmojiSetData implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ EmojiSetData._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_EmojiSetData_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_EmojiSetData_destroy_mv1));
+
+ /// Checks whether the string is in the set.
+ ///
+ /// See the [Rust documentation for `contains_str`](https://docs.rs/icu/2.0.0/icu/properties/struct.EmojiSetDataBorrowed.html#method.contains_str) for more information.
+ bool containsStr(String s) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_EmojiSetData_contains_str_mv1(_ffi, s._utf8AllocIn(temp.arena));
+ return result;
+ }
+
+ /// Checks whether the code point is in the set.
+ ///
+ /// See the [Rust documentation for `contains`](https://docs.rs/icu/2.0.0/icu/properties/struct.EmojiSetDataBorrowed.html#method.contains) for more information.
+ bool contains(Rune cp) {
+ final result = _icu4x_EmojiSetData_contains_mv1(_ffi, cp);
+ return result;
+ }
+
+ /// Create a map for the `Basic_Emoji` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `BasicEmoji`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BasicEmoji.html) for more information.
+ factory EmojiSetData.basic() {
+ final result = _icu4x_EmojiSetData_create_basic_mv1();
+ return EmojiSetData._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Basic_Emoji` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `BasicEmoji`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BasicEmoji.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory EmojiSetData.basicWithProvider(DataProvider provider) {
+ final result = _icu4x_EmojiSetData_create_basic_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return EmojiSetData._fromFfi(result.union.ok, []);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_EmojiSetData_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_EmojiSetData_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_EmojiSetData_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_EmojiSetData_contains_str_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_EmojiSetData_contains_str_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_EmojiSetData_contains_str_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s);
+
+@_DiplomatFfiUse('icu4x_EmojiSetData_contains_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_EmojiSetData_contains_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_EmojiSetData_contains_mv1(ffi.Pointer<ffi.Opaque> self, Rune cp);
+
+@_DiplomatFfiUse('icu4x_EmojiSetData_create_basic_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_EmojiSetData_create_basic_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_EmojiSetData_create_basic_mv1();
+
+@_DiplomatFfiUse('icu4x_EmojiSetData_create_basic_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_EmojiSetData_create_basic_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_EmojiSetData_create_basic_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Error.g.dart b/pkgs/intl4x/lib/src/bindings/Error.g.dart
deleted file mode 100644
index 529d9ec..0000000
--- a/pkgs/intl4x/lib/src/bindings/Error.g.dart
+++ /dev/null
@@ -1,253 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// A common enum for errors that ICU4X may return, organized by API
-///
-/// The error names are stable and can be checked against as strings in the JS API
-///
-/// Additional information: [1](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.FixedDecimalError.html), [2](https://docs.rs/icu/latest/icu/calendar/enum.CalendarError.html), [3](https://docs.rs/icu/latest/icu/collator/enum.CollatorError.html), [4](https://docs.rs/icu/latest/icu/datetime/enum.DateTimeError.html), [5](https://docs.rs/icu/latest/icu/decimal/enum.DecimalError.html), [6](https://docs.rs/icu/latest/icu/list/enum.ListError.html), [7](https://docs.rs/icu/latest/icu/locid/enum.ParserError.html), [8](https://docs.rs/icu/latest/icu/locid_transform/enum.LocaleTransformError.html), [9](https://docs.rs/icu/latest/icu/normalizer/enum.NormalizerError.html), [10](https://docs.rs/icu/latest/icu/plurals/enum.PluralsError.html), [11](https://docs.rs/icu/latest/icu/properties/enum.PropertiesError.html), [12](https://docs.rs/icu/latest/icu/provider/struct.DataError.html), [13](https://docs.rs/icu/latest/icu/provider/enum.DataErrorKind.html), [14](https://docs.rs/icu/latest/icu/segmenter/enum.SegmenterError.html), [15](https://docs.rs/icu/latest/icu/timezone/enum.TimeZoneError.html), [16](https://docs.rs/icu_experimental/latest/icu_experimental/units/enum.ConversionError.html)
-enum Error {
- /// The error is not currently categorized as ICU4XError.
- /// Please file a bug
- unknownError,
-
- /// An error arising from writing to a string
- /// Typically found when not enough space is allocated
- /// Most APIs that return a string may return this error
- writeableError,
-
- /// Some input was out of bounds
- outOfBoundsError,
-
- /// Input expected to be UTF-8 was ill-formed
- utf8Error,
-
- dataMissingDataKeyError,
-
- dataMissingVariantError,
-
- dataMissingLocaleError,
-
- dataNeedsVariantError,
-
- dataNeedsLocaleError,
-
- dataExtraneousLocaleError,
-
- dataFilteredResourceError,
-
- dataMismatchedTypeError,
-
- dataMissingPayloadError,
-
- dataInvalidStateError,
-
- dataCustomError,
-
- dataIoError,
-
- dataUnavailableBufferFormatError,
-
- dataMismatchedAnyBufferError,
-
- /// The subtag being requested was not set
- localeUndefinedSubtagError,
-
- /// The locale or subtag string failed to parse
- localeParserLanguageError,
-
- localeParserSubtagError,
-
- localeParserExtensionError,
-
- /// Attempted to construct an invalid data struct
- dataStructValidityError,
-
- propertyUnknownScriptIdError,
-
- propertyUnknownGeneralCategoryGroupError,
-
- propertyUnexpectedPropertyNameError,
-
- fixedDecimalLimitError,
-
- fixedDecimalSyntaxError,
-
- pluralsParserError,
-
- calendarParseError,
-
- calendarOverflowError,
-
- calendarUnderflowError,
-
- calendarOutOfRangeError,
-
- calendarUnknownEraError,
-
- calendarUnknownMonthCodeError,
-
- calendarMissingInputError,
-
- calendarUnknownKindError,
-
- calendarMissingError,
-
- dateTimePatternError,
-
- dateTimeMissingInputFieldError,
-
- dateTimeSkeletonError,
-
- dateTimeUnsupportedFieldError,
-
- dateTimeUnsupportedOptionsError,
-
- dateTimeMissingWeekdaySymbolError,
-
- dateTimeMissingMonthSymbolError,
-
- dateTimeFixedDecimalError,
-
- dateTimeMismatchedCalendarError,
-
- tinyStrTooLargeError,
-
- tinyStrContainsNullError,
-
- tinyStrNonAsciiError,
-
- timeZoneOffsetOutOfBoundsError,
-
- timeZoneInvalidOffsetError,
-
- timeZoneMissingInputError,
-
- timeZoneInvalidIdError,
-
- normalizerFutureExtensionError,
-
- normalizerValidationError,
-
- invalidCldrUnitIdentifierError;
-
- int get _ffi {
- switch (this) {
- case unknownError:
- return 0;
- case writeableError:
- return 1;
- case outOfBoundsError:
- return 2;
- case utf8Error:
- return 3;
- case dataMissingDataKeyError:
- return 256;
- case dataMissingVariantError:
- return 257;
- case dataMissingLocaleError:
- return 258;
- case dataNeedsVariantError:
- return 259;
- case dataNeedsLocaleError:
- return 260;
- case dataExtraneousLocaleError:
- return 261;
- case dataFilteredResourceError:
- return 262;
- case dataMismatchedTypeError:
- return 263;
- case dataMissingPayloadError:
- return 264;
- case dataInvalidStateError:
- return 265;
- case dataCustomError:
- return 266;
- case dataIoError:
- return 267;
- case dataUnavailableBufferFormatError:
- return 268;
- case dataMismatchedAnyBufferError:
- return 269;
- case localeUndefinedSubtagError:
- return 512;
- case localeParserLanguageError:
- return 513;
- case localeParserSubtagError:
- return 514;
- case localeParserExtensionError:
- return 515;
- case dataStructValidityError:
- return 768;
- case propertyUnknownScriptIdError:
- return 1024;
- case propertyUnknownGeneralCategoryGroupError:
- return 1025;
- case propertyUnexpectedPropertyNameError:
- return 1026;
- case fixedDecimalLimitError:
- return 1280;
- case fixedDecimalSyntaxError:
- return 1281;
- case pluralsParserError:
- return 1536;
- case calendarParseError:
- return 1792;
- case calendarOverflowError:
- return 1793;
- case calendarUnderflowError:
- return 1794;
- case calendarOutOfRangeError:
- return 1795;
- case calendarUnknownEraError:
- return 1796;
- case calendarUnknownMonthCodeError:
- return 1797;
- case calendarMissingInputError:
- return 1798;
- case calendarUnknownKindError:
- return 1799;
- case calendarMissingError:
- return 1800;
- case dateTimePatternError:
- return 2048;
- case dateTimeMissingInputFieldError:
- return 2049;
- case dateTimeSkeletonError:
- return 2050;
- case dateTimeUnsupportedFieldError:
- return 2051;
- case dateTimeUnsupportedOptionsError:
- return 2052;
- case dateTimeMissingWeekdaySymbolError:
- return 2053;
- case dateTimeMissingMonthSymbolError:
- return 2054;
- case dateTimeFixedDecimalError:
- return 2055;
- case dateTimeMismatchedCalendarError:
- return 2056;
- case tinyStrTooLargeError:
- return 2304;
- case tinyStrContainsNullError:
- return 2305;
- case tinyStrNonAsciiError:
- return 2306;
- case timeZoneOffsetOutOfBoundsError:
- return 2560;
- case timeZoneInvalidOffsetError:
- return 2561;
- case timeZoneMissingInputError:
- return 2562;
- case timeZoneInvalidIdError:
- return 2563;
- case normalizerFutureExtensionError:
- return 2816;
- case normalizerValidationError:
- return 2817;
- case invalidCldrUnitIdentifierError:
- return 3072;
- }
- }
-}
diff --git a/pkgs/intl4x/lib/src/bindings/ExemplarCharacters.g.dart b/pkgs/intl4x/lib/src/bindings/ExemplarCharacters.g.dart
new file mode 100644
index 0000000..5a5d3e7
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/ExemplarCharacters.g.dart
@@ -0,0 +1,247 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// A set of "exemplar characters" for a given locale.
+///
+/// See the [Rust documentation for `locale`](https://docs.rs/icu/2.0.0/icu/locale/index.html) for more information.
+///
+/// See the [Rust documentation for `ExemplarCharacters`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html) for more information.
+///
+/// See the [Rust documentation for `ExemplarCharactersBorrowed`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharactersBorrowed.html) for more information.
+final class ExemplarCharacters implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ ExemplarCharacters._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_ExemplarCharacters_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ExemplarCharacters_destroy_mv1));
+
+ /// Checks whether the string is in the set.
+ ///
+ /// See the [Rust documentation for `contains_str`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvliststringlist/struct.CodePointInversionListAndStringList.html#method.contains_str) for more information.
+ bool containsStr(String s) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_ExemplarCharacters_contains_str_mv1(_ffi, s._utf8AllocIn(temp.arena));
+ return result;
+ }
+
+ /// Checks whether the code point is in the set.
+ ///
+ /// See the [Rust documentation for `contains`](https://docs.rs/icu/2.0.0/icu/collections/codepointinvliststringlist/struct.CodePointInversionListAndStringList.html#method.contains) for more information.
+ bool contains(Rune cp) {
+ final result = _icu4x_ExemplarCharacters_contains_mv1(_ffi, cp);
+ return result;
+ }
+
+ /// Create an [ExemplarCharacters] for the "main" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_main`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_main) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.main(Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_main_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "main" set of exemplar characters for a given locale, using a particular data source
+ ///
+ /// See the [Rust documentation for `try_new_main`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_main) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.mainWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_main_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "auxiliary" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_auxiliary`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_auxiliary) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.auxiliary(Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_auxiliary_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "auxiliary" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_auxiliary`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_auxiliary) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.auxiliaryWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_auxiliary_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "punctuation" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_punctuation`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_punctuation) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.punctuation(Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_punctuation_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "punctuation" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_punctuation`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_punctuation) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.punctuationWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_punctuation_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "numbers" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_numbers`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_numbers) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.numbers(Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_numbers_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "numbers" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_numbers`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_numbers) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.numbersWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_numbers_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "index" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_index`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_index) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.index(Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_index_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+ /// Create an [ExemplarCharacters] for the "index" set of exemplar characters for a given locale, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_index`](https://docs.rs/icu/2.0.0/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_index) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ExemplarCharacters.indexWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_ExemplarCharacters_create_index_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ExemplarCharacters._fromFfi(result.union.ok, []);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_ExemplarCharacters_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_contains_str_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_contains_str_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_ExemplarCharacters_contains_str_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_contains_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_contains_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_ExemplarCharacters_contains_mv1(ffi.Pointer<ffi.Opaque> self, Rune cp);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_main_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_main_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_main_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_main_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_main_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_main_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_auxiliary_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_auxiliary_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_auxiliary_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_auxiliary_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_auxiliary_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_auxiliary_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_punctuation_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_punctuation_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_punctuation_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_punctuation_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_punctuation_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_punctuation_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_numbers_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_numbers_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_numbers_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_numbers_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_numbers_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_numbers_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_index_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_index_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_index_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_ExemplarCharacters_create_index_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ExemplarCharacters_create_index_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ExemplarCharacters_create_index_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimal.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimal.g.dart
deleted file mode 100644
index ea6a86e..0000000
--- a/pkgs/intl4x/lib/src/bindings/FixedDecimal.g.dart
+++ /dev/null
@@ -1,749 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information.
-final class FixedDecimal implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- FixedDecimal._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XFixedDecimal_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XFixedDecimal_destroy),
- );
-
- /// Construct an [`FixedDecimal`] from an integer.
- ///
- /// See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information.
- factory FixedDecimal.fromInt(int v) {
- final result = _ICU4XFixedDecimal_create_from_i64(v);
- return FixedDecimal._fromFfi(result, []);
- }
-
- /// Construct an [`FixedDecimal`] from an float, with a given power of 10 for the lower magnitude
- ///
- /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information.
- ///
- /// See the [Rust documentation for `FloatPrecision`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.FloatPrecision.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory FixedDecimal.fromDoubleWithLowerMagnitude(double f, int magnitude) {
- final result = _ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(
- f,
- magnitude,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return FixedDecimal._fromFfi(result.union.ok, []);
- }
-
- /// Construct an [`FixedDecimal`] from an float, for a given number of significant digits
- ///
- /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information.
- ///
- /// See the [Rust documentation for `FloatPrecision`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.FloatPrecision.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory FixedDecimal.fromDoubleWithSignificantDigits(double f, int digits) {
- final result = _ICU4XFixedDecimal_create_from_f64_with_significant_digits(
- f,
- digits,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return FixedDecimal._fromFfi(result.union.ok, []);
- }
-
- /// Construct an [`FixedDecimal`] from an float, with enough digits to recover
- /// the original floating point in IEEE 754 without needing trailing zeros
- ///
- /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information.
- ///
- /// See the [Rust documentation for `FloatPrecision`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.FloatPrecision.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory FixedDecimal.fromDoubleWithDoublePrecision(double f) {
- final result = _ICU4XFixedDecimal_create_from_f64_with_floating_precision(
- f,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return FixedDecimal._fromFfi(result.union.ok, []);
- }
-
- /// Construct an [`FixedDecimal`] from a string.
- ///
- /// See the [Rust documentation for `from_str`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.from_str) for more information.
- ///
- /// Throws [Error] on failure.
- factory FixedDecimal.fromString(String v) {
- final temp = ffi2.Arena();
- final vView = v.utf8View;
- final result = _ICU4XFixedDecimal_create_from_string(
- vView.allocIn(temp),
- vView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return FixedDecimal._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `digit_at`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.digit_at) for more information.
- int digitAt(int magnitude) {
- final result = _ICU4XFixedDecimal_digit_at(_ffi, magnitude);
- return result;
- }
-
- /// See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range) for more information.
- int get magnitudeStart {
- final result = _ICU4XFixedDecimal_magnitude_start(_ffi);
- return result;
- }
-
- /// See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range) for more information.
- int get magnitudeEnd {
- final result = _ICU4XFixedDecimal_magnitude_end(_ffi);
- return result;
- }
-
- /// See the [Rust documentation for `nonzero_magnitude_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_start) for more information.
- int get nonzeroMagnitudeStart {
- final result = _ICU4XFixedDecimal_nonzero_magnitude_start(_ffi);
- return result;
- }
-
- /// See the [Rust documentation for `nonzero_magnitude_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_end) for more information.
- int get nonzeroMagnitudeEnd {
- final result = _ICU4XFixedDecimal_nonzero_magnitude_end(_ffi);
- return result;
- }
-
- /// See the [Rust documentation for `is_zero`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.is_zero) for more information.
- bool get isZero {
- final result = _ICU4XFixedDecimal_is_zero(_ffi);
- return result;
- }
-
- /// Multiply the [`FixedDecimal`] by a given power of ten.
- ///
- /// See the [Rust documentation for `multiply_pow10`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.multiply_pow10) for more information.
- void multiplyPow10(int power) {
- _ICU4XFixedDecimal_multiply_pow10(_ffi, power);
- }
-
- /// See the [Rust documentation for `sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.sign) for more information.
- FixedDecimalSign get sign {
- final result = _ICU4XFixedDecimal_sign(_ffi);
- return FixedDecimalSign.values[result];
- }
-
- /// Set the sign of the [`FixedDecimal`].
- ///
- /// See the [Rust documentation for `set_sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.set_sign) for more information.
- set sign(FixedDecimalSign sign) {
- _ICU4XFixedDecimal_set_sign(_ffi, sign.index);
- }
-
- /// See the [Rust documentation for `apply_sign_display`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.apply_sign_display) for more information.
- void applySignDisplay(FixedDecimalSignDisplay signDisplay) {
- _ICU4XFixedDecimal_apply_sign_display(_ffi, signDisplay.index);
- }
-
- /// See the [Rust documentation for `trim_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_start) for more information.
- void trimStart() {
- _ICU4XFixedDecimal_trim_start(_ffi);
- }
-
- /// See the [Rust documentation for `trim_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_end) for more information.
- void trimEnd() {
- _ICU4XFixedDecimal_trim_end(_ffi);
- }
-
- /// Zero-pad the [`FixedDecimal`] on the left to a particular position
- ///
- /// See the [Rust documentation for `pad_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_start) for more information.
- void padStart(int position) {
- _ICU4XFixedDecimal_pad_start(_ffi, position);
- }
-
- /// Zero-pad the [`FixedDecimal`] on the right to a particular position
- ///
- /// See the [Rust documentation for `pad_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_end) for more information.
- void padEnd(int position) {
- _ICU4XFixedDecimal_pad_end(_ffi, position);
- }
-
- /// Truncate the [`FixedDecimal`] on the left to a particular position, deleting digits if necessary. This is useful for, e.g. abbreviating years
- /// ("2022" -> "22")
- ///
- /// See the [Rust documentation for `set_max_position`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.set_max_position) for more information.
- void setMaxPosition(int position) {
- _ICU4XFixedDecimal_set_max_position(_ffi, position);
- }
-
- /// See the [Rust documentation for `trunc`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trunc) for more information.
- void trunc(int position) {
- _ICU4XFixedDecimal_trunc(_ffi, position);
- }
-
- /// See the [Rust documentation for `trunc_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trunc_to_increment) for more information.
- void truncToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_trunc_to_increment(_ffi, position, increment.index);
- }
-
- /// See the [Rust documentation for `half_trunc`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_trunc) for more information.
- void halfTrunc(int position) {
- _ICU4XFixedDecimal_half_trunc(_ffi, position);
- }
-
- /// See the [Rust documentation for `half_trunc_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_trunc_to_increment) for more information.
- void halfTruncToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_half_trunc_to_increment(_ffi, position, increment.index);
- }
-
- /// See the [Rust documentation for `expand`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.expand) for more information.
- void expand(int position) {
- _ICU4XFixedDecimal_expand(_ffi, position);
- }
-
- /// See the [Rust documentation for `expand_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.expand_to_increment) for more information.
- void expandToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_expand_to_increment(_ffi, position, increment.index);
- }
-
- /// See the [Rust documentation for `half_expand`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_expand) for more information.
- void halfExpand(int position) {
- _ICU4XFixedDecimal_half_expand(_ffi, position);
- }
-
- /// See the [Rust documentation for `half_expand_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_expand_to_increment) for more information.
- void halfExpandToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_half_expand_to_increment(
- _ffi,
- position,
- increment.index,
- );
- }
-
- /// See the [Rust documentation for `ceil`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.ceil) for more information.
- void ceil(int position) {
- _ICU4XFixedDecimal_ceil(_ffi, position);
- }
-
- /// See the [Rust documentation for `ceil_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.ceil_to_increment) for more information.
- void ceilToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_ceil_to_increment(_ffi, position, increment.index);
- }
-
- /// See the [Rust documentation for `half_ceil`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_ceil) for more information.
- void halfCeil(int position) {
- _ICU4XFixedDecimal_half_ceil(_ffi, position);
- }
-
- /// See the [Rust documentation for `half_ceil_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_ceil_to_increment) for more information.
- void halfCeilToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_half_ceil_to_increment(_ffi, position, increment.index);
- }
-
- /// See the [Rust documentation for `floor`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.floor) for more information.
- void floor(int position) {
- _ICU4XFixedDecimal_floor(_ffi, position);
- }
-
- /// See the [Rust documentation for `floor_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.floor_to_increment) for more information.
- void floorToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_floor_to_increment(_ffi, position, increment.index);
- }
-
- /// See the [Rust documentation for `half_floor`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_floor) for more information.
- void halfFloor(int position) {
- _ICU4XFixedDecimal_half_floor(_ffi, position);
- }
-
- /// See the [Rust documentation for `half_floor_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_floor_to_increment) for more information.
- void halfFloorToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_half_floor_to_increment(_ffi, position, increment.index);
- }
-
- /// See the [Rust documentation for `half_even`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_even) for more information.
- void halfEven(int position) {
- _ICU4XFixedDecimal_half_even(_ffi, position);
- }
-
- /// See the [Rust documentation for `half_even_to_increment`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_even_to_increment) for more information.
- void halfEvenToIncrement(int position, RoundingIncrement increment) {
- _ICU4XFixedDecimal_half_even_to_increment(_ffi, position, increment.index);
- }
-
- /// Concatenates `other` to the end of `self`.
- ///
- /// If successful, `other` will be set to 0 and a successful status is returned.
- ///
- /// If not successful, `other` will be unchanged and an error is returned.
- ///
- /// See the [Rust documentation for `concatenate_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.concatenate_end) for more information.
- bool concatenateEnd(FixedDecimal other) {
- final result = _ICU4XFixedDecimal_concatenate_end(_ffi, other._ffi);
- return result.isOk;
- }
-
- /// Format the [`FixedDecimal`] as a string.
- ///
- /// See the [Rust documentation for `write_to`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.write_to) for more information.
- @override
- String toString() {
- final writeable = _Writeable();
- _ICU4XFixedDecimal_to_string(_ffi, writeable._ffi);
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_create_from_i64')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Int64)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_create_from_i64',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XFixedDecimal_create_from_i64(int v);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_create_from_f64_with_lower_magnitude')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Double, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_create_from_f64_with_lower_magnitude',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(
- double f,
- int magnitude,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_create_from_f64_with_significant_digits')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Double, ffi.Uint8)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_create_from_f64_with_significant_digits',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XFixedDecimal_create_from_f64_with_significant_digits(
- double f,
- int digits,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_create_from_f64_with_floating_precision')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Double)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_create_from_f64_with_floating_precision',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XFixedDecimal_create_from_f64_with_floating_precision(double f);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_create_from_string')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_create_from_string',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XFixedDecimal_create_from_string(
- ffi.Pointer<ffi.Uint8> vData,
- int vLength,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_digit_at')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_digit_at',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XFixedDecimal_digit_at(
- ffi.Pointer<ffi.Opaque> self,
- int magnitude,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_magnitude_start')
-@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_magnitude_start',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XFixedDecimal_magnitude_start(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_magnitude_end')
-@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_magnitude_end',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XFixedDecimal_magnitude_end(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_nonzero_magnitude_start')
-@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_nonzero_magnitude_start',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XFixedDecimal_nonzero_magnitude_start(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_nonzero_magnitude_end')
-@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_nonzero_magnitude_end',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XFixedDecimal_nonzero_magnitude_end(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_is_zero')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_is_zero',
-)
-// ignore: non_constant_identifier_names
-external bool _ICU4XFixedDecimal_is_zero(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_multiply_pow10')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_multiply_pow10',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_multiply_pow10(
- ffi.Pointer<ffi.Opaque> self,
- int power,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_sign')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_sign',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XFixedDecimal_sign(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_set_sign')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_set_sign',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_set_sign(
- ffi.Pointer<ffi.Opaque> self,
- int sign,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_apply_sign_display')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_apply_sign_display',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_apply_sign_display(
- ffi.Pointer<ffi.Opaque> self,
- int signDisplay,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_trim_start')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_trim_start',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_trim_start(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_trim_end')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_trim_end',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_trim_end(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_pad_start')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_pad_start',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_pad_start(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_pad_end')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_pad_end',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_pad_end(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_set_max_position')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_set_max_position',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_set_max_position(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_trunc')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_trunc',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_trunc(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_trunc_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_trunc_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_trunc_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_trunc')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_trunc',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_trunc(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_trunc_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_trunc_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_trunc_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_expand')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_expand',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_expand(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_expand_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_expand_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_expand_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_expand')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_expand',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_expand(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_expand_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_expand_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_expand_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_ceil')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_ceil',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_ceil(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_ceil_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_ceil_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_ceil_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_ceil')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_ceil',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_ceil(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_ceil_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_ceil_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_ceil_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_floor')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_floor',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_floor(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_floor_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_floor_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_floor_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_floor')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_floor',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_floor(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_floor_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_floor_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_floor_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_even')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_even',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_even(
- ffi.Pointer<ffi.Opaque> self,
- int position,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_half_even_to_increment')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Int16, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimal_half_even_to_increment',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_half_even_to_increment(
- ffi.Pointer<ffi.Opaque> self,
- int position,
- int increment,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_concatenate_end')
-@ffi.Native<
- _ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XFixedDecimal_concatenate_end')
-// ignore: non_constant_identifier_names
-external _ResultVoidVoid _ICU4XFixedDecimal_concatenate_end(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> other,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimal_to_string')
-@ffi.Native<
- ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XFixedDecimal_to_string')
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimal_to_string(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalFormatter.g.dart
deleted file mode 100644
index 4cb2b88..0000000
--- a/pkgs/intl4x/lib/src/bindings/FixedDecimalFormatter.g.dart
+++ /dev/null
@@ -1,110 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An ICU4X Fixed Decimal Format object, capable of formatting a [`FixedDecimal`] as a string.
-///
-/// See the [Rust documentation for `FixedDecimalFormatter`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html) for more information.
-final class FixedDecimalFormatter implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- FixedDecimalFormatter._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XFixedDecimalFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XFixedDecimalFormatter_destroy),
- );
-
- /// Creates a new [`FixedDecimalFormatter`] from locale data.
- ///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.try_new) for more information.
- ///
- /// Throws [Error] on failure.
- factory FixedDecimalFormatter.withGroupingStrategy(
- DataProvider provider,
- Locale locale,
- FixedDecimalGroupingStrategy groupingStrategy,
- ) {
- final result = _ICU4XFixedDecimalFormatter_create_with_grouping_strategy(
- provider._ffi,
- locale._ffi,
- groupingStrategy.index,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return FixedDecimalFormatter._fromFfi(result.union.ok, []);
- }
-
- /// Formats a [`FixedDecimal`] to a string.
- ///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.format) for more information.
- ///
- /// Throws [Error] on failure.
- String format(FixedDecimal value) {
- final writeable = _Writeable();
- final result = _ICU4XFixedDecimalFormatter_format(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XFixedDecimalFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimalFormatter_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XFixedDecimalFormatter_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XFixedDecimalFormatter_create_with_grouping_strategy')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- )
->(
- isLeaf: true,
- symbol: 'ICU4XFixedDecimalFormatter_create_with_grouping_strategy',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XFixedDecimalFormatter_create_with_grouping_strategy(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int groupingStrategy,
-);
-
-@_DiplomatFfiUse('ICU4XFixedDecimalFormatter_format')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XFixedDecimalFormatter_format')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XFixedDecimalFormatter_format(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalGroupingStrategy.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalGroupingStrategy.g.dart
deleted file mode 100644
index 449da45..0000000
--- a/pkgs/intl4x/lib/src/bindings/FixedDecimalGroupingStrategy.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `GroupingStrategy`](https://docs.rs/icu/latest/icu/decimal/options/enum.GroupingStrategy.html) for more information.
-enum FixedDecimalGroupingStrategy { auto, never, always, min2 }
diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalSign.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalSign.g.dart
deleted file mode 100644
index 3a6e5a0..0000000
--- a/pkgs/intl4x/lib/src/bindings/FixedDecimalSign.g.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// The sign of a FixedDecimal, as shown in formatting.
-///
-/// See the [Rust documentation for `Sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.Sign.html) for more information.
-enum FixedDecimalSign {
- /// No sign (implicitly positive, e.g., 1729).
- none,
-
- /// A negative sign, e.g., -1729.
- negative,
-
- /// An explicit positive sign, e.g., +1729.
- positive,
-}
diff --git a/pkgs/intl4x/lib/src/bindings/FixedDecimalSignDisplay.g.dart b/pkgs/intl4x/lib/src/bindings/FixedDecimalSignDisplay.g.dart
deleted file mode 100644
index 987c622..0000000
--- a/pkgs/intl4x/lib/src/bindings/FixedDecimalSignDisplay.g.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// ECMA-402 compatible sign display preference.
-///
-/// See the [Rust documentation for `SignDisplay`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.SignDisplay.html) for more information.
-enum FixedDecimalSignDisplay { auto, never, always, exceptZero, negative }
diff --git a/pkgs/intl4x/lib/src/bindings/GeneralCategory.g.dart b/pkgs/intl4x/lib/src/bindings/GeneralCategory.g.dart
new file mode 100644
index 0000000..86b7b89
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/GeneralCategory.g.dart
@@ -0,0 +1,219 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `GeneralCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html) for more information.
+enum GeneralCategory {
+ /// See the [Rust documentation for `Unassigned`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.Unassigned) for more information.
+ unassigned,
+ /// See the [Rust documentation for `UppercaseLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.UppercaseLetter) for more information.
+ uppercaseLetter,
+ /// See the [Rust documentation for `LowercaseLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.LowercaseLetter) for more information.
+ lowercaseLetter,
+ /// See the [Rust documentation for `TitlecaseLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.TitlecaseLetter) for more information.
+ titlecaseLetter,
+ /// See the [Rust documentation for `ModifierLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.ModifierLetter) for more information.
+ modifierLetter,
+ /// See the [Rust documentation for `OtherLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherLetter) for more information.
+ otherLetter,
+ /// See the [Rust documentation for `NonspacingMark`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.NonspacingMark) for more information.
+ nonspacingMark,
+ /// See the [Rust documentation for `SpacingMark`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.SpacingMark) for more information.
+ spacingMark,
+ /// See the [Rust documentation for `EnclosingMark`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.EnclosingMark) for more information.
+ enclosingMark,
+ /// See the [Rust documentation for `DecimalNumber`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.DecimalNumber) for more information.
+ decimalNumber,
+ /// See the [Rust documentation for `LetterNumber`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.LetterNumber) for more information.
+ letterNumber,
+ /// See the [Rust documentation for `OtherNumber`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherNumber) for more information.
+ otherNumber,
+ /// See the [Rust documentation for `SpaceSeparator`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.SpaceSeparator) for more information.
+ spaceSeparator,
+ /// See the [Rust documentation for `LineSeparator`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.LineSeparator) for more information.
+ lineSeparator,
+ /// See the [Rust documentation for `ParagraphSeparator`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.ParagraphSeparator) for more information.
+ paragraphSeparator,
+ /// See the [Rust documentation for `Control`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.Control) for more information.
+ control,
+ /// See the [Rust documentation for `Format`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.Format) for more information.
+ format,
+ /// See the [Rust documentation for `PrivateUse`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.PrivateUse) for more information.
+ privateUse,
+ /// See the [Rust documentation for `Surrogate`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.Surrogate) for more information.
+ surrogate,
+ /// See the [Rust documentation for `DashPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.DashPunctuation) for more information.
+ dashPunctuation,
+ /// See the [Rust documentation for `OpenPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.OpenPunctuation) for more information.
+ openPunctuation,
+ /// See the [Rust documentation for `ClosePunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.ClosePunctuation) for more information.
+ closePunctuation,
+ /// See the [Rust documentation for `ConnectorPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.ConnectorPunctuation) for more information.
+ connectorPunctuation,
+ /// See the [Rust documentation for `InitialPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.InitialPunctuation) for more information.
+ initialPunctuation,
+ /// See the [Rust documentation for `FinalPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.FinalPunctuation) for more information.
+ finalPunctuation,
+ /// See the [Rust documentation for `OtherPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherPunctuation) for more information.
+ otherPunctuation,
+ /// See the [Rust documentation for `MathSymbol`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.MathSymbol) for more information.
+ mathSymbol,
+ /// See the [Rust documentation for `CurrencySymbol`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.CurrencySymbol) for more information.
+ currencySymbol,
+ /// See the [Rust documentation for `ModifierSymbol`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.ModifierSymbol) for more information.
+ modifierSymbol,
+ /// See the [Rust documentation for `OtherSymbol`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherSymbol) for more information.
+ otherSymbol;
+
+ int get _ffi {
+ switch (this) {
+ case unassigned:
+ return 0;
+ case uppercaseLetter:
+ return 1;
+ case lowercaseLetter:
+ return 2;
+ case titlecaseLetter:
+ return 3;
+ case modifierLetter:
+ return 4;
+ case otherLetter:
+ return 5;
+ case nonspacingMark:
+ return 6;
+ case spacingMark:
+ return 8;
+ case enclosingMark:
+ return 7;
+ case decimalNumber:
+ return 9;
+ case letterNumber:
+ return 10;
+ case otherNumber:
+ return 11;
+ case spaceSeparator:
+ return 12;
+ case lineSeparator:
+ return 13;
+ case paragraphSeparator:
+ return 14;
+ case control:
+ return 15;
+ case format:
+ return 16;
+ case privateUse:
+ return 17;
+ case surrogate:
+ return 18;
+ case dashPunctuation:
+ return 19;
+ case openPunctuation:
+ return 20;
+ case closePunctuation:
+ return 21;
+ case connectorPunctuation:
+ return 22;
+ case initialPunctuation:
+ return 28;
+ case finalPunctuation:
+ return 29;
+ case otherPunctuation:
+ return 23;
+ case mathSymbol:
+ return 24;
+ case currencySymbol:
+ return 25;
+ case modifierSymbol:
+ return 26;
+ case otherSymbol:
+ return 27;
+ }
+ }
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static GeneralCategory forChar(Rune ch) {
+ final result = _icu4x_GeneralCategory_for_char_mv1(ch);
+ return GeneralCategory.values.firstWhere((v) => v._ffi == result);
+ }
+
+ /// Convert to an integer using the ICU4C integer mappings for `General_Category`
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_GeneralCategory_long_name_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_GeneralCategory_short_name_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ int toIntegerValue() {
+ final result = _icu4x_GeneralCategory_to_integer_value_mv1(_ffi);
+ return result;
+ }
+
+ /// Produces a GeneralCategoryGroup mask that can represent a group of general categories
+ ///
+ /// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html) for more information.
+ GeneralCategoryGroup toGroup() {
+ final result = _icu4x_GeneralCategory_to_group_mv1(_ffi);
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// Convert from an integer using the ICU4C integer mappings for `General_Category`
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ static GeneralCategory? fromIntegerValue(int other) {
+ final result = _icu4x_GeneralCategory_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return GeneralCategory.values.firstWhere((v) => v._ffi == result.union.ok);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_GeneralCategory_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_GeneralCategory_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_GeneralCategory_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_GeneralCategory_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_GeneralCategory_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_GeneralCategory_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_GeneralCategory_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_GeneralCategory_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_GeneralCategory_to_group_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_to_group_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategory_to_group_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_GeneralCategory_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_GeneralCategory_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GeneralCategoryGroup.g.dart b/pkgs/intl4x/lib/src/bindings/GeneralCategoryGroup.g.dart
new file mode 100644
index 0000000..7275267
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/GeneralCategoryGroup.g.dart
@@ -0,0 +1,205 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _GeneralCategoryGroupFfi extends ffi.Struct {
+ @ffi.Uint32()
+ external int mask;
+}
+
+/// A mask that is capable of representing groups of `General_Category` values.
+///
+/// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html) for more information.
+final class GeneralCategoryGroup {
+ int mask;
+
+ GeneralCategoryGroup({required this.mask});
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ GeneralCategoryGroup._fromFfi(_GeneralCategoryGroupFfi ffi) :
+ mask = ffi.mask;
+
+ // ignore: unused_element
+ _GeneralCategoryGroupFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_GeneralCategoryGroupFfi>();
+ struct.mask = mask;
+ return struct;
+ }
+
+ /// See the [Rust documentation for `contains`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#method.contains) for more information.
+ bool contains(GeneralCategory val) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_GeneralCategoryGroup_contains_mv1(_toFfi(temp.arena), val._ffi);
+ return result;
+ }
+
+ /// See the [Rust documentation for `complement`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#method.complement) for more information.
+ GeneralCategoryGroup complement() {
+ final temp = _FinalizedArena();
+ final result = _icu4x_GeneralCategoryGroup_complement_mv1(_toFfi(temp.arena));
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `all`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#method.all) for more information.
+ static GeneralCategoryGroup all() {
+ final result = _icu4x_GeneralCategoryGroup_all_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `empty`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#method.empty) for more information.
+ static GeneralCategoryGroup empty() {
+ final result = _icu4x_GeneralCategoryGroup_empty_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `union`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#method.union) for more information.
+ GeneralCategoryGroup union(GeneralCategoryGroup other) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_GeneralCategoryGroup_union_mv1(_toFfi(temp.arena), other._toFfi(temp.arena));
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `intersection`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#method.intersection) for more information.
+ GeneralCategoryGroup intersection(GeneralCategoryGroup other) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_GeneralCategoryGroup_intersection_mv1(_toFfi(temp.arena), other._toFfi(temp.arena));
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `CasedLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.CasedLetter) for more information.
+ static GeneralCategoryGroup casedLetter() {
+ final result = _icu4x_GeneralCategoryGroup_cased_letter_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `Letter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.Letter) for more information.
+ static GeneralCategoryGroup letter() {
+ final result = _icu4x_GeneralCategoryGroup_letter_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `Mark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.Mark) for more information.
+ static GeneralCategoryGroup mark() {
+ final result = _icu4x_GeneralCategoryGroup_mark_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `Number`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.Number) for more information.
+ static GeneralCategoryGroup number() {
+ final result = _icu4x_GeneralCategoryGroup_number_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `Other`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.Other) for more information.
+ static GeneralCategoryGroup separator() {
+ final result = _icu4x_GeneralCategoryGroup_separator_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `Letter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.Letter) for more information.
+ static GeneralCategoryGroup other() {
+ final result = _icu4x_GeneralCategoryGroup_other_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `Punctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.Punctuation) for more information.
+ static GeneralCategoryGroup punctuation() {
+ final result = _icu4x_GeneralCategoryGroup_punctuation_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// See the [Rust documentation for `Symbol`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html#associatedconstant.Symbol) for more information.
+ static GeneralCategoryGroup symbol() {
+ final result = _icu4x_GeneralCategoryGroup_symbol_mv1();
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is GeneralCategoryGroup &&
+ other.mask == mask;
+
+ @override
+ int get hashCode => Object.hashAll([
+ mask,
+ ]);
+}
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_contains_mv1')
+@ffi.Native<ffi.Bool Function(_GeneralCategoryGroupFfi, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_contains_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_GeneralCategoryGroup_contains_mv1(_GeneralCategoryGroupFfi self, int val);
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_complement_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function(_GeneralCategoryGroupFfi)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_complement_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_complement_mv1(_GeneralCategoryGroupFfi self);
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_all_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_all_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_all_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_empty_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_empty_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_empty_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_union_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function(_GeneralCategoryGroupFfi, _GeneralCategoryGroupFfi)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_union_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_union_mv1(_GeneralCategoryGroupFfi self, _GeneralCategoryGroupFfi other);
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_intersection_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function(_GeneralCategoryGroupFfi, _GeneralCategoryGroupFfi)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_intersection_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_intersection_mv1(_GeneralCategoryGroupFfi self, _GeneralCategoryGroupFfi other);
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_cased_letter_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_cased_letter_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_cased_letter_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_letter_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_letter_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_letter_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_mark_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_mark_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_mark_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_number_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_number_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_number_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_separator_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_separator_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_separator_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_other_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_other_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_other_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_punctuation_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_punctuation_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_punctuation_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryGroup_symbol_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryGroup_symbol_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryGroup_symbol_mv1();
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GeneralCategoryNameToGroupMapper.g.dart b/pkgs/intl4x/lib/src/bindings/GeneralCategoryNameToGroupMapper.g.dart
new file mode 100644
index 0000000..5a0c77f
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/GeneralCategoryNameToGroupMapper.g.dart
@@ -0,0 +1,101 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// A type capable of looking up General Category Group values from a string name.
+///
+/// See the [Rust documentation for `PropertyParser`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParser.html) for more information.
+///
+/// See the [Rust documentation for `GeneralCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html) for more information.
+final class GeneralCategoryNameToGroupMapper implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ GeneralCategoryNameToGroupMapper._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_GeneralCategoryNameToGroupMapper_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_GeneralCategoryNameToGroupMapper_destroy_mv1));
+
+ /// Get the mask value matching the given name, using strict matching
+ ///
+ /// Returns 0 if the name is unknown for this property
+ ///
+ /// See the [Rust documentation for `get_strict`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParserBorrowed.html#method.get_strict) for more information.
+ GeneralCategoryGroup getStrict(String name) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_GeneralCategoryNameToGroupMapper_get_strict_mv1(_ffi, name._utf8AllocIn(temp.arena));
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// Get the mask value matching the given name, using loose matching
+ ///
+ /// Returns 0 if the name is unknown for this property
+ ///
+ /// See the [Rust documentation for `get_loose`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParserBorrowed.html#method.get_loose) for more information.
+ GeneralCategoryGroup getLoose(String name) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_GeneralCategoryNameToGroupMapper_get_loose_mv1(_ffi, name._utf8AllocIn(temp.arena));
+ return GeneralCategoryGroup._fromFfi(result);
+ }
+
+ /// Create a name-to-mask mapper for the `General_Category` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html) for more information.
+ factory GeneralCategoryNameToGroupMapper() {
+ final result = _icu4x_GeneralCategoryNameToGroupMapper_create_mv1();
+ return GeneralCategoryNameToGroupMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-mask mapper for the `General_Category` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GeneralCategoryGroup.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory GeneralCategoryNameToGroupMapper.withProvider(DataProvider provider) {
+ final result = _icu4x_GeneralCategoryNameToGroupMapper_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return GeneralCategoryNameToGroupMapper._fromFfi(result.union.ok, []);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryNameToGroupMapper_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryNameToGroupMapper_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_GeneralCategoryNameToGroupMapper_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryNameToGroupMapper_get_strict_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryNameToGroupMapper_get_strict_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryNameToGroupMapper_get_strict_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 name);
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryNameToGroupMapper_get_loose_mv1')
+@ffi.Native<_GeneralCategoryGroupFfi Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryNameToGroupMapper_get_loose_mv1')
+// ignore: non_constant_identifier_names
+external _GeneralCategoryGroupFfi _icu4x_GeneralCategoryNameToGroupMapper_get_loose_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 name);
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryNameToGroupMapper_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_GeneralCategoryNameToGroupMapper_create_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_GeneralCategoryNameToGroupMapper_create_mv1();
+
+@_DiplomatFfiUse('icu4x_GeneralCategoryNameToGroupMapper_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_GeneralCategoryNameToGroupMapper_create_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_GeneralCategoryNameToGroupMapper_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GeneralCategoryNameToMaskMapper.g.dart b/pkgs/intl4x/lib/src/bindings/GeneralCategoryNameToMaskMapper.g.dart
deleted file mode 100644
index 35cad83..0000000
--- a/pkgs/intl4x/lib/src/bindings/GeneralCategoryNameToMaskMapper.g.dart
+++ /dev/null
@@ -1,114 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// A type capable of looking up General Category mask values from a string name.
-///
-/// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html#method.name_to_enum_mapper) for more information.
-///
-/// See the [Rust documentation for `PropertyValueNameToEnumMapper`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapper.html) for more information.
-final class GeneralCategoryNameToMaskMapper implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- GeneralCategoryNameToMaskMapper._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XGeneralCategoryNameToMaskMapper_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGeneralCategoryNameToMaskMapper_destroy),
- );
-
- /// Get the mask value matching the given name, using strict matching
- ///
- /// Returns 0 if the name is unknown for this property
- int getStrict(String name) {
- final temp = ffi2.Arena();
- final nameView = name.utf8View;
- final result = _ICU4XGeneralCategoryNameToMaskMapper_get_strict(
- _ffi,
- nameView.allocIn(temp),
- nameView.length,
- );
- temp.releaseAll();
- return result;
- }
-
- /// Get the mask value matching the given name, using loose matching
- ///
- /// Returns 0 if the name is unknown for this property
- int getLoose(String name) {
- final temp = ffi2.Arena();
- final nameView = name.utf8View;
- final result = _ICU4XGeneralCategoryNameToMaskMapper_get_loose(
- _ffi,
- nameView.allocIn(temp),
- nameView.length,
- );
- temp.releaseAll();
- return result;
- }
-
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html#method.name_to_enum_mapper) for more information.
- ///
- /// Throws [Error] on failure.
- factory GeneralCategoryNameToMaskMapper(DataProvider provider) {
- final result = _ICU4XGeneralCategoryNameToMaskMapper_load(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return GeneralCategoryNameToMaskMapper._fromFfi(result.union.ok, []);
- }
-}
-
-@_DiplomatFfiUse('ICU4XGeneralCategoryNameToMaskMapper_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGeneralCategoryNameToMaskMapper_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XGeneralCategoryNameToMaskMapper_destroy(
- ffi.Pointer<ffi.Void> self,
-);
-
-@_DiplomatFfiUse('ICU4XGeneralCategoryNameToMaskMapper_get_strict')
-@ffi.Native<
- ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XGeneralCategoryNameToMaskMapper_get_strict')
-// ignore: non_constant_identifier_names
-external int _ICU4XGeneralCategoryNameToMaskMapper_get_strict(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> nameData,
- int nameLength,
-);
-
-@_DiplomatFfiUse('ICU4XGeneralCategoryNameToMaskMapper_get_loose')
-@ffi.Native<
- ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XGeneralCategoryNameToMaskMapper_get_loose')
-// ignore: non_constant_identifier_names
-external int _ICU4XGeneralCategoryNameToMaskMapper_get_loose(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> nameData,
- int nameLength,
-);
-
-@_DiplomatFfiUse('ICU4XGeneralCategoryNameToMaskMapper_load')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XGeneralCategoryNameToMaskMapper_load',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XGeneralCategoryNameToMaskMapper_load(
- ffi.Pointer<ffi.Opaque> provider,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreak.g.dart b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreak.g.dart
new file mode 100644
index 0000000..13757fe
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreak.g.dart
@@ -0,0 +1,87 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeClusterBreak.html) for more information.
+enum GraphemeClusterBreak {
+ /// See the [Rust documentation for `Other`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Other) for more information.
+ other,
+ /// See the [Rust documentation for `Control`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Control) for more information.
+ control,
+ /// See the [Rust documentation for `CR`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.CR) for more information.
+ cr,
+ /// See the [Rust documentation for `Extend`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Extend) for more information.
+ extend,
+ /// See the [Rust documentation for `L`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.L) for more information.
+ l,
+ /// See the [Rust documentation for `LF`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.LF) for more information.
+ lf,
+ /// See the [Rust documentation for `LV`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.LV) for more information.
+ lv,
+ /// See the [Rust documentation for `LVT`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.LVT) for more information.
+ lvt,
+ /// See the [Rust documentation for `T`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.T) for more information.
+ t,
+ /// See the [Rust documentation for `V`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.V) for more information.
+ v,
+ /// See the [Rust documentation for `SpacingMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.SpacingMark) for more information.
+ spacingMark,
+ /// See the [Rust documentation for `Prepend`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Prepend) for more information.
+ prepend,
+ /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.RegionalIndicator) for more information.
+ regionalIndicator,
+ /// See the [Rust documentation for `EBase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.EBase) for more information.
+ eBase,
+ /// See the [Rust documentation for `EBaseGAZ`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.EBaseGAZ) for more information.
+ eBaseGaz,
+ /// See the [Rust documentation for `EModifier`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.EModifier) for more information.
+ eModifier,
+ /// See the [Rust documentation for `GlueAfterZwj`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.GlueAfterZwj) for more information.
+ glueAfterZwj,
+ /// See the [Rust documentation for `ZWJ`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ZWJ) for more information.
+ zwj;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static GraphemeClusterBreak forChar(Rune ch) {
+ final result = _icu4x_GraphemeClusterBreak_for_char_mv1(ch);
+ return GraphemeClusterBreak.values[result];
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeClusterBreak.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_GraphemeClusterBreak_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeClusterBreak.html#method.from_icu4c_value) for more information.
+ static GraphemeClusterBreak? fromIntegerValue(int other) {
+ final result = _icu4x_GraphemeClusterBreak_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return GraphemeClusterBreak.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreak_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreak_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_GraphemeClusterBreak_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreak_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreak_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_GraphemeClusterBreak_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreak_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreak_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_GraphemeClusterBreak_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorLatin1.g.dart b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorLatin1.g.dart
index 829fcc6..1970585 100644
--- a/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorLatin1.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorLatin1.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html) for more information.
+/// See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.GraphemeClusterBreakIterator.html) for more information.
final class GraphemeClusterBreakIteratorLatin1 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -16,47 +17,34 @@
// corresponding to data this may borrow from. These should be flat arrays containing
// references to objects, and this object will hold on to them to keep them alive and
// maintain borrow validity.
- GraphemeClusterBreakIteratorLatin1._fromFfi(
- this._ffi,
- this._selfEdge,
- this._aEdge,
- ) {
+ GraphemeClusterBreakIteratorLatin1._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
if (_selfEdge.isEmpty) {
_finalizer.attach(this, _ffi.cast());
}
}
- @_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorLatin1_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGraphemeClusterBreakIteratorLatin1_destroy),
- );
+ @_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorLatin1_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_GraphemeClusterBreakIteratorLatin1_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.GraphemeClusterBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XGraphemeClusterBreakIteratorLatin1_next(_ffi);
+ final result = _icu4x_GraphemeClusterBreakIteratorLatin1_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorLatin1_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterBreakIteratorLatin1_destroy',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorLatin1_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreakIteratorLatin1_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XGraphemeClusterBreakIteratorLatin1_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_GraphemeClusterBreakIteratorLatin1_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorLatin1_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterBreakIteratorLatin1_next',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorLatin1_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreakIteratorLatin1_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XGraphemeClusterBreakIteratorLatin1_next(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_GraphemeClusterBreakIteratorLatin1_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf16.g.dart b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf16.g.dart
index a6f2562..73783d0 100644
--- a/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf16.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf16.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html) for more information.
+/// See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.GraphemeClusterBreakIterator.html) for more information.
final class GraphemeClusterBreakIteratorUtf16 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -16,47 +17,34 @@
// corresponding to data this may borrow from. These should be flat arrays containing
// references to objects, and this object will hold on to them to keep them alive and
// maintain borrow validity.
- GraphemeClusterBreakIteratorUtf16._fromFfi(
- this._ffi,
- this._selfEdge,
- this._aEdge,
- ) {
+ GraphemeClusterBreakIteratorUtf16._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
if (_selfEdge.isEmpty) {
_finalizer.attach(this, _ffi.cast());
}
}
- @_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorUtf16_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGraphemeClusterBreakIteratorUtf16_destroy),
- );
+ @_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorUtf16_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_GraphemeClusterBreakIteratorUtf16_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.GraphemeClusterBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XGraphemeClusterBreakIteratorUtf16_next(_ffi);
+ final result = _icu4x_GraphemeClusterBreakIteratorUtf16_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorUtf16_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterBreakIteratorUtf16_destroy',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorUtf16_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreakIteratorUtf16_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XGraphemeClusterBreakIteratorUtf16_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_GraphemeClusterBreakIteratorUtf16_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorUtf16_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterBreakIteratorUtf16_next',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorUtf16_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreakIteratorUtf16_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XGraphemeClusterBreakIteratorUtf16_next(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_GraphemeClusterBreakIteratorUtf16_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf8.g.dart b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf8.g.dart
index c2f6baa..b0c30de 100644
--- a/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf8.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/GraphemeClusterBreakIteratorUtf8.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html) for more information.
+/// See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.GraphemeClusterBreakIterator.html) for more information.
final class GraphemeClusterBreakIteratorUtf8 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -16,47 +17,34 @@
// corresponding to data this may borrow from. These should be flat arrays containing
// references to objects, and this object will hold on to them to keep them alive and
// maintain borrow validity.
- GraphemeClusterBreakIteratorUtf8._fromFfi(
- this._ffi,
- this._selfEdge,
- this._aEdge,
- ) {
+ GraphemeClusterBreakIteratorUtf8._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
if (_selfEdge.isEmpty) {
_finalizer.attach(this, _ffi.cast());
}
}
- @_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorUtf8_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGraphemeClusterBreakIteratorUtf8_destroy),
- );
+ @_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorUtf8_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_GraphemeClusterBreakIteratorUtf8_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.GraphemeClusterBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XGraphemeClusterBreakIteratorUtf8_next(_ffi);
+ final result = _icu4x_GraphemeClusterBreakIteratorUtf8_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorUtf8_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterBreakIteratorUtf8_destroy',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorUtf8_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreakIteratorUtf8_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XGraphemeClusterBreakIteratorUtf8_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_GraphemeClusterBreakIteratorUtf8_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XGraphemeClusterBreakIteratorUtf8_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterBreakIteratorUtf8_next',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterBreakIteratorUtf8_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreakIteratorUtf8_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XGraphemeClusterBreakIteratorUtf8_next(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_GraphemeClusterBreakIteratorUtf8_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GraphemeClusterSegmenter.g.dart b/pkgs/intl4x/lib/src/bindings/GraphemeClusterSegmenter.g.dart
index c253405..4de2224 100644
--- a/pkgs/intl4x/lib/src/bindings/GraphemeClusterSegmenter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/GraphemeClusterSegmenter.g.dart
@@ -1,11 +1,12 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X grapheme-cluster-break segmenter, capable of finding grapheme cluster breakpoints
/// in strings.
///
-/// See the [Rust documentation for `GraphemeClusterSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html) for more information.
+/// See the [Rust documentation for `GraphemeClusterSegmenter`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.GraphemeClusterSegmenter.html) for more information.
final class GraphemeClusterSegmenter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -23,20 +24,26 @@
}
}
- @_DiplomatFfiUse('ICU4XGraphemeClusterSegmenter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGraphemeClusterSegmenter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_GraphemeClusterSegmenter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_GraphemeClusterSegmenter_destroy_mv1));
- /// Construct an [`GraphemeClusterSegmenter`].
+ /// Construct an [GraphemeClusterSegmenter] using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.new) for more information.
+ factory GraphemeClusterSegmenter() {
+ final result = _icu4x_GraphemeClusterSegmenter_create_mv1();
+ return GraphemeClusterSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct an [GraphemeClusterSegmenter].
///
- /// Throws [Error] on failure.
- factory GraphemeClusterSegmenter(DataProvider provider) {
- final result = _ICU4XGraphemeClusterSegmenter_create(provider._ffi);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory GraphemeClusterSegmenter.withProvider(DataProvider provider) {
+ final result = _icu4x_GraphemeClusterSegmenter_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return GraphemeClusterSegmenter._fromFfi(result.union.ok, []);
}
@@ -46,52 +53,35 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.segment_utf16) for more information.
+ /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.GraphemeClusterSegmenterBorrowed.html#method.segment_utf16) for more information.
GraphemeClusterBreakIteratorUtf16 segment(String input) {
- final inputView = input.utf16View;
final inputArena = _FinalizedArena();
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this, inputArena];
- final result = _ICU4XGraphemeClusterSegmenter_segment_utf16(
- _ffi,
- inputView.allocIn(inputArena.arena),
- inputView.length,
- );
+ final result = _icu4x_GraphemeClusterSegmenter_segment_utf16_mv1(_ffi, input._utf16AllocIn(inputArena.arena));
return GraphemeClusterBreakIteratorUtf16._fromFfi(result, [], aEdges);
}
+
}
-@_DiplomatFfiUse('ICU4XGraphemeClusterSegmenter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterSegmenter_destroy',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterSegmenter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterSegmenter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XGraphemeClusterSegmenter_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_GraphemeClusterSegmenter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XGraphemeClusterSegmenter_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XGraphemeClusterSegmenter_create',
-)
+@_DiplomatFfiUse('icu4x_GraphemeClusterSegmenter_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_GraphemeClusterSegmenter_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XGraphemeClusterSegmenter_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_GraphemeClusterSegmenter_create_mv1();
-@_DiplomatFfiUse('ICU4XGraphemeClusterSegmenter_segment_utf16')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint16>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XGraphemeClusterSegmenter_segment_utf16')
+@_DiplomatFfiUse('icu4x_GraphemeClusterSegmenter_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterSegmenter_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XGraphemeClusterSegmenter_segment_utf16(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint16> inputData,
- int inputLength,
-);
+external _ResultOpaqueInt32 _icu4x_GraphemeClusterSegmenter_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_GraphemeClusterSegmenter_segment_utf16_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterSegmenter_segment_utf16_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_GraphemeClusterSegmenter_segment_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 input);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/GregorianDateFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/GregorianDateFormatter.g.dart
deleted file mode 100644
index 320d96a..0000000
--- a/pkgs/intl4x/lib/src/bindings/GregorianDateFormatter.g.dart
+++ /dev/null
@@ -1,140 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An ICU4X TypedDateFormatter object capable of formatting a [`IsoDateTime`] as a string,
-/// using the Gregorian Calendar.
-///
-/// See the [Rust documentation for `TypedDateFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html) for more information.
-final class GregorianDateFormatter implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- GregorianDateFormatter._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XGregorianDateFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGregorianDateFormatter_destroy),
- );
-
- /// Creates a new [`GregorianDateFormatter`] from locale data.
- ///
- /// See the [Rust documentation for `try_new_with_length`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.try_new_with_length) for more information.
- ///
- /// Throws [Error] on failure.
- factory GregorianDateFormatter.withLength(
- DataProvider provider,
- Locale locale,
- DateLength length,
- ) {
- final result = _ICU4XGregorianDateFormatter_create_with_length(
- provider._ffi,
- locale._ffi,
- length.index,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return GregorianDateFormatter._fromFfi(result.union.ok, []);
- }
-
- /// Formats a [`IsoDate`] to a string.
- ///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information.
- ///
- /// Throws [Error] on failure.
- String formatIsoDate(IsoDate value) {
- final writeable = _Writeable();
- final result = _ICU4XGregorianDateFormatter_format_iso_date(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// Formats a [`IsoDateTime`] to a string.
- ///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information.
- ///
- /// Throws [Error] on failure.
- String formatIsoDatetime(IsoDateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XGregorianDateFormatter_format_iso_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XGregorianDateFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGregorianDateFormatter_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XGregorianDateFormatter_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XGregorianDateFormatter_create_with_length')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XGregorianDateFormatter_create_with_length')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XGregorianDateFormatter_create_with_length(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int length,
-);
-
-@_DiplomatFfiUse('ICU4XGregorianDateFormatter_format_iso_date')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XGregorianDateFormatter_format_iso_date')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XGregorianDateFormatter_format_iso_date(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XGregorianDateFormatter_format_iso_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XGregorianDateFormatter_format_iso_datetime')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XGregorianDateFormatter_format_iso_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/GregorianDateTimeFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/GregorianDateTimeFormatter.g.dart
deleted file mode 100644
index 6beeffd..0000000
--- a/pkgs/intl4x/lib/src/bindings/GregorianDateTimeFormatter.g.dart
+++ /dev/null
@@ -1,114 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An ICU4X TypedDateTimeFormatter object capable of formatting a [`IsoDateTime`] as a string,
-/// using the Gregorian Calendar.
-///
-/// See the [Rust documentation for `TypedDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html) for more information.
-final class GregorianDateTimeFormatter implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- GregorianDateTimeFormatter._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XGregorianDateTimeFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGregorianDateTimeFormatter_destroy),
- );
-
- /// Creates a new [`GregorianDateFormatter`] from locale data.
- ///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.try_new) for more information.
- ///
- /// Throws [Error] on failure.
- factory GregorianDateTimeFormatter.withLengths(
- DataProvider provider,
- Locale locale,
- DateLength dateLength,
- TimeLength timeLength,
- ) {
- final result = _ICU4XGregorianDateTimeFormatter_create_with_lengths(
- provider._ffi,
- locale._ffi,
- dateLength.index,
- timeLength.index,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return GregorianDateTimeFormatter._fromFfi(result.union.ok, []);
- }
-
- /// Formats a [`IsoDateTime`] to a string.
- ///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.format) for more information.
- ///
- /// Throws [Error] on failure.
- String formatIsoDatetime(IsoDateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XGregorianDateTimeFormatter_format_iso_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XGregorianDateTimeFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGregorianDateTimeFormatter_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XGregorianDateTimeFormatter_destroy(
- ffi.Pointer<ffi.Void> self,
-);
-
-@_DiplomatFfiUse('ICU4XGregorianDateTimeFormatter_create_with_lengths')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XGregorianDateTimeFormatter_create_with_lengths')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XGregorianDateTimeFormatter_create_with_lengths(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int dateLength,
- int timeLength,
-);
-
-@_DiplomatFfiUse('ICU4XGregorianDateTimeFormatter_format_iso_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XGregorianDateTimeFormatter_format_iso_datetime')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XGregorianDateTimeFormatter_format_iso_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/GregorianZonedDateTimeFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/GregorianZonedDateTimeFormatter.g.dart
deleted file mode 100644
index 2d5b3c8..0000000
--- a/pkgs/intl4x/lib/src/bindings/GregorianZonedDateTimeFormatter.g.dart
+++ /dev/null
@@ -1,190 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An object capable of formatting a date time with time zone to a string.
-///
-/// See the [Rust documentation for `TypedZonedDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html) for more information.
-final class GregorianZonedDateTimeFormatter implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- GregorianZonedDateTimeFormatter._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XGregorianZonedDateTimeFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XGregorianZonedDateTimeFormatter_destroy),
- );
-
- /// Creates a new [`GregorianZonedDateTimeFormatter`] from locale data.
- ///
- /// This function has `date_length` and `time_length` arguments and uses default options
- /// for the time zone.
- ///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.try_new) for more information.
- ///
- /// Throws [Error] on failure.
- factory GregorianZonedDateTimeFormatter.withLengths(
- DataProvider provider,
- Locale locale,
- DateLength dateLength,
- TimeLength timeLength,
- ) {
- final result = _ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(
- provider._ffi,
- locale._ffi,
- dateLength.index,
- timeLength.index,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return GregorianZonedDateTimeFormatter._fromFfi(result.union.ok, []);
- }
-
- /// Creates a new [`GregorianZonedDateTimeFormatter`] from locale data.
- ///
- /// This function has `date_length` and `time_length` arguments and uses an ISO-8601 style
- /// fallback for the time zone with the given configurations.
- ///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.try_new) for more information.
- ///
- /// Throws [Error] on failure.
- factory GregorianZonedDateTimeFormatter.withLengthsAndIso8601TimeZoneFallback(
- DataProvider provider,
- Locale locale,
- DateLength dateLength,
- TimeLength timeLength,
- IsoTimeZoneOptions zoneOptions,
- ) {
- final temp = ffi2.Arena();
- final result =
- _ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(
- provider._ffi,
- locale._ffi,
- dateLength.index,
- timeLength.index,
- zoneOptions._toFfi(temp),
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return GregorianZonedDateTimeFormatter._fromFfi(result.union.ok, []);
- }
-
- /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string.
- ///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.format) for more information.
- ///
- /// Throws [Error] on failure.
- String formatIsoDatetimeWithCustomTimeZone(
- IsoDateTime datetime,
- CustomTimeZone timeZone,
- ) {
- final writeable = _Writeable();
- final result =
- _ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(
- _ffi,
- datetime._ffi,
- timeZone._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XGregorianZonedDateTimeFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XGregorianZonedDateTimeFormatter_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XGregorianZonedDateTimeFormatter_destroy(
- ffi.Pointer<ffi.Void> self,
-);
-
-@_DiplomatFfiUse('ICU4XGregorianZonedDateTimeFormatter_create_with_lengths')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- ffi.Int32,
- )
->(
- isLeaf: true,
- symbol: 'ICU4XGregorianZonedDateTimeFormatter_create_with_lengths',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int dateLength,
- int timeLength,
-);
-
-@_DiplomatFfiUse(
- 'ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback',
-)
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- ffi.Int32,
- _IsoTimeZoneOptionsFfi,
- )
->(
- isLeaf: true,
- symbol:
- 'ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int dateLength,
- int timeLength,
- _IsoTimeZoneOptionsFfi zoneOptions,
-);
-
-@_DiplomatFfiUse(
- 'ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone',
-)
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(
- isLeaf: true,
- symbol:
- 'ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone',
-)
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> datetime,
- ffi.Pointer<ffi.Opaque> timeZone,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/HangulSyllableType.g.dart b/pkgs/intl4x/lib/src/bindings/HangulSyllableType.g.dart
new file mode 100644
index 0000000..87ac5d8
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/HangulSyllableType.g.dart
@@ -0,0 +1,63 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html) for more information.
+enum HangulSyllableType {
+ /// See the [Rust documentation for `NotApplicable`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#associatedconstant.NotApplicable) for more information.
+ notApplicable,
+ /// See the [Rust documentation for `LeadingJamo`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#associatedconstant.LeadingJamo) for more information.
+ leadingJamo,
+ /// See the [Rust documentation for `VowelJamo`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#associatedconstant.VowelJamo) for more information.
+ vowelJamo,
+ /// See the [Rust documentation for `TrailingJamo`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#associatedconstant.TrailingJamo) for more information.
+ trailingJamo,
+ /// See the [Rust documentation for `LeadingVowelSyllable`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#associatedconstant.LeadingVowelSyllable) for more information.
+ leadingVowelSyllable,
+ /// See the [Rust documentation for `LeadingVowelTrailingSyllable`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#associatedconstant.LeadingVowelTrailingSyllable) for more information.
+ leadingVowelTrailingSyllable;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static HangulSyllableType forChar(Rune ch) {
+ final result = _icu4x_HangulSyllableType_for_char_mv1(ch);
+ return HangulSyllableType.values[result];
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_HangulSyllableType_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html#method.from_icu4c_value) for more information.
+ static HangulSyllableType? fromIntegerValue(int other) {
+ final result = _icu4x_HangulSyllableType_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return HangulSyllableType.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_HangulSyllableType_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_HangulSyllableType_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_HangulSyllableType_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_HangulSyllableType_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_HangulSyllableType_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_HangulSyllableType_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_HangulSyllableType_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_HangulSyllableType_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_HangulSyllableType_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/IanaParser.g.dart b/pkgs/intl4x/lib/src/bindings/IanaParser.g.dart
new file mode 100644
index 0000000..7b730a5
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/IanaParser.g.dart
@@ -0,0 +1,95 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// A mapper between IANA time zone identifiers and BCP-47 time zone identifiers.
+///
+/// This mapper supports two-way mapping, but it is optimized for the case of IANA to BCP-47.
+/// It also supports normalizing and canonicalizing the IANA strings.
+///
+/// See the [Rust documentation for `IanaParser`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParser.html) for more information.
+final class IanaParser implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ IanaParser._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_IanaParser_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_IanaParser_destroy_mv1));
+
+ /// Create a new [IanaParser] using compiled data
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParser.html#method.new) for more information.
+ factory IanaParser() {
+ final result = _icu4x_IanaParser_create_mv1();
+ return IanaParser._fromFfi(result, []);
+ }
+
+ /// Create a new [IanaParser] using a particular data source
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParser.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory IanaParser.withProvider(DataProvider provider) {
+ final result = _icu4x_IanaParser_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return IanaParser._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `parse`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserBorrowed.html#method.parse) for more information.
+ TimeZone parse(String value) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_IanaParser_parse_mv1(_ffi, value._utf8AllocIn(temp.arena));
+ return TimeZone._fromFfi(result, []);
+ }
+
+ /// See the [Rust documentation for `iter`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserBorrowed.html#method.iter) for more information.
+ TimeZoneIterator iter() {
+ // This lifetime edge depends on lifetimes: 'a
+ core.List<Object> aEdges = [this];
+ final result = _icu4x_IanaParser_iter_mv1(_ffi);
+ return TimeZoneIterator._fromFfi(result, [], aEdges);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_IanaParser_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_IanaParser_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_IanaParser_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_IanaParser_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_IanaParser_create_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_IanaParser_create_mv1();
+
+@_DiplomatFfiUse('icu4x_IanaParser_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IanaParser_create_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_IanaParser_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_IanaParser_parse_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_IanaParser_parse_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_IanaParser_parse_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 value);
+
+@_DiplomatFfiUse('icu4x_IanaParser_iter_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IanaParser_iter_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_IanaParser_iter_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/IanaParserExtended.g.dart b/pkgs/intl4x/lib/src/bindings/IanaParserExtended.g.dart
new file mode 100644
index 0000000..db261b3
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/IanaParserExtended.g.dart
@@ -0,0 +1,110 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// A mapper between IANA time zone identifiers and BCP-47 time zone identifiers.
+///
+/// This mapper supports two-way mapping, but it is optimized for the case of IANA to BCP-47.
+/// It also supports normalizing and canonicalizing the IANA strings.
+///
+/// See the [Rust documentation for `IanaParserExtended`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserExtended.html) for more information.
+final class IanaParserExtended implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ IanaParserExtended._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_IanaParserExtended_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_IanaParserExtended_destroy_mv1));
+
+ /// Create a new [IanaParserExtended] using compiled data
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserExtended.html#method.new) for more information.
+ factory IanaParserExtended() {
+ final result = _icu4x_IanaParserExtended_create_mv1();
+ return IanaParserExtended._fromFfi(result, []);
+ }
+
+ /// Create a new [IanaParserExtended] using a particular data source
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserExtended.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory IanaParserExtended.withProvider(DataProvider provider) {
+ final result = _icu4x_IanaParserExtended_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return IanaParserExtended._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `parse`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserExtendedBorrowed.html#method.parse) for more information.
+ TimeZoneAndCanonicalAndNormalized parse(String value) {
+ final temp = _FinalizedArena();
+ // This lifetime edge depends on lifetimes: 'a
+ core.List<Object> aEdges = [this];
+ final result = _icu4x_IanaParserExtended_parse_mv1(_ffi, value._utf8AllocIn(temp.arena));
+ return TimeZoneAndCanonicalAndNormalized._fromFfi(result, aEdges);
+ }
+
+ /// See the [Rust documentation for `iter`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserExtendedBorrowed.html#method.iter) for more information.
+ TimeZoneAndCanonicalIterator iter() {
+ // This lifetime edge depends on lifetimes: 'a
+ core.List<Object> aEdges = [this];
+ final result = _icu4x_IanaParserExtended_iter_mv1(_ffi);
+ return TimeZoneAndCanonicalIterator._fromFfi(result, [], aEdges);
+ }
+
+ /// See the [Rust documentation for `iter_all`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.IanaParserExtendedBorrowed.html#method.iter_all) for more information.
+ TimeZoneAndCanonicalAndNormalizedIterator iterAll() {
+ // This lifetime edge depends on lifetimes: 'a
+ core.List<Object> aEdges = [this];
+ final result = _icu4x_IanaParserExtended_iter_all_mv1(_ffi);
+ return TimeZoneAndCanonicalAndNormalizedIterator._fromFfi(result, [], aEdges);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_IanaParserExtended_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_IanaParserExtended_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_IanaParserExtended_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_IanaParserExtended_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_IanaParserExtended_create_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_IanaParserExtended_create_mv1();
+
+@_DiplomatFfiUse('icu4x_IanaParserExtended_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IanaParserExtended_create_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_IanaParserExtended_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_IanaParserExtended_parse_mv1')
+@ffi.Native<_TimeZoneAndCanonicalAndNormalizedFfi Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_IanaParserExtended_parse_mv1')
+// ignore: non_constant_identifier_names
+external _TimeZoneAndCanonicalAndNormalizedFfi _icu4x_IanaParserExtended_parse_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 value);
+
+@_DiplomatFfiUse('icu4x_IanaParserExtended_iter_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IanaParserExtended_iter_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_IanaParserExtended_iter_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_IanaParserExtended_iter_all_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IanaParserExtended_iter_all_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_IanaParserExtended_iter_all_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/IanaToBcp47Mapper.g.dart b/pkgs/intl4x/lib/src/bindings/IanaToBcp47Mapper.g.dart
deleted file mode 100644
index 4d8867d..0000000
--- a/pkgs/intl4x/lib/src/bindings/IanaToBcp47Mapper.g.dart
+++ /dev/null
@@ -1,101 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An object capable of mapping from an IANA time zone ID to a BCP-47 ID.
-///
-/// This can be used via `try_set_iana_time_zone_id()` on [`CustomTimeZone`].
-///
-/// [`CustomTimeZone`]: crate::timezone::ffi::ICU4XCustomTimeZone
-///
-/// See the [Rust documentation for `IanaToBcp47Mapper`](https://docs.rs/icu/latest/icu/timezone/struct.IanaToBcp47Mapper.html) for more information.
-final class IanaToBcp47Mapper implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- IanaToBcp47Mapper._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XIanaToBcp47Mapper_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XIanaToBcp47Mapper_destroy),
- );
-
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.IanaToBcp47Mapper.html#method.new) for more information.
- ///
- /// Throws [Error] on failure.
- factory IanaToBcp47Mapper(DataProvider provider) {
- final result = _ICU4XIanaToBcp47Mapper_create(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return IanaToBcp47Mapper._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/timezone/struct.IanaToBcp47MapperBorrowed.html#method.get) for more information.
- ///
- /// See the [Rust documentation for `iana_to_bcp47`](https://docs.rs/icu/latest/icu/timezone/struct.IanaBcp47RoundTripMapperBorrowed.html#method.iana_to_bcp47) for more information.
- ///
- /// Throws [Error] on failure.
- String operator [](String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XIanaToBcp47Mapper_get(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XIanaToBcp47Mapper_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XIanaToBcp47Mapper_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XIanaToBcp47Mapper_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XIanaToBcp47Mapper_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIanaToBcp47Mapper_create',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XIanaToBcp47Mapper_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
-
-@_DiplomatFfiUse('ICU4XIanaToBcp47Mapper_get')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XIanaToBcp47Mapper_get')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XIanaToBcp47Mapper_get(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/IndicSyllabicCategory.g.dart b/pkgs/intl4x/lib/src/bindings/IndicSyllabicCategory.g.dart
new file mode 100644
index 0000000..d38978d
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/IndicSyllabicCategory.g.dart
@@ -0,0 +1,125 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html) for more information.
+enum IndicSyllabicCategory {
+ /// See the [Rust documentation for `Other`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Other) for more information.
+ other,
+ /// See the [Rust documentation for `Avagraha`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Avagraha) for more information.
+ avagraha,
+ /// See the [Rust documentation for `Bindu`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Bindu) for more information.
+ bindu,
+ /// See the [Rust documentation for `BrahmiJoiningNumber`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.BrahmiJoiningNumber) for more information.
+ brahmiJoiningNumber,
+ /// See the [Rust documentation for `CantillationMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.CantillationMark) for more information.
+ cantillationMark,
+ /// See the [Rust documentation for `Consonant`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Consonant) for more information.
+ consonant,
+ /// See the [Rust documentation for `ConsonantDead`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantDead) for more information.
+ consonantDead,
+ /// See the [Rust documentation for `ConsonantFinal`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantFinal) for more information.
+ consonantFinal,
+ /// See the [Rust documentation for `ConsonantHeadLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantHeadLetter) for more information.
+ consonantHeadLetter,
+ /// See the [Rust documentation for `ConsonantInitialPostfixed`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantInitialPostfixed) for more information.
+ consonantInitialPostfixed,
+ /// See the [Rust documentation for `ConsonantKiller`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantKiller) for more information.
+ consonantKiller,
+ /// See the [Rust documentation for `ConsonantMedial`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantMedial) for more information.
+ consonantMedial,
+ /// See the [Rust documentation for `ConsonantPlaceholder`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantPlaceholder) for more information.
+ consonantPlaceholder,
+ /// See the [Rust documentation for `ConsonantPrecedingRepha`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantPrecedingRepha) for more information.
+ consonantPrecedingRepha,
+ /// See the [Rust documentation for `ConsonantPrefixed`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantPrefixed) for more information.
+ consonantPrefixed,
+ /// See the [Rust documentation for `ConsonantSucceedingRepha`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantSucceedingRepha) for more information.
+ consonantSucceedingRepha,
+ /// See the [Rust documentation for `ConsonantSubjoined`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantSubjoined) for more information.
+ consonantSubjoined,
+ /// See the [Rust documentation for `ConsonantWithStacker`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ConsonantWithStacker) for more information.
+ consonantWithStacker,
+ /// See the [Rust documentation for `GeminationMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.GeminationMark) for more information.
+ geminationMark,
+ /// See the [Rust documentation for `InvisibleStacker`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.InvisibleStacker) for more information.
+ invisibleStacker,
+ /// See the [Rust documentation for `Joiner`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Joiner) for more information.
+ joiner,
+ /// See the [Rust documentation for `ModifyingLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ModifyingLetter) for more information.
+ modifyingLetter,
+ /// See the [Rust documentation for `NonJoiner`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.NonJoiner) for more information.
+ nonJoiner,
+ /// See the [Rust documentation for `Nukta`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Nukta) for more information.
+ nukta,
+ /// See the [Rust documentation for `Number`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Number) for more information.
+ number,
+ /// See the [Rust documentation for `NumberJoiner`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.NumberJoiner) for more information.
+ numberJoiner,
+ /// See the [Rust documentation for `PureKiller`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.PureKiller) for more information.
+ pureKiller,
+ /// See the [Rust documentation for `RegisterShifter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.RegisterShifter) for more information.
+ registerShifter,
+ /// See the [Rust documentation for `SyllableModifier`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.SyllableModifier) for more information.
+ syllableModifier,
+ /// See the [Rust documentation for `ToneLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ToneLetter) for more information.
+ toneLetter,
+ /// See the [Rust documentation for `ToneMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ToneMark) for more information.
+ toneMark,
+ /// See the [Rust documentation for `Virama`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Virama) for more information.
+ virama,
+ /// See the [Rust documentation for `Visarga`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Visarga) for more information.
+ visarga,
+ /// See the [Rust documentation for `Vowel`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.Vowel) for more information.
+ vowel,
+ /// See the [Rust documentation for `VowelDependent`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.VowelDependent) for more information.
+ vowelDependent,
+ /// See the [Rust documentation for `VowelIndependent`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.VowelIndependent) for more information.
+ vowelIndependent,
+ /// See the [Rust documentation for `ReorderingKiller`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#associatedconstant.ReorderingKiller) for more information.
+ reorderingKiller;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static IndicSyllabicCategory forChar(Rune ch) {
+ final result = _icu4x_IndicSyllabicCategory_for_char_mv1(ch);
+ return IndicSyllabicCategory.values[result];
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_IndicSyllabicCategory_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html#method.from_icu4c_value) for more information.
+ static IndicSyllabicCategory? fromIntegerValue(int other) {
+ final result = _icu4x_IndicSyllabicCategory_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return IndicSyllabicCategory.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_IndicSyllabicCategory_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_IndicSyllabicCategory_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_IndicSyllabicCategory_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_IndicSyllabicCategory_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_IndicSyllabicCategory_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_IndicSyllabicCategory_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_IndicSyllabicCategory_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_IndicSyllabicCategory_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_IndicSyllabicCategory_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/IsoDate.g.dart b/pkgs/intl4x/lib/src/bindings/IsoDate.g.dart
index ddff9bf..3e78636 100644
--- a/pkgs/intl4x/lib/src/bindings/IsoDate.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/IsoDate.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X Date object capable of containing a ISO-8601 date
///
-/// See the [Rust documentation for `Date`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html) for more information.
+/// See the [Rust documentation for `Date`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html) for more information.
final class IsoDate implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,282 +23,235 @@
}
}
- @_DiplomatFfiUse('ICU4XIsoDate_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XIsoDate_destroy),
- );
+ @_DiplomatFfiUse('icu4x_IsoDate_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_IsoDate_destroy_mv1));
- /// Creates a new [`IsoDate`] from the specified date and time.
+ /// Creates a new [IsoDate] from the specified date.
///
- /// See the [Rust documentation for `try_new_iso_date`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.try_new_iso_date) for more information.
+ /// See the [Rust documentation for `try_new_iso`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.try_new_iso) for more information.
///
- /// Throws [Error] on failure.
+ /// Throws [CalendarError] on failure.
factory IsoDate(int year, int month, int day) {
- final result = _ICU4XIsoDate_create(year, month, day);
+ final result = _icu4x_IsoDate_create_mv1(year, month, day);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw CalendarError.values[result.union.err];
}
return IsoDate._fromFfi(result.union.ok, []);
}
- /// Creates a new [`IsoDate`] representing January 1, 1970.
+ /// Creates a new [IsoDate] from the given Rata Die
///
- /// See the [Rust documentation for `unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.unix_epoch) for more information.
- factory IsoDate.forUnixEpoch() {
- final result = _ICU4XIsoDate_create_for_unix_epoch();
+ /// See the [Rust documentation for `from_rata_die`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.from_rata_die) for more information.
+ factory IsoDate.fromRataDie(int rd) {
+ final result = _icu4x_IsoDate_from_rata_die_mv1(rd);
return IsoDate._fromFfi(result, []);
}
+ /// Creates a new [IsoDate] from an IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.try_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory IsoDate.fromString(String v) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_IsoDate_from_string_mv1(v._utf8AllocIn(temp.arena));
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return IsoDate._fromFfi(result.union.ok, []);
+ }
+
/// Convert this date to one in a different calendar
///
- /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar) for more information.
+ /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.to_calendar) for more information.
Date toCalendar(Calendar calendar) {
- final result = _ICU4XIsoDate_to_calendar(_ffi, calendar._ffi);
+ final result = _icu4x_IsoDate_to_calendar_mv1(_ffi, calendar._ffi);
return Date._fromFfi(result, []);
}
- /// See the [Rust documentation for `to_any`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_any) for more information.
+ /// See the [Rust documentation for `to_any`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.to_any) for more information.
Date toAny() {
- final result = _ICU4XIsoDate_to_any(_ffi);
+ final result = _icu4x_IsoDate_to_any_mv1(_ffi);
return Date._fromFfi(result, []);
}
+ /// Returns this date's Rata Die
+ ///
+ /// See the [Rust documentation for `to_rata_die`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.to_rata_die) for more information.
+ int get rataDie {
+ final result = _icu4x_IsoDate_to_rata_die_mv1(_ffi);
+ return result;
+ }
+
/// Returns the 1-indexed day in the year for this date
///
- /// See the [Rust documentation for `day_of_year_info`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_year_info) for more information.
+ /// See the [Rust documentation for `day_of_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.day_of_year) for more information.
int get dayOfYear {
- final result = _ICU4XIsoDate_day_of_year(_ffi);
+ final result = _icu4x_IsoDate_day_of_year_mv1(_ffi);
return result;
}
/// Returns the 1-indexed day in the month for this date
///
- /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information.
+ /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.day_of_month) for more information.
int get dayOfMonth {
- final result = _ICU4XIsoDate_day_of_month(_ffi);
+ final result = _icu4x_IsoDate_day_of_month_mv1(_ffi);
return result;
}
/// Returns the day in the week for this day
///
- /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information.
- IsoWeekday get dayOfWeek {
- final result = _ICU4XIsoDate_day_of_week(_ffi);
- return IsoWeekday.values.firstWhere((v) => v._ffi == result);
- }
-
- /// Returns the week number in this month, 1-indexed, based on what
- /// is considered the first day of the week (often a locale preference).
- ///
- /// `first_weekday` can be obtained via `first_weekday()` on [`WeekCalculator`]
- ///
- /// See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information.
- int weekOfMonth(IsoWeekday firstWeekday) {
- final result = _ICU4XIsoDate_week_of_month(_ffi, firstWeekday._ffi);
- return result;
+ /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.day_of_week) for more information.
+ Weekday get dayOfWeek {
+ final result = _icu4x_IsoDate_day_of_week_mv1(_ffi);
+ return Weekday.values.firstWhere((v) => v._ffi == result);
}
/// Returns the week number in this year, using week data
///
- /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information.
- ///
- /// Throws [Error] on failure.
- WeekOf weekOfYear(WeekCalculator calculator) {
- final result = _ICU4XIsoDate_week_of_year(_ffi, calculator._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return WeekOf._fromFfi(result.union.ok);
+ /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.week_of_year) for more information.
+ IsoWeekOfYear weekOfYear() {
+ final result = _icu4x_IsoDate_week_of_year_mv1(_ffi);
+ return IsoWeekOfYear._fromFfi(result);
}
/// Returns 1-indexed number of the month of this date in its year
///
- /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
+ /// See the [Rust documentation for `ordinal`](https://docs.rs/icu/2.0.0/icu/calendar/types/struct.MonthInfo.html#structfield.ordinal) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.month)
int get month {
- final result = _ICU4XIsoDate_month(_ffi);
+ final result = _icu4x_IsoDate_month_mv1(_ffi);
return result;
}
- /// Returns the year number for this date
+ /// Returns the year number in the current era for this date
///
- /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information.
+ /// For calendars without an era, returns the extended year
+ ///
+ /// See the [Rust documentation for `year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.year) for more information.
int get year {
- final result = _ICU4XIsoDate_year(_ffi);
+ final result = _icu4x_IsoDate_year_mv1(_ffi);
return result;
}
/// Returns if the year is a leap year for this date
///
- /// See the [Rust documentation for `is_in_leap_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.is_in_leap_year) for more information.
+ /// See the [Rust documentation for `is_in_leap_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.is_in_leap_year) for more information.
bool get isInLeapYear {
- final result = _ICU4XIsoDate_is_in_leap_year(_ffi);
+ final result = _icu4x_IsoDate_is_in_leap_year_mv1(_ffi);
return result;
}
/// Returns the number of months in the year represented by this date
///
- /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information.
+ /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.months_in_year) for more information.
int get monthsInYear {
- final result = _ICU4XIsoDate_months_in_year(_ffi);
+ final result = _icu4x_IsoDate_months_in_year_mv1(_ffi);
return result;
}
/// Returns the number of days in the month represented by this date
///
- /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information.
+ /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.days_in_month) for more information.
int get daysInMonth {
- final result = _ICU4XIsoDate_days_in_month(_ffi);
+ final result = _icu4x_IsoDate_days_in_month_mv1(_ffi);
return result;
}
/// Returns the number of days in the year represented by this date
///
- /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information.
+ /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/2.0.0/icu/calendar/struct.Date.html#method.days_in_year) for more information.
int get daysInYear {
- final result = _ICU4XIsoDate_days_in_year(_ffi);
+ final result = _icu4x_IsoDate_days_in_year_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XIsoDate_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_destroy',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_IsoDate_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XIsoDate_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_IsoDate_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XIsoDate_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int32, ffi.Uint8, ffi.Uint8)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_create',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_create_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int32, ffi.Uint8, ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_IsoDate_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XIsoDate_create(int year, int month, int day);
+external _ResultOpaqueInt32 _icu4x_IsoDate_create_mv1(int year, int month, int day);
-@_DiplomatFfiUse('ICU4XIsoDate_create_for_unix_epoch')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_create_for_unix_epoch',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_from_rata_die_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Int64)>(isLeaf: true, symbol: 'icu4x_IsoDate_from_rata_die_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDate_create_for_unix_epoch();
+external ffi.Pointer<ffi.Opaque> _icu4x_IsoDate_from_rata_die_mv1(int rd);
-@_DiplomatFfiUse('ICU4XIsoDate_to_calendar')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XIsoDate_to_calendar')
+@_DiplomatFfiUse('icu4x_IsoDate_from_string_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_IsoDate_from_string_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDate_to_calendar(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calendar,
-);
+external _ResultOpaqueInt32 _icu4x_IsoDate_from_string_mv1(_SliceUtf8 v);
-@_DiplomatFfiUse('ICU4XIsoDate_to_any')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_to_any',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_to_calendar_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_to_calendar_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDate_to_any(
- ffi.Pointer<ffi.Opaque> self,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_IsoDate_to_calendar_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> calendar);
-@_DiplomatFfiUse('ICU4XIsoDate_day_of_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_day_of_year',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_to_any_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_to_any_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_day_of_year(ffi.Pointer<ffi.Opaque> self);
+external ffi.Pointer<ffi.Opaque> _icu4x_IsoDate_to_any_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_day_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_day_of_month',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_to_rata_die_mv1')
+@ffi.Native<ffi.Int64 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_to_rata_die_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_day_of_month(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_IsoDate_to_rata_die_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_day_of_week')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_day_of_week',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_day_of_year_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_day_of_year_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_day_of_week(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_IsoDate_day_of_year_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_week_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_week_of_month',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_day_of_month_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_day_of_month_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_week_of_month(
- ffi.Pointer<ffi.Opaque> self,
- int firstWeekday,
-);
+external int _icu4x_IsoDate_day_of_month_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_week_of_year')
-@ffi.Native<
- _ResultWeekOfFfiInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XIsoDate_week_of_year')
+@_DiplomatFfiUse('icu4x_IsoDate_day_of_week_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_day_of_week_mv1')
// ignore: non_constant_identifier_names
-external _ResultWeekOfFfiInt32 _ICU4XIsoDate_week_of_year(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calculator,
-);
+external int _icu4x_IsoDate_day_of_week_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_month',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_week_of_year_mv1')
+@ffi.Native<_IsoWeekOfYearFfi Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_week_of_year_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_month(ffi.Pointer<ffi.Opaque> self);
+external _IsoWeekOfYearFfi _icu4x_IsoDate_week_of_year_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_year')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_year',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_month_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_month_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_year(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_IsoDate_month_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_is_in_leap_year')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_is_in_leap_year',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_year_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_year_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XIsoDate_is_in_leap_year(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_IsoDate_year_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_months_in_year')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_months_in_year',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_is_in_leap_year_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_is_in_leap_year_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_months_in_year(ffi.Pointer<ffi.Opaque> self);
+external bool _icu4x_IsoDate_is_in_leap_year_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_days_in_month')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_days_in_month',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_months_in_year_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_months_in_year_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_days_in_month(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_IsoDate_months_in_year_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XIsoDate_days_in_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDate_days_in_year',
-)
+@_DiplomatFfiUse('icu4x_IsoDate_days_in_month_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_days_in_month_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XIsoDate_days_in_year(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_IsoDate_days_in_month_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_IsoDate_days_in_year_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_IsoDate_days_in_year_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_IsoDate_days_in_year_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/IsoDateTime.g.dart b/pkgs/intl4x/lib/src/bindings/IsoDateTime.g.dart
index c64c6c8..8c6e8cd 100644
--- a/pkgs/intl4x/lib/src/bindings/IsoDateTime.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/IsoDateTime.g.dart
@@ -1,498 +1,69 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X DateTime object capable of containing a ISO-8601 date and time.
-///
-/// See the [Rust documentation for `DateTime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html) for more information.
-final class IsoDateTime implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- IsoDateTime._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XIsoDateTime_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XIsoDateTime_destroy),
- );
-
- /// Creates a new [`IsoDateTime`] from the specified date and time.
- ///
- /// See the [Rust documentation for `try_new_iso_datetime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_iso_datetime) for more information.
- ///
- /// Throws [Error] on failure.
- factory IsoDateTime(
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int nanosecond,
- ) {
- final result = _ICU4XIsoDateTime_create(
- year,
- month,
- day,
- hour,
- minute,
- second,
- nanosecond,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return IsoDateTime._fromFfi(result.union.ok, []);
- }
-
- /// Creates a new [`IsoDateTime`] from an [`IsoDate`] and [`Time`] object
- ///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new) for more information.
- factory IsoDateTime.fromDateAndTime(IsoDate date, Time time) {
- final result = _ICU4XIsoDateTime_crate_from_date_and_time(
- date._ffi,
- time._ffi,
- );
- return IsoDateTime._fromFfi(result, []);
- }
-
- /// Creates a new [`IsoDateTime`] of midnight on January 1, 1970
- ///
- /// See the [Rust documentation for `local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.local_unix_epoch) for more information.
- factory IsoDateTime.localUnixEpoch() {
- final result = _ICU4XIsoDateTime_local_unix_epoch();
- return IsoDateTime._fromFfi(result, []);
- }
-
- /// Construct from the minutes since the local unix epoch for this date (Jan 1 1970, 00:00)
- ///
- /// See the [Rust documentation for `from_minutes_since_local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.from_minutes_since_local_unix_epoch) for more information.
- factory IsoDateTime.fromMinutesSinceLocalUnixEpoch(int minutes) {
- final result = _ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(
- minutes,
- );
- return IsoDateTime._fromFfi(result, []);
- }
-
- /// Gets the date contained in this object
- ///
- /// See the [Rust documentation for `date`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date) for more information.
- IsoDate get date {
- final result = _ICU4XIsoDateTime_date(_ffi);
- return IsoDate._fromFfi(result, []);
- }
-
- /// Gets the time contained in this object
- ///
- /// See the [Rust documentation for `time`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time) for more information.
- Time get time {
- final result = _ICU4XIsoDateTime_time(_ffi);
- return Time._fromFfi(result, []);
- }
-
- /// Converts this to an [`DateTime`] capable of being mixed with dates of
- /// other calendars
- ///
- /// See the [Rust documentation for `to_any`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_any) for more information.
- DateTime toAny() {
- final result = _ICU4XIsoDateTime_to_any(_ffi);
- return DateTime._fromFfi(result, []);
- }
-
- /// Gets the minutes since the local unix epoch for this date (Jan 1 1970, 00:00)
- ///
- /// See the [Rust documentation for `minutes_since_local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.minutes_since_local_unix_epoch) for more information.
- int get minutesSinceLocalUnixEpoch {
- final result = _ICU4XIsoDateTime_minutes_since_local_unix_epoch(_ffi);
- return result;
- }
-
- /// Convert this datetime to one in a different calendar
- ///
- /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar) for more information.
- DateTime toCalendar(Calendar calendar) {
- final result = _ICU4XIsoDateTime_to_calendar(_ffi, calendar._ffi);
- return DateTime._fromFfi(result, []);
- }
-
- /// Returns the hour in this time
- ///
- /// See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.hour) for more information.
- int get hour {
- final result = _ICU4XIsoDateTime_hour(_ffi);
- return result;
- }
-
- /// Returns the minute in this time
- ///
- /// See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.minute) for more information.
- int get minute {
- final result = _ICU4XIsoDateTime_minute(_ffi);
- return result;
- }
-
- /// Returns the second in this time
- ///
- /// See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.second) for more information.
- int get second {
- final result = _ICU4XIsoDateTime_second(_ffi);
- return result;
- }
-
- /// Returns the nanosecond in this time
- ///
- /// See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.nanosecond) for more information.
- int get nanosecond {
- final result = _ICU4XIsoDateTime_nanosecond(_ffi);
- return result;
- }
-
- /// Returns the 1-indexed day in the year for this date
- ///
- /// See the [Rust documentation for `day_of_year_info`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_year_info) for more information.
- int get dayOfYear {
- final result = _ICU4XIsoDateTime_day_of_year(_ffi);
- return result;
- }
-
- /// Returns the 1-indexed day in the month for this date
- ///
- /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information.
- int get dayOfMonth {
- final result = _ICU4XIsoDateTime_day_of_month(_ffi);
- return result;
- }
-
- /// Returns the day in the week for this day
- ///
- /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information.
- IsoWeekday get dayOfWeek {
- final result = _ICU4XIsoDateTime_day_of_week(_ffi);
- return IsoWeekday.values.firstWhere((v) => v._ffi == result);
- }
-
- /// Returns the week number in this month, 1-indexed, based on what
- /// is considered the first day of the week (often a locale preference).
- ///
- /// `first_weekday` can be obtained via `first_weekday()` on [`WeekCalculator`]
- ///
- /// See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information.
- int weekOfMonth(IsoWeekday firstWeekday) {
- final result = _ICU4XIsoDateTime_week_of_month(_ffi, firstWeekday._ffi);
- return result;
- }
-
- /// Returns the week number in this year, using week data
- ///
- /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information.
- ///
- /// Throws [Error] on failure.
- WeekOf weekOfYear(WeekCalculator calculator) {
- final result = _ICU4XIsoDateTime_week_of_year(_ffi, calculator._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return WeekOf._fromFfi(result.union.ok);
- }
-
- /// Returns 1-indexed number of the month of this date in its year
- ///
- /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
- int get month {
- final result = _ICU4XIsoDateTime_month(_ffi);
- return result;
- }
-
- /// Returns the year number for this date
- ///
- /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information.
- int get year {
- final result = _ICU4XIsoDateTime_year(_ffi);
- return result;
- }
-
- /// Returns whether this date is in a leap year
- ///
- /// See the [Rust documentation for `is_in_leap_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.is_in_leap_year) for more information.
- bool get isInLeapYear {
- final result = _ICU4XIsoDateTime_is_in_leap_year(_ffi);
- return result;
- }
-
- /// Returns the number of months in the year represented by this date
- ///
- /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information.
- int get monthsInYear {
- final result = _ICU4XIsoDateTime_months_in_year(_ffi);
- return result;
- }
-
- /// Returns the number of days in the month represented by this date
- ///
- /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information.
- int get daysInMonth {
- final result = _ICU4XIsoDateTime_days_in_month(_ffi);
- return result;
- }
-
- /// Returns the number of days in the year represented by this date
- ///
- /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information.
- int get daysInYear {
- final result = _ICU4XIsoDateTime_days_in_year(_ffi);
- return result;
- }
+final class _IsoDateTimeFfi extends ffi.Struct {
+ external ffi.Pointer<ffi.Opaque> date;
+ external ffi.Pointer<ffi.Opaque> time;
}
-@_DiplomatFfiUse('ICU4XIsoDateTime_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XIsoDateTime_destroy(ffi.Pointer<ffi.Void> self);
+/// An ICU4X DateTime object capable of containing a ISO-8601 date and time.
+///
+/// See the [Rust documentation for `DateTime`](https://docs.rs/icu/2.0.0/icu/time/struct.DateTime.html) for more information.
+final class IsoDateTime {
+ final IsoDate date;
+ final Time time;
-@_DiplomatFfiUse('ICU4XIsoDateTime_create')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Int32,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint8,
- ffi.Uint32,
- )
->(isLeaf: true, symbol: 'ICU4XIsoDateTime_create')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XIsoDateTime_create(
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int nanosecond,
-);
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ IsoDateTime._fromFfi(_IsoDateTimeFfi ffi) :
+ date = IsoDate._fromFfi(ffi.date, []),
+ time = Time._fromFfi(ffi.time, []);
-@_DiplomatFfiUse('ICU4XIsoDateTime_crate_from_date_and_time')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XIsoDateTime_crate_from_date_and_time')
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDateTime_crate_from_date_and_time(
- ffi.Pointer<ffi.Opaque> date,
- ffi.Pointer<ffi.Opaque> time,
-);
+ // ignore: unused_element
+ _IsoDateTimeFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_IsoDateTimeFfi>();
+ struct.date = date._ffi;
+ struct.time = time._ffi;
+ return struct;
+ }
-@_DiplomatFfiUse('ICU4XIsoDateTime_local_unix_epoch')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_local_unix_epoch',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDateTime_local_unix_epoch();
+ /// Creates a new [IsoDateTime] from an IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.DateTime.html#method.try_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory IsoDateTime.fromString(String v) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_IsoDateTime_from_string_mv1(v._utf8AllocIn(temp.arena));
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return IsoDateTime._fromFfi(result.union.ok);
+ }
-@_DiplomatFfiUse('ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(int minutes);
-@_DiplomatFfiUse('ICU4XIsoDateTime_date')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_date',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDateTime_date(
- ffi.Pointer<ffi.Opaque> self,
-);
+ @override
+ bool operator ==(Object other) =>
+ other is IsoDateTime &&
+ other.date == date &&
+ other.time == time;
-@_DiplomatFfiUse('ICU4XIsoDateTime_time')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_time',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDateTime_time(
- ffi.Pointer<ffi.Opaque> self,
-);
+ @override
+ int get hashCode => Object.hashAll([
+ date,
+ time,
+ ]);
+}
-@_DiplomatFfiUse('ICU4XIsoDateTime_to_any')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_to_any',
-)
+@_DiplomatFfiUse('icu4x_IsoDateTime_from_string_mv1')
+@ffi.Native<_ResultIsoDateTimeFfiInt32 Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_IsoDateTime_from_string_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDateTime_to_any(
- ffi.Pointer<ffi.Opaque> self,
-);
+external _ResultIsoDateTimeFfiInt32 _icu4x_IsoDateTime_from_string_mv1(_SliceUtf8 v);
-@_DiplomatFfiUse('ICU4XIsoDateTime_minutes_since_local_unix_epoch')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_minutes_since_local_unix_epoch',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_minutes_since_local_unix_epoch(
- ffi.Pointer<ffi.Opaque> self,
-);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_to_calendar')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XIsoDateTime_to_calendar')
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XIsoDateTime_to_calendar(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calendar,
-);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_hour')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_hour',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_hour(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_minute')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_minute',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_minute(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_second')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_second',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_second(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_nanosecond')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_nanosecond',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_nanosecond(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_day_of_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_day_of_year',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_day_of_year(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_day_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_day_of_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_day_of_month(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_day_of_week')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_day_of_week',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_day_of_week(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_week_of_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_week_of_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_week_of_month(
- ffi.Pointer<ffi.Opaque> self,
- int firstWeekday,
-);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_week_of_year')
-@ffi.Native<
- _ResultWeekOfFfiInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XIsoDateTime_week_of_year')
-// ignore: non_constant_identifier_names
-external _ResultWeekOfFfiInt32 _ICU4XIsoDateTime_week_of_year(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> calculator,
-);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_month')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_month(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_year')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_year',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_year(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_is_in_leap_year')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_is_in_leap_year',
-)
-// ignore: non_constant_identifier_names
-external bool _ICU4XIsoDateTime_is_in_leap_year(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_months_in_year')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_months_in_year',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_months_in_year(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_days_in_month')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_days_in_month',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_days_in_month(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XIsoDateTime_days_in_year')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XIsoDateTime_days_in_year',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XIsoDateTime_days_in_year(ffi.Pointer<ffi.Opaque> self);
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneFormat.g.dart b/pkgs/intl4x/lib/src/bindings/IsoTimeZoneFormat.g.dart
deleted file mode 100644
index fae45ab..0000000
--- a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneFormat.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `IsoFormat`](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoFormat.html) for more information.
-enum IsoTimeZoneFormat { basic, extended, utcBasic, utcExtended }
diff --git a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneMinuteDisplay.g.dart b/pkgs/intl4x/lib/src/bindings/IsoTimeZoneMinuteDisplay.g.dart
deleted file mode 100644
index 4a4466d..0000000
--- a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneMinuteDisplay.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `IsoMinutes`](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoMinutes.html) for more information.
-enum IsoTimeZoneMinuteDisplay { required, optional }
diff --git a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneOptions.g.dart b/pkgs/intl4x/lib/src/bindings/IsoTimeZoneOptions.g.dart
deleted file mode 100644
index b3eca63..0000000
--- a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneOptions.g.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-final class _IsoTimeZoneOptionsFfi extends ffi.Struct {
- @ffi.Int32()
- external int format;
- @ffi.Int32()
- external int minutes;
- @ffi.Int32()
- external int seconds;
-}
-
-final class IsoTimeZoneOptions {
- IsoTimeZoneFormat format;
- IsoTimeZoneMinuteDisplay minutes;
- IsoTimeZoneSecondDisplay seconds;
-
- IsoTimeZoneOptions({
- required this.format,
- required this.minutes,
- required this.seconds,
- });
-
- // This struct contains borrowed fields, so this takes in a list of
- // "edges" corresponding to where each lifetime's data may have been borrowed from
- // and passes it down to individual fields containing the borrow.
- // This method does not attempt to handle any dependencies between lifetimes, the caller
- // should handle this when constructing edge arrays.
- // ignore: unused_element
- IsoTimeZoneOptions._fromFfi(_IsoTimeZoneOptionsFfi ffi)
- : format = IsoTimeZoneFormat.values[ffi.format],
- minutes = IsoTimeZoneMinuteDisplay.values[ffi.minutes],
- seconds = IsoTimeZoneSecondDisplay.values[ffi.seconds];
-
- // ignore: unused_element
- _IsoTimeZoneOptionsFfi _toFfi(ffi.Allocator temp) {
- final struct = ffi.Struct.create<_IsoTimeZoneOptionsFfi>();
- struct.format = format.index;
- struct.minutes = minutes.index;
- struct.seconds = seconds.index;
- return struct;
- }
-
- @override
- bool operator ==(Object other) =>
- other is IsoTimeZoneOptions &&
- other.format == format &&
- other.minutes == minutes &&
- other.seconds == seconds;
-
- @override
- int get hashCode => Object.hashAll([format, minutes, seconds]);
-}
diff --git a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneSecondDisplay.g.dart b/pkgs/intl4x/lib/src/bindings/IsoTimeZoneSecondDisplay.g.dart
deleted file mode 100644
index 810f7aa..0000000
--- a/pkgs/intl4x/lib/src/bindings/IsoTimeZoneSecondDisplay.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `IsoSeconds`](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoSeconds.html) for more information.
-enum IsoTimeZoneSecondDisplay { optional, never }
diff --git a/pkgs/intl4x/lib/src/bindings/IsoWeekOfYear.g.dart b/pkgs/intl4x/lib/src/bindings/IsoWeekOfYear.g.dart
new file mode 100644
index 0000000..dc8cb9f
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/IsoWeekOfYear.g.dart
@@ -0,0 +1,51 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _IsoWeekOfYearFfi extends ffi.Struct {
+ @ffi.Uint8()
+ external int weekNumber;
+ @ffi.Int32()
+ external int isoYear;
+}
+
+final class IsoWeekOfYear {
+ int weekNumber;
+ int isoYear;
+
+ IsoWeekOfYear({required this.weekNumber, required this.isoYear});
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ IsoWeekOfYear._fromFfi(_IsoWeekOfYearFfi ffi) :
+ weekNumber = ffi.weekNumber,
+ isoYear = ffi.isoYear;
+
+ // ignore: unused_element
+ _IsoWeekOfYearFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_IsoWeekOfYearFfi>();
+ struct.weekNumber = weekNumber;
+ struct.isoYear = isoYear;
+ return struct;
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is IsoWeekOfYear &&
+ other.weekNumber == weekNumber &&
+ other.isoYear == isoYear;
+
+ @override
+ int get hashCode => Object.hashAll([
+ weekNumber,
+ isoYear,
+ ]);
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/JoiningType.g.dart b/pkgs/intl4x/lib/src/bindings/JoiningType.g.dart
new file mode 100644
index 0000000..c076326
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/JoiningType.g.dart
@@ -0,0 +1,95 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `JoiningType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html) for more information.
+enum JoiningType {
+ /// See the [Rust documentation for `NonJoining`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#associatedconstant.NonJoining) for more information.
+ nonJoining,
+ /// See the [Rust documentation for `JoinCausing`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#associatedconstant.JoinCausing) for more information.
+ joinCausing,
+ /// See the [Rust documentation for `DualJoining`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#associatedconstant.DualJoining) for more information.
+ dualJoining,
+ /// See the [Rust documentation for `LeftJoining`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#associatedconstant.LeftJoining) for more information.
+ leftJoining,
+ /// See the [Rust documentation for `RightJoining`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#associatedconstant.RightJoining) for more information.
+ rightJoining,
+ /// See the [Rust documentation for `Transparent`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#associatedconstant.Transparent) for more information.
+ transparent;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static JoiningType forChar(Rune ch) {
+ final result = _icu4x_JoiningType_for_char_mv1(ch);
+ return JoiningType.values[result];
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_JoiningType_long_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_JoiningType_short_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_JoiningType_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.JoiningType.html#method.from_icu4c_value) for more information.
+ static JoiningType? fromIntegerValue(int other) {
+ final result = _icu4x_JoiningType_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return JoiningType.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_JoiningType_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_JoiningType_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_JoiningType_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_JoiningType_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_JoiningType_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_JoiningType_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_JoiningType_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_JoiningType_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_JoiningType_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_JoiningType_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_JoiningType_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_JoiningType_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_JoiningType_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_JoiningType_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_JoiningType_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LanguageDisplay.g.dart b/pkgs/intl4x/lib/src/bindings/LanguageDisplay.g.dart
index bb06383..9b40b4a 100644
--- a/pkgs/intl4x/lib/src/bindings/LanguageDisplay.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LanguageDisplay.g.dart
@@ -1,6 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LanguageDisplay`](https://docs.rs/icu/latest/icu/displaynames/options/enum.LanguageDisplay.html) for more information.
-enum LanguageDisplay { dialect, standard }
+/// See the [Rust documentation for `LanguageDisplay`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/enum.LanguageDisplay.html) for more information.
+enum LanguageDisplay {
+
+ dialect,
+
+ standard;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LeadingAdjustment.g.dart b/pkgs/intl4x/lib/src/bindings/LeadingAdjustment.g.dart
index a49d72c..d4f2882 100644
--- a/pkgs/intl4x/lib/src/bindings/LeadingAdjustment.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LeadingAdjustment.g.dart
@@ -1,6 +1,17 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LeadingAdjustment`](https://docs.rs/icu/latest/icu/casemap/titlecase/enum.LeadingAdjustment.html) for more information.
-enum LeadingAdjustment { auto, none, toCased }
+/// See the [Rust documentation for `LeadingAdjustment`](https://docs.rs/icu/2.0.0/icu/casemap/options/enum.LeadingAdjustment.html) for more information.
+enum LeadingAdjustment {
+
+ auto,
+
+ none,
+
+ toCased;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineBreak.g.dart b/pkgs/intl4x/lib/src/bindings/LineBreak.g.dart
new file mode 100644
index 0000000..2a8616f
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/LineBreak.g.dart
@@ -0,0 +1,179 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `LineBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html) for more information.
+enum LineBreak {
+ /// See the [Rust documentation for `Unknown`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Unknown) for more information.
+ unknown,
+ /// See the [Rust documentation for `Ambiguous`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Ambiguous) for more information.
+ ambiguous,
+ /// See the [Rust documentation for `Alphabetic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Alphabetic) for more information.
+ alphabetic,
+ /// See the [Rust documentation for `BreakBoth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakBoth) for more information.
+ breakBoth,
+ /// See the [Rust documentation for `BreakAfter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakAfter) for more information.
+ breakAfter,
+ /// See the [Rust documentation for `BreakBefore`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakBefore) for more information.
+ breakBefore,
+ /// See the [Rust documentation for `MandatoryBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.MandatoryBreak) for more information.
+ mandatoryBreak,
+ /// See the [Rust documentation for `ContingentBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ContingentBreak) for more information.
+ contingentBreak,
+ /// See the [Rust documentation for `ClosePunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ClosePunctuation) for more information.
+ closePunctuation,
+ /// See the [Rust documentation for `CombiningMark`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.CombiningMark) for more information.
+ combiningMark,
+ /// See the [Rust documentation for `CarriageReturn`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.CarriageReturn) for more information.
+ carriageReturn,
+ /// See the [Rust documentation for `Exclamation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Exclamation) for more information.
+ exclamation,
+ /// See the [Rust documentation for `Glue`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Glue) for more information.
+ glue,
+ /// See the [Rust documentation for `Hyphen`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Hyphen) for more information.
+ hyphen,
+ /// See the [Rust documentation for `Ideographic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Ideographic) for more information.
+ ideographic,
+ /// See the [Rust documentation for `Inseparable`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Inseparable) for more information.
+ inseparable,
+ /// See the [Rust documentation for `InfixNumeric`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.InfixNumeric) for more information.
+ infixNumeric,
+ /// See the [Rust documentation for `LineFeed`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.LineFeed) for more information.
+ lineFeed,
+ /// See the [Rust documentation for `Nonstarter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Nonstarter) for more information.
+ nonstarter,
+ /// See the [Rust documentation for `Numeric`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Numeric) for more information.
+ numeric,
+ /// See the [Rust documentation for `OpenPunctuation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.OpenPunctuation) for more information.
+ openPunctuation,
+ /// See the [Rust documentation for `PostfixNumeric`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.PostfixNumeric) for more information.
+ postfixNumeric,
+ /// See the [Rust documentation for `PrefixNumeric`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.PrefixNumeric) for more information.
+ prefixNumeric,
+ /// See the [Rust documentation for `Quotation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Quotation) for more information.
+ quotation,
+ /// See the [Rust documentation for `ComplexContext`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ComplexContext) for more information.
+ complexContext,
+ /// See the [Rust documentation for `Surrogate`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Surrogate) for more information.
+ surrogate,
+ /// See the [Rust documentation for `Space`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Space) for more information.
+ space,
+ /// See the [Rust documentation for `BreakSymbols`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakSymbols) for more information.
+ breakSymbols,
+ /// See the [Rust documentation for `ZWSpace`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ZWSpace) for more information.
+ zwSpace,
+ /// See the [Rust documentation for `NextLine`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.NextLine) for more information.
+ nextLine,
+ /// See the [Rust documentation for `WordJoiner`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.WordJoiner) for more information.
+ wordJoiner,
+ /// See the [Rust documentation for `H2`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.H2) for more information.
+ h2,
+ /// See the [Rust documentation for `H3`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.H3) for more information.
+ h3,
+ /// See the [Rust documentation for `JL`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.JL) for more information.
+ jl,
+ /// See the [Rust documentation for `JT`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.JT) for more information.
+ jt,
+ /// See the [Rust documentation for `JV`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.JV) for more information.
+ jv,
+ /// See the [Rust documentation for `CloseParenthesis`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.CloseParenthesis) for more information.
+ closeParenthesis,
+ /// See the [Rust documentation for `ConditionalJapaneseStarter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ConditionalJapaneseStarter) for more information.
+ conditionalJapaneseStarter,
+ /// See the [Rust documentation for `HebrewLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.HebrewLetter) for more information.
+ hebrewLetter,
+ /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.RegionalIndicator) for more information.
+ regionalIndicator,
+ /// See the [Rust documentation for `EBase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.EBase) for more information.
+ eBase,
+ /// See the [Rust documentation for `EModifier`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.EModifier) for more information.
+ eModifier,
+ /// See the [Rust documentation for `ZWJ`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ZWJ) for more information.
+ zwj,
+ /// See the [Rust documentation for `Aksara`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Aksara) for more information.
+ aksara,
+ /// See the [Rust documentation for `AksaraPrebase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.AksaraPrebase) for more information.
+ aksaraPrebase,
+ /// See the [Rust documentation for `AksaraStart`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.AksaraStart) for more information.
+ aksaraStart,
+ /// See the [Rust documentation for `ViramaFinal`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ViramaFinal) for more information.
+ viramaFinal,
+ /// See the [Rust documentation for `Virama`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Virama) for more information.
+ virama;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static LineBreak forChar(Rune ch) {
+ final result = _icu4x_LineBreak_for_char_mv1(ch);
+ return LineBreak.values[result];
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_LineBreak_long_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_LineBreak_short_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_LineBreak_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html#method.from_icu4c_value) for more information.
+ static LineBreak? fromIntegerValue(int other) {
+ final result = _icu4x_LineBreak_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return LineBreak.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_LineBreak_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_LineBreak_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_LineBreak_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_LineBreak_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_LineBreak_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_LineBreak_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_LineBreak_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_LineBreak_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_LineBreak_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_LineBreak_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_LineBreak_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_LineBreak_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_LineBreak_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_LineBreak_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_LineBreak_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineBreakIteratorLatin1.g.dart b/pkgs/intl4x/lib/src/bindings/LineBreakIteratorLatin1.g.dart
index db92dd6..08931a3 100644
--- a/pkgs/intl4x/lib/src/bindings/LineBreakIteratorLatin1.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LineBreakIteratorLatin1.g.dart
@@ -1,10 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html) for more information.
-///
-/// Additional information: [1](https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorLatin1.html)
+/// See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.LineBreakIterator.html) for more information.
final class LineBreakIteratorLatin1 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,33 +23,28 @@
}
}
- @_DiplomatFfiUse('ICU4XLineBreakIteratorLatin1_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLineBreakIteratorLatin1_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LineBreakIteratorLatin1_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LineBreakIteratorLatin1_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.LineBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XLineBreakIteratorLatin1_next(_ffi);
+ final result = _icu4x_LineBreakIteratorLatin1_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XLineBreakIteratorLatin1_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLineBreakIteratorLatin1_destroy',
-)
+@_DiplomatFfiUse('icu4x_LineBreakIteratorLatin1_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LineBreakIteratorLatin1_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLineBreakIteratorLatin1_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LineBreakIteratorLatin1_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLineBreakIteratorLatin1_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLineBreakIteratorLatin1_next',
-)
+@_DiplomatFfiUse('icu4x_LineBreakIteratorLatin1_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LineBreakIteratorLatin1_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLineBreakIteratorLatin1_next(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_LineBreakIteratorLatin1_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf16.g.dart b/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf16.g.dart
index f23b2c2..00754f4 100644
--- a/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf16.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf16.g.dart
@@ -1,10 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html) for more information.
-///
-/// Additional information: [1](https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorUtf16.html)
+/// See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.LineBreakIterator.html) for more information.
final class LineBreakIteratorUtf16 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,33 +23,28 @@
}
}
- @_DiplomatFfiUse('ICU4XLineBreakIteratorUtf16_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLineBreakIteratorUtf16_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LineBreakIteratorUtf16_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LineBreakIteratorUtf16_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.LineBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XLineBreakIteratorUtf16_next(_ffi);
+ final result = _icu4x_LineBreakIteratorUtf16_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XLineBreakIteratorUtf16_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLineBreakIteratorUtf16_destroy',
-)
+@_DiplomatFfiUse('icu4x_LineBreakIteratorUtf16_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LineBreakIteratorUtf16_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLineBreakIteratorUtf16_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LineBreakIteratorUtf16_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLineBreakIteratorUtf16_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLineBreakIteratorUtf16_next',
-)
+@_DiplomatFfiUse('icu4x_LineBreakIteratorUtf16_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LineBreakIteratorUtf16_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLineBreakIteratorUtf16_next(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_LineBreakIteratorUtf16_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf8.g.dart b/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf8.g.dart
index 3cfb55d..0f7e698 100644
--- a/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf8.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LineBreakIteratorUtf8.g.dart
@@ -1,10 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html) for more information.
-///
-/// Additional information: [1](https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorPotentiallyIllFormedUtf8.html)
+/// See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.LineBreakIterator.html) for more information.
final class LineBreakIteratorUtf8 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,33 +23,28 @@
}
}
- @_DiplomatFfiUse('ICU4XLineBreakIteratorUtf8_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLineBreakIteratorUtf8_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LineBreakIteratorUtf8_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LineBreakIteratorUtf8_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.LineBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XLineBreakIteratorUtf8_next(_ffi);
+ final result = _icu4x_LineBreakIteratorUtf8_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XLineBreakIteratorUtf8_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLineBreakIteratorUtf8_destroy',
-)
+@_DiplomatFfiUse('icu4x_LineBreakIteratorUtf8_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LineBreakIteratorUtf8_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLineBreakIteratorUtf8_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LineBreakIteratorUtf8_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLineBreakIteratorUtf8_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLineBreakIteratorUtf8_next',
-)
+@_DiplomatFfiUse('icu4x_LineBreakIteratorUtf8_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LineBreakIteratorUtf8_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLineBreakIteratorUtf8_next(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_LineBreakIteratorUtf8_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineBreakOptions.g.dart b/pkgs/intl4x/lib/src/bindings/LineBreakOptions.g.dart
index 54e4026..48eaf20 100644
--- a/pkgs/intl4x/lib/src/bindings/LineBreakOptions.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LineBreakOptions.g.dart
@@ -1,27 +1,19 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
final class _LineBreakOptionsFfi extends ffi.Struct {
- @ffi.Int32()
- external int strictness;
- @ffi.Int32()
- external int wordOption;
- @ffi.Bool()
- external bool jaZh;
+ external _ResultInt32Void strictness;
+ external _ResultInt32Void wordOption;
}
-/// See the [Rust documentation for `LineBreakOptions`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakOptions.html) for more information.
+/// See the [Rust documentation for `LineBreakOptions`](https://docs.rs/icu/2.0.0/icu/segmenter/options/struct.LineBreakOptions.html) for more information.
final class LineBreakOptions {
- LineBreakStrictness strictness;
- LineBreakWordOption wordOption;
- bool jaZh;
+ LineBreakStrictness? strictness;
+ LineBreakWordOption? wordOption;
- LineBreakOptions({
- required this.strictness,
- required this.wordOption,
- required this.jaZh,
- });
+ LineBreakOptions({this.strictness, this.wordOption});
// This struct contains borrowed fields, so this takes in a list of
// "edges" corresponding to where each lifetime's data may have been borrowed from
@@ -29,27 +21,32 @@
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
- LineBreakOptions._fromFfi(_LineBreakOptionsFfi ffi)
- : strictness = LineBreakStrictness.values[ffi.strictness],
- wordOption = LineBreakWordOption.values[ffi.wordOption],
- jaZh = ffi.jaZh;
+ LineBreakOptions._fromFfi(_LineBreakOptionsFfi ffi) :
+ strictness = ffi.strictness.isOk ? LineBreakStrictness.values[ffi.strictness.union.ok] : null,
+ wordOption = ffi.wordOption.isOk ? LineBreakWordOption.values[ffi.wordOption.union.ok] : null;
// ignore: unused_element
_LineBreakOptionsFfi _toFfi(ffi.Allocator temp) {
final struct = ffi.Struct.create<_LineBreakOptionsFfi>();
- struct.strictness = strictness.index;
- struct.wordOption = wordOption.index;
- struct.jaZh = jaZh;
+ LineBreakStrictness? strictness = this.strictness;
+ struct.strictness = strictness != null ? _ResultInt32Void.ok(strictness.index) : _ResultInt32Void.err();
+ LineBreakWordOption? wordOption = this.wordOption;
+ struct.wordOption = wordOption != null ? _ResultInt32Void.ok(wordOption.index) : _ResultInt32Void.err();
return struct;
}
+
@override
bool operator ==(Object other) =>
other is LineBreakOptions &&
other.strictness == strictness &&
- other.wordOption == wordOption &&
- other.jaZh == jaZh;
+ other.wordOption == wordOption;
@override
- int get hashCode => Object.hashAll([strictness, wordOption, jaZh]);
+ int get hashCode => Object.hashAll([
+ strictness,
+ wordOption,
+ ]);
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineBreakStrictness.g.dart b/pkgs/intl4x/lib/src/bindings/LineBreakStrictness.g.dart
index 2bdbef9..a11cfb5 100644
--- a/pkgs/intl4x/lib/src/bindings/LineBreakStrictness.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LineBreakStrictness.g.dart
@@ -1,6 +1,19 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LineBreakStrictness`](https://docs.rs/icu/latest/icu/segmenter/enum.LineBreakStrictness.html) for more information.
-enum LineBreakStrictness { loose, normal, strict, anywhere }
+/// See the [Rust documentation for `LineBreakStrictness`](https://docs.rs/icu/2.0.0/icu/segmenter/options/enum.LineBreakStrictness.html) for more information.
+enum LineBreakStrictness {
+
+ loose,
+
+ normal,
+
+ strict,
+
+ anywhere;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineBreakWordOption.g.dart b/pkgs/intl4x/lib/src/bindings/LineBreakWordOption.g.dart
index 04b2e76..6043479 100644
--- a/pkgs/intl4x/lib/src/bindings/LineBreakWordOption.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LineBreakWordOption.g.dart
@@ -1,6 +1,17 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LineBreakWordOption`](https://docs.rs/icu/latest/icu/segmenter/enum.LineBreakWordOption.html) for more information.
-enum LineBreakWordOption { normal, breakAll, keepAll }
+/// See the [Rust documentation for `LineBreakWordOption`](https://docs.rs/icu/2.0.0/icu/segmenter/options/enum.LineBreakWordOption.html) for more information.
+enum LineBreakWordOption {
+
+ normal,
+
+ breakAll,
+
+ keepAll;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LineSegmenter.g.dart b/pkgs/intl4x/lib/src/bindings/LineSegmenter.g.dart
index 330f919..a124da3 100644
--- a/pkgs/intl4x/lib/src/bindings/LineSegmenter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LineSegmenter.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X line-break segmenter, capable of finding breakpoints in strings.
///
-/// See the [Rust documentation for `LineSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html) for more information.
+/// See the [Rust documentation for `LineSegmenter`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html) for more information.
final class LineSegmenter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,115 +23,107 @@
}
}
- @_DiplomatFfiUse('ICU4XLineSegmenter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLineSegmenter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LineSegmenter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LineSegmenter_destroy_mv1));
- /// Construct a [`LineSegmenter`] with default options. It automatically loads the best
+ /// Construct a [LineSegmenter] with default options (no locale-based tailoring) using compiled data. It automatically loads the best
/// available payload data for Burmese, Khmer, Lao, and Thai.
///
- /// See the [Rust documentation for `new_auto`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
- ///
- /// Throws [Error] on failure.
- factory LineSegmenter.auto(DataProvider provider) {
- final result = _ICU4XLineSegmenter_create_auto(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return LineSegmenter._fromFfi(result.union.ok, []);
+ /// See the [Rust documentation for `new_auto`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
+ factory LineSegmenter.auto() {
+ final result = _icu4x_LineSegmenter_create_auto_mv1();
+ return LineSegmenter._fromFfi(result, []);
}
- /// Construct a [`LineSegmenter`] with default options and LSTM payload data for
- /// Burmese, Khmer, Lao, and Thai.
+ /// Construct a [LineSegmenter] with default options (no locale-based tailoring) and LSTM payload data for
+ /// Burmese, Khmer, Lao, and Thai, using compiled data.
///
- /// See the [Rust documentation for `new_lstm`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
- ///
- /// Throws [Error] on failure.
- factory LineSegmenter.lstm(DataProvider provider) {
- final result = _ICU4XLineSegmenter_create_lstm(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return LineSegmenter._fromFfi(result.union.ok, []);
+ /// See the [Rust documentation for `new_lstm`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
+ factory LineSegmenter.lstm() {
+ final result = _icu4x_LineSegmenter_create_lstm_mv1();
+ return LineSegmenter._fromFfi(result, []);
}
- /// Construct a [`LineSegmenter`] with default options and dictionary payload data for
- /// Burmese, Khmer, Lao, and Thai..
+ /// Construct a [LineSegmenter] with default options (no locale-based tailoring) and dictionary payload data for
+ /// Burmese, Khmer, Lao, and Thai, using compiled data
///
- /// See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
- ///
- /// Throws [Error] on failure.
- factory LineSegmenter.dictionary(DataProvider provider) {
- final result = _ICU4XLineSegmenter_create_dictionary(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return LineSegmenter._fromFfi(result.union.ok, []);
+ /// See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
+ factory LineSegmenter.dictionary() {
+ final result = _icu4x_LineSegmenter_create_dictionary_mv1();
+ return LineSegmenter._fromFfi(result, []);
}
- /// Construct a [`LineSegmenter`] with custom options. It automatically loads the best
+ /// Construct a [LineSegmenter] with custom options using compiled data. It automatically loads the best
/// available payload data for Burmese, Khmer, Lao, and Thai.
///
- /// See the [Rust documentation for `new_auto_with_options`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto_with_options) for more information.
+ /// See the [Rust documentation for `new_auto`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
+ factory LineSegmenter.autoWithOptions(LineBreakOptions options, [Locale? contentLocale]) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LineSegmenter_create_auto_with_options_v2_mv1(contentLocale?._ffi ?? ffi.Pointer.fromAddress(0), options._toFfi(temp.arena));
+ return LineSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct a [LineSegmenter] with custom options. It automatically loads the best
+ /// available payload data for Burmese, Khmer, Lao, and Thai, using a particular data source.
///
- /// Throws [Error] on failure.
- factory LineSegmenter.autoWithOptions(
- DataProvider provider,
- LineBreakOptions options,
- ) {
- final temp = ffi2.Arena();
- final result = _ICU4XLineSegmenter_create_auto_with_options_v1(
- provider._ffi,
- options._toFfi(temp),
- );
- temp.releaseAll();
+ /// See the [Rust documentation for `new_auto`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LineSegmenter.autoWithOptionsAndProvider(DataProvider provider, LineBreakOptions options, [Locale? contentLocale]) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1(provider._ffi, contentLocale?._ffi ?? ffi.Pointer.fromAddress(0), options._toFfi(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LineSegmenter._fromFfi(result.union.ok, []);
}
- /// Construct a [`LineSegmenter`] with custom options and LSTM payload data for
- /// Burmese, Khmer, Lao, and Thai.
+ /// Construct a [LineSegmenter] with custom options and LSTM payload data for
+ /// Burmese, Khmer, Lao, and Thai, using compiled data.
///
- /// See the [Rust documentation for `new_lstm_with_options`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm_with_options) for more information.
+ /// See the [Rust documentation for `new_lstm`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
+ factory LineSegmenter.lstmWithOptions(LineBreakOptions options, [Locale? contentLocale]) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LineSegmenter_create_lstm_with_options_v2_mv1(contentLocale?._ffi ?? ffi.Pointer.fromAddress(0), options._toFfi(temp.arena));
+ return LineSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct a [LineSegmenter] with custom options and LSTM payload data for
+ /// Burmese, Khmer, Lao, and Thai, using a particular data source.
///
- /// Throws [Error] on failure.
- factory LineSegmenter.lstmWithOptions(
- DataProvider provider,
- LineBreakOptions options,
- ) {
- final temp = ffi2.Arena();
- final result = _ICU4XLineSegmenter_create_lstm_with_options_v1(
- provider._ffi,
- options._toFfi(temp),
- );
- temp.releaseAll();
+ /// See the [Rust documentation for `new_lstm`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LineSegmenter.lstmWithOptionsAndProvider(DataProvider provider, LineBreakOptions options, [Locale? contentLocale]) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1(provider._ffi, contentLocale?._ffi ?? ffi.Pointer.fromAddress(0), options._toFfi(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LineSegmenter._fromFfi(result.union.ok, []);
}
- /// Construct a [`LineSegmenter`] with custom options and dictionary payload data for
- /// Burmese, Khmer, Lao, and Thai.
+ /// Construct a [LineSegmenter] with custom options and dictionary payload data for
+ /// Burmese, Khmer, Lao, and Thai, using compiled data.
///
- /// See the [Rust documentation for `new_dictionary_with_options`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary_with_options) for more information.
+ /// See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
+ factory LineSegmenter.dictionaryWithOptions(LineBreakOptions options, [Locale? contentLocale]) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LineSegmenter_create_dictionary_with_options_v2_mv1(contentLocale?._ffi ?? ffi.Pointer.fromAddress(0), options._toFfi(temp.arena));
+ return LineSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct a [LineSegmenter] with custom options and dictionary payload data for
+ /// Burmese, Khmer, Lao, and Thai, using a particular data source.
///
- /// Throws [Error] on failure.
- factory LineSegmenter.dictionaryWithOptions(
- DataProvider provider,
- LineBreakOptions options,
- ) {
- final temp = ffi2.Arena();
- final result = _ICU4XLineSegmenter_create_dictionary_with_options_v1(
- provider._ffi,
- options._toFfi(temp),
- );
- temp.releaseAll();
+ /// See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LineSegmenter.dictionaryWithOptionsAndProvider(DataProvider provider, LineBreakOptions options, [Locale? contentLocale]) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1(provider._ffi, contentLocale?._ffi ?? ffi.Pointer.fromAddress(0), options._toFfi(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LineSegmenter._fromFfi(result.union.ok, []);
}
@@ -140,101 +133,70 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf16) for more information.
+ /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.LineSegmenterBorrowed.html#method.segment_utf16) for more information.
LineBreakIteratorUtf16 segment(String input) {
- final inputView = input.utf16View;
final inputArena = _FinalizedArena();
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this, inputArena];
- final result = _ICU4XLineSegmenter_segment_utf16(
- _ffi,
- inputView.allocIn(inputArena.arena),
- inputView.length,
- );
+ final result = _icu4x_LineSegmenter_segment_utf16_mv1(_ffi, input._utf16AllocIn(inputArena.arena));
return LineBreakIteratorUtf16._fromFfi(result, [], aEdges);
}
+
}
-@_DiplomatFfiUse('ICU4XLineSegmenter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLineSegmenter_destroy',
-)
+@_DiplomatFfiUse('icu4x_LineSegmenter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLineSegmenter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LineSegmenter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLineSegmenter_create_auto')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLineSegmenter_create_auto',
-)
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_auto_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_auto_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_auto(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LineSegmenter_create_auto_mv1();
-@_DiplomatFfiUse('ICU4XLineSegmenter_create_lstm')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLineSegmenter_create_lstm',
-)
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_lstm_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_lstm_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_lstm(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LineSegmenter_create_lstm_mv1();
-@_DiplomatFfiUse('ICU4XLineSegmenter_create_dictionary')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLineSegmenter_create_dictionary',
-)
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_dictionary_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_dictionary_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_dictionary(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LineSegmenter_create_dictionary_mv1();
-@_DiplomatFfiUse('ICU4XLineSegmenter_create_auto_with_options_v1')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)
->(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_auto_with_options_v1')
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_auto_with_options_v2_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_auto_with_options_v2_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_auto_with_options_v1(
- ffi.Pointer<ffi.Opaque> provider,
- _LineBreakOptionsFfi options,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LineSegmenter_create_auto_with_options_v2_mv1(ffi.Pointer<ffi.Opaque> contentLocale, _LineBreakOptionsFfi options);
-@_DiplomatFfiUse('ICU4XLineSegmenter_create_lstm_with_options_v1')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)
->(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_lstm_with_options_v1')
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_lstm_with_options_v1(
- ffi.Pointer<ffi.Opaque> provider,
- _LineBreakOptionsFfi options,
-);
+external _ResultOpaqueInt32 _icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> contentLocale, _LineBreakOptionsFfi options);
-@_DiplomatFfiUse('ICU4XLineSegmenter_create_dictionary_with_options_v1')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)
->(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_dictionary_with_options_v1')
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_lstm_with_options_v2_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_lstm_with_options_v2_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XLineSegmenter_create_dictionary_with_options_v1(
- ffi.Pointer<ffi.Opaque> provider,
- _LineBreakOptionsFfi options,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LineSegmenter_create_lstm_with_options_v2_mv1(ffi.Pointer<ffi.Opaque> contentLocale, _LineBreakOptionsFfi options);
-@_DiplomatFfiUse('ICU4XLineSegmenter_segment_utf16')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint16>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XLineSegmenter_segment_utf16')
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XLineSegmenter_segment_utf16(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint16> inputData,
- int inputLength,
-);
+external _ResultOpaqueInt32 _icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> contentLocale, _LineBreakOptionsFfi options);
+
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_dictionary_with_options_v2_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_dictionary_with_options_v2_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_LineSegmenter_create_dictionary_with_options_v2_mv1(ffi.Pointer<ffi.Opaque> contentLocale, _LineBreakOptionsFfi options);
+
+@_DiplomatFfiUse('icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _LineBreakOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> contentLocale, _LineBreakOptionsFfi options);
+
+@_DiplomatFfiUse('icu4x_LineSegmenter_segment_utf16_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_LineSegmenter_segment_utf16_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_LineSegmenter_segment_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 input);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ListFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/ListFormatter.g.dart
index 954ed4a..540838c 100644
--- a/pkgs/intl4x/lib/src/bindings/ListFormatter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ListFormatter.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `ListFormatter`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html) for more information.
+/// See the [Rust documentation for `ListFormatter`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html) for more information.
final class ListFormatter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,161 +21,135 @@
}
}
- @_DiplomatFfiUse('ICU4XListFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XListFormatter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_ListFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ListFormatter_destroy_mv1));
- /// Construct a new ICU4XListFormatter instance for And patterns
+ /// Construct a new ListFormatter instance for And patterns from compiled data.
///
- /// See the [Rust documentation for `try_new_and_with_length`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_and_with_length) for more information.
+ /// See the [Rust documentation for `try_new_and`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html#method.try_new_and) for more information.
///
- /// Throws [Error] on failure.
- factory ListFormatter.andWithLength(
- DataProvider provider,
- Locale locale,
- ListLength length,
- ) {
- final result = _ICU4XListFormatter_create_and_with_length(
- provider._ffi,
- locale._ffi,
- length.index,
- );
+ /// Throws [DataError] on failure.
+ factory ListFormatter.andWithLength(Locale locale, ListLength length) {
+ final result = _icu4x_ListFormatter_create_and_with_length_mv1(locale._ffi, length.index);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return ListFormatter._fromFfi(result.union.ok, []);
}
- /// Construct a new ICU4XListFormatter instance for And patterns
+ /// Construct a new ListFormatter instance for And patterns
///
- /// See the [Rust documentation for `try_new_or_with_length`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_or_with_length) for more information.
+ /// See the [Rust documentation for `try_new_and`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html#method.try_new_and) for more information.
///
- /// Throws [Error] on failure.
- factory ListFormatter.orWithLength(
- DataProvider provider,
- Locale locale,
- ListLength length,
- ) {
- final result = _ICU4XListFormatter_create_or_with_length(
- provider._ffi,
- locale._ffi,
- length.index,
- );
+ /// Throws [DataError] on failure.
+ factory ListFormatter.andWithLengthAndProvider(DataProvider provider, Locale locale, ListLength length) {
+ final result = _icu4x_ListFormatter_create_and_with_length_and_provider_mv1(provider._ffi, locale._ffi, length.index);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return ListFormatter._fromFfi(result.union.ok, []);
}
- /// Construct a new ICU4XListFormatter instance for And patterns
+ /// Construct a new ListFormatter instance for And patterns from compiled data.
///
- /// See the [Rust documentation for `try_new_unit_with_length`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_unit_with_length) for more information.
+ /// See the [Rust documentation for `try_new_or`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html#method.try_new_or) for more information.
///
- /// Throws [Error] on failure.
- factory ListFormatter.unitWithLength(
- DataProvider provider,
- Locale locale,
- ListLength length,
- ) {
- final result = _ICU4XListFormatter_create_unit_with_length(
- provider._ffi,
- locale._ffi,
- length.index,
- );
+ /// Throws [DataError] on failure.
+ factory ListFormatter.orWithLength(Locale locale, ListLength length) {
+ final result = _icu4x_ListFormatter_create_or_with_length_mv1(locale._ffi, length.index);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return ListFormatter._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.format) for more information.
+ /// Construct a new ListFormatter instance for And patterns
///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `try_new_or`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html#method.try_new_or) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ListFormatter.orWithLengthAndProvider(DataProvider provider, Locale locale, ListLength length) {
+ final result = _icu4x_ListFormatter_create_or_with_length_and_provider_mv1(provider._ffi, locale._ffi, length.index);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ListFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct a new ListFormatter instance for And patterns from compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_unit`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html#method.try_new_unit) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ListFormatter.unitWithLength(Locale locale, ListLength length) {
+ final result = _icu4x_ListFormatter_create_unit_with_length_mv1(locale._ffi, length.index);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ListFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct a new ListFormatter instance for And patterns
+ ///
+ /// See the [Rust documentation for `try_new_unit`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html#method.try_new_unit) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ListFormatter.unitWithLengthAndProvider(DataProvider provider, Locale locale, ListLength length) {
+ final result = _icu4x_ListFormatter_create_unit_with_length_and_provider_mv1(provider._ffi, locale._ffi, length.index);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return ListFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/list/struct.ListFormatter.html#method.format) for more information.
String format(core.List<core.String> list) {
- final temp = ffi2.Arena();
- final listView = list.utf16View;
- final writeable = _Writeable();
- final result = _ICU4XListFormatter_format_utf16(
- _ffi,
- listView.allocIn(temp),
- listView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_ListFormatter_format_utf16_mv1(_ffi, list._utf16SliceAllocIn(temp.arena), write._ffi);
+ return write.finalize();
}
+
}
-@_DiplomatFfiUse('ICU4XListFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XListFormatter_destroy',
-)
+@_DiplomatFfiUse('icu4x_ListFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ListFormatter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XListFormatter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_ListFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XListFormatter_create_and_with_length')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XListFormatter_create_and_with_length')
+@_DiplomatFfiUse('icu4x_ListFormatter_create_and_with_length_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_ListFormatter_create_and_with_length_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XListFormatter_create_and_with_length(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int length,
-);
+external _ResultOpaqueInt32 _icu4x_ListFormatter_create_and_with_length_mv1(ffi.Pointer<ffi.Opaque> locale, int length);
-@_DiplomatFfiUse('ICU4XListFormatter_create_or_with_length')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XListFormatter_create_or_with_length')
+@_DiplomatFfiUse('icu4x_ListFormatter_create_and_with_length_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_ListFormatter_create_and_with_length_and_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XListFormatter_create_or_with_length(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int length,
-);
+external _ResultOpaqueInt32 _icu4x_ListFormatter_create_and_with_length_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, int length);
-@_DiplomatFfiUse('ICU4XListFormatter_create_unit_with_length')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XListFormatter_create_unit_with_length')
+@_DiplomatFfiUse('icu4x_ListFormatter_create_or_with_length_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_ListFormatter_create_or_with_length_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XListFormatter_create_unit_with_length(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int length,
-);
+external _ResultOpaqueInt32 _icu4x_ListFormatter_create_or_with_length_mv1(ffi.Pointer<ffi.Opaque> locale, int length);
-@_DiplomatFfiUse('ICU4XListFormatter_format_utf16')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<_SliceUtf16>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XListFormatter_format_utf16')
+@_DiplomatFfiUse('icu4x_ListFormatter_create_or_with_length_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_ListFormatter_create_or_with_length_and_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XListFormatter_format_utf16(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<_SliceUtf16> listData,
- int listLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_ListFormatter_create_or_with_length_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, int length);
+
+@_DiplomatFfiUse('icu4x_ListFormatter_create_unit_with_length_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_ListFormatter_create_unit_with_length_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ListFormatter_create_unit_with_length_mv1(ffi.Pointer<ffi.Opaque> locale, int length);
+
+@_DiplomatFfiUse('icu4x_ListFormatter_create_unit_with_length_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_ListFormatter_create_unit_with_length_and_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ListFormatter_create_unit_with_length_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, int length);
+
+@_DiplomatFfiUse('icu4x_ListFormatter_format_utf16_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceSliceUtf16, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ListFormatter_format_utf16_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_ListFormatter_format_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceSliceUtf16 list, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ListLength.g.dart b/pkgs/intl4x/lib/src/bindings/ListLength.g.dart
index bbadc44..886fa12 100644
--- a/pkgs/intl4x/lib/src/bindings/ListLength.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ListLength.g.dart
@@ -1,6 +1,17 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `ListLength`](https://docs.rs/icu/latest/icu/list/enum.ListLength.html) for more information.
-enum ListLength { wide, short, narrow }
+/// See the [Rust documentation for `ListLength`](https://docs.rs/icu/2.0.0/icu/list/options/enum.ListLength.html) for more information.
+enum ListLength {
+
+ wide,
+
+ short,
+
+ narrow;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Locale.g.dart b/pkgs/intl4x/lib/src/bindings/Locale.g.dart
index 474dced..cc1e0ef 100644
--- a/pkgs/intl4x/lib/src/bindings/Locale.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Locale.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X Locale, capable of representing strings like `"en-US"`.
///
-/// See the [Rust documentation for `Locale`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html) for more information.
+/// See the [Rust documentation for `Locale`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html) for more information.
final class Locale implements ffi.Finalizable, core.Comparable<Locale> {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,455 +23,288 @@
}
}
- @_DiplomatFfiUse('ICU4XLocale_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocale_destroy),
- );
+ @_DiplomatFfiUse('icu4x_Locale_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Locale_destroy_mv1));
- /// Construct an [`Locale`] from an locale identifier.
+ /// Construct an [Locale] from an locale identifier.
///
/// This will run the complete locale parsing algorithm. If code size and
/// performance are critical and the locale is of a known shape (such as
/// `aa-BB`) use `create_und`, `set_language`, `set_script`, and `set_region`.
///
- /// See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information.
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.try_from_str) for more information.
///
- /// Throws [Error] on failure.
+ /// Throws [LocaleParseError] on failure.
factory Locale.fromString(String name) {
- final temp = ffi2.Arena();
- final nameView = name.utf8View;
- final result = _ICU4XLocale_create_from_string(
- nameView.allocIn(temp),
- nameView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_Locale_from_string_mv1(name._utf8AllocIn(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw LocaleParseError.values[result.union.err];
}
return Locale._fromFfi(result.union.ok, []);
}
- /// Construct a default undefined [`Locale`] "und".
+ /// Construct a unknown [Locale] "und".
///
- /// See the [Rust documentation for `UND`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#associatedconstant.UND) for more information.
- factory Locale.und() {
- final result = _ICU4XLocale_create_und();
+ /// See the [Rust documentation for `UNKNOWN`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#associatedconstant.UNKNOWN) for more information.
+ factory Locale.unknown() {
+ final result = _icu4x_Locale_unknown_mv1();
return Locale._fromFfi(result, []);
}
- /// Clones the [`Locale`].
+ /// Clones the [Locale].
///
- /// See the [Rust documentation for `Locale`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html) for more information.
+ /// See the [Rust documentation for `Locale`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html) for more information.
Locale clone() {
- final result = _ICU4XLocale_clone(_ffi);
+ final result = _icu4x_Locale_clone_mv1(_ffi);
return Locale._fromFfi(result, []);
}
- /// Write a string representation of the `LanguageIdentifier` part of
- /// [`Locale`] to `write`.
+ /// Returns a string representation of the `LanguageIdentifier` part of
+ /// [Locale].
///
- /// See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `id`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#structfield.id) for more information.
String get basename {
- final writeable = _Writeable();
- final result = _ICU4XLocale_basename(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final write = _Write();
+ _icu4x_Locale_basename_mv1(_ffi, write._ffi);
+ return write.finalize();
}
- /// Write a string representation of the unicode extension to `write`
+ /// Returns a string representation of the unicode extension.
///
- /// See the [Rust documentation for `extensions`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.extensions) for more information.
- ///
- /// Throws [Error] on failure.
- String getUnicodeExtension(String bytes) {
- final temp = ffi2.Arena();
- final bytesView = bytes.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XLocale_get_unicode_extension(
- _ffi,
- bytesView.allocIn(temp),
- bytesView.length,
- writeable._ffi,
- );
- temp.releaseAll();
+ /// See the [Rust documentation for `extensions`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#structfield.extensions) for more information.
+ String? getUnicodeExtension(String s) {
+ final temp = _FinalizedArena();
+ final write = _Write();
+ final result = _icu4x_Locale_get_unicode_extension_mv1(_ffi, s._utf8AllocIn(temp.arena), write._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ return null;
}
- return writeable.finalize();
+ return write.finalize();
}
- /// Write a string representation of [`Locale`] language to `write`
+ /// Set a Unicode extension.
///
- /// See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information.
+ /// See the [Rust documentation for `extensions`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#structfield.extensions) for more information.
+ bool setUnicodeExtension(String k, String v) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Locale_set_unicode_extension_mv1(_ffi, k._utf8AllocIn(temp.arena), v._utf8AllocIn(temp.arena));
+ return result.isOk;
+ }
+
+ /// Returns a string representation of [Locale] language.
///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `id`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#structfield.id) for more information.
String get language {
- final writeable = _Writeable();
- final result = _ICU4XLocale_language(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final write = _Write();
+ _icu4x_Locale_language_mv1(_ffi, write._ffi);
+ return write.finalize();
}
- /// Set the language part of the [`Locale`].
+ /// Set the language part of the [Locale].
///
- /// See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information.
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.try_from_str) for more information.
///
- /// Throws [Error] on failure.
- set language(String bytes) {
- final temp = ffi2.Arena();
- final bytesView = bytes.utf8View;
- final result = _ICU4XLocale_set_language(
- _ffi,
- bytesView.allocIn(temp),
- bytesView.length,
- );
- temp.releaseAll();
+ /// Throws [LocaleParseError] on failure.
+ set language(String s) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Locale_set_language_mv1(_ffi, s._utf8AllocIn(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw LocaleParseError.values[result.union.err];
}
}
- /// Write a string representation of [`Locale`] region to `write`
+ /// Returns a string representation of [Locale] region.
///
- /// See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information.
- ///
- /// Throws [Error] on failure.
- String get region {
- final writeable = _Writeable();
- final result = _ICU4XLocale_region(_ffi, writeable._ffi);
+ /// See the [Rust documentation for `id`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#structfield.id) for more information.
+ String? get region {
+ final write = _Write();
+ final result = _icu4x_Locale_region_mv1(_ffi, write._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ return null;
}
- return writeable.finalize();
+ return write.finalize();
}
- /// Set the region part of the [`Locale`].
+ /// Set the region part of the [Locale].
///
- /// See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information.
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.try_from_str) for more information.
///
- /// Throws [Error] on failure.
- set region(String bytes) {
- final temp = ffi2.Arena();
- final bytesView = bytes.utf8View;
- final result = _ICU4XLocale_set_region(
- _ffi,
- bytesView.allocIn(temp),
- bytesView.length,
- );
- temp.releaseAll();
+ /// Throws [LocaleParseError] on failure.
+ void setRegion(String s) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Locale_set_region_mv1(_ffi, s._utf8AllocIn(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw LocaleParseError.values[result.union.err];
}
}
- /// Write a string representation of [`Locale`] script to `write`
+ /// Returns a string representation of [Locale] script.
///
- /// See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information.
- ///
- /// Throws [Error] on failure.
- String get script {
- final writeable = _Writeable();
- final result = _ICU4XLocale_script(_ffi, writeable._ffi);
+ /// See the [Rust documentation for `id`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#structfield.id) for more information.
+ String? get script {
+ final write = _Write();
+ final result = _icu4x_Locale_script_mv1(_ffi, write._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ return null;
}
- return writeable.finalize();
+ return write.finalize();
}
- /// Set the script part of the [`Locale`]. Pass an empty string to remove the script.
+ /// Set the script part of the [Locale]. Pass an empty string to remove the script.
///
- /// See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information.
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.try_from_str) for more information.
///
- /// Throws [Error] on failure.
- set script(String bytes) {
- final temp = ffi2.Arena();
- final bytesView = bytes.utf8View;
- final result = _ICU4XLocale_set_script(
- _ffi,
- bytesView.allocIn(temp),
- bytesView.length,
- );
- temp.releaseAll();
+ /// Throws [LocaleParseError] on failure.
+ void setScript(String s) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Locale_set_script_mv1(_ffi, s._utf8AllocIn(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw LocaleParseError.values[result.union.err];
}
}
- /// Best effort locale canonicalizer that doesn't need any data
+ /// Normalizes a locale string.
///
- /// Use ICU4XLocaleCanonicalizer for better control and functionality
+ /// See the [Rust documentation for `normalize`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.normalize) for more information.
///
- /// See the [Rust documentation for `canonicalize`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.canonicalize) for more information.
- ///
- /// Throws [Error] on failure.
- static String canonicalize(String bytes) {
- final temp = ffi2.Arena();
- final bytesView = bytes.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XLocale_canonicalize(
- bytesView.allocIn(temp),
- bytesView.length,
- writeable._ffi,
- );
- temp.releaseAll();
+ /// Throws [LocaleParseError] on failure.
+ static String normalize(String s) {
+ final temp = _FinalizedArena();
+ final write = _Write();
+ final result = _icu4x_Locale_normalize_mv1(s._utf8AllocIn(temp.arena), write._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw LocaleParseError.values[result.union.err];
}
- return writeable.finalize();
+ return write.finalize();
}
- /// Write a string representation of [`Locale`] to `write`
+ /// Returns a string representation of [Locale].
///
- /// See the [Rust documentation for `write_to`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.write_to) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `write_to`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.write_to) for more information.
@override
String toString() {
- final writeable = _Writeable();
- final result = _ICU4XLocale_to_string(_ffi, writeable._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final write = _Write();
+ _icu4x_Locale_to_string_mv1(_ffi, write._ffi);
+ return write.finalize();
}
- /// See the [Rust documentation for `normalizing_eq`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.normalizing_eq) for more information.
+ /// See the [Rust documentation for `normalizing_eq`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.normalizing_eq) for more information.
bool normalizingEq(String other) {
- final temp = ffi2.Arena();
- final otherView = other.utf8View;
- final result = _ICU4XLocale_normalizing_eq(
- _ffi,
- otherView.allocIn(temp),
- otherView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_Locale_normalizing_eq_mv1(_ffi, other._utf8AllocIn(temp.arena));
return result;
}
- /// See the [Rust documentation for `strict_cmp`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.strict_cmp) for more information.
+ /// See the [Rust documentation for `strict_cmp`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.strict_cmp) for more information.
int compareToString(String other) {
- final temp = ffi2.Arena();
- final otherView = other.utf8View;
- final result = _ICU4XLocale_strict_cmp_(
- _ffi,
- otherView.allocIn(temp),
- otherView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_Locale_compare_to_string_mv1(_ffi, other._utf8AllocIn(temp.arena));
return result;
}
- /// See the [Rust documentation for `total_cmp`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.total_cmp) for more information.
+ /// See the [Rust documentation for `total_cmp`](https://docs.rs/icu/2.0.0/icu/locale/struct.Locale.html#method.total_cmp) for more information.
@override
int compareTo(Locale other) {
- final result = _ICU4XLocale_total_cmp_(_ffi, other._ffi);
+ final result = _icu4x_Locale_compare_to_mv1(_ffi, other._ffi);
return result;
}
+
@override
bool operator ==(Object other) => other is Locale && compareTo(other) == 0;
@override
int get hashCode => 42; // Cannot get hash from Rust, so a constant is the only correct impl
}
-@_DiplomatFfiUse('ICU4XLocale_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocale_destroy',
-)
+@_DiplomatFfiUse('icu4x_Locale_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Locale_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocale_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_Locale_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocale_create_from_string')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XLocale_create_from_string',
-)
+@_DiplomatFfiUse('icu4x_Locale_from_string_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Locale_from_string_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocale_create_from_string(
- ffi.Pointer<ffi.Uint8> nameData,
- int nameLength,
-);
+external _ResultOpaqueInt32 _icu4x_Locale_from_string_mv1(_SliceUtf8 name);
-@_DiplomatFfiUse('ICU4XLocale_create_und')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XLocale_create_und',
-)
+@_DiplomatFfiUse('icu4x_Locale_unknown_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_Locale_unknown_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XLocale_create_und();
+external ffi.Pointer<ffi.Opaque> _icu4x_Locale_unknown_mv1();
-@_DiplomatFfiUse('ICU4XLocale_clone')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocale_clone',
-)
+@_DiplomatFfiUse('icu4x_Locale_clone_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_clone_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XLocale_clone(
- ffi.Pointer<ffi.Opaque> self,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_Locale_clone_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XLocale_basename')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocale_basename')
+@_DiplomatFfiUse('icu4x_Locale_basename_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_basename_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_basename(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external void _icu4x_Locale_basename_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XLocale_get_unicode_extension')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XLocale_get_unicode_extension')
+@_DiplomatFfiUse('icu4x_Locale_get_unicode_extension_mv1')
+@ffi.Native<_ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_get_unicode_extension_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_get_unicode_extension(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> bytesData,
- int bytesLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultVoidVoid _icu4x_Locale_get_unicode_extension_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XLocale_language')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocale_language')
+@_DiplomatFfiUse('icu4x_Locale_set_unicode_extension_mv1')
+@ffi.Native<_ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Locale_set_unicode_extension_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_language(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultVoidVoid _icu4x_Locale_set_unicode_extension_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 k, _SliceUtf8 v);
-@_DiplomatFfiUse('ICU4XLocale_set_language')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XLocale_set_language')
+@_DiplomatFfiUse('icu4x_Locale_language_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_language_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_set_language(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> bytesData,
- int bytesLength,
-);
+external void _icu4x_Locale_language_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XLocale_region')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocale_region')
+@_DiplomatFfiUse('icu4x_Locale_set_language_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Locale_set_language_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_region(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultVoidInt32 _icu4x_Locale_set_language_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s);
-@_DiplomatFfiUse('ICU4XLocale_set_region')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XLocale_set_region')
+@_DiplomatFfiUse('icu4x_Locale_region_mv1')
+@ffi.Native<_ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_region_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_set_region(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> bytesData,
- int bytesLength,
-);
+external _ResultVoidVoid _icu4x_Locale_region_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XLocale_script')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocale_script')
+@_DiplomatFfiUse('icu4x_Locale_set_region_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Locale_set_region_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_script(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultVoidInt32 _icu4x_Locale_set_region_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s);
-@_DiplomatFfiUse('ICU4XLocale_set_script')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XLocale_set_script')
+@_DiplomatFfiUse('icu4x_Locale_script_mv1')
+@ffi.Native<_ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_script_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_set_script(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> bytesData,
- int bytesLength,
-);
+external _ResultVoidVoid _icu4x_Locale_script_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XLocale_canonicalize')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XLocale_canonicalize')
+@_DiplomatFfiUse('icu4x_Locale_set_script_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Locale_set_script_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_canonicalize(
- ffi.Pointer<ffi.Uint8> bytesData,
- int bytesLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultVoidInt32 _icu4x_Locale_set_script_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s);
-@_DiplomatFfiUse('ICU4XLocale_to_string')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocale_to_string')
+@_DiplomatFfiUse('icu4x_Locale_normalize_mv1')
+@ffi.Native<_ResultVoidInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_normalize_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocale_to_string(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultVoidInt32 _icu4x_Locale_normalize_mv1(_SliceUtf8 s, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XLocale_normalizing_eq')
-@ffi.Native<
- ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XLocale_normalizing_eq')
+@_DiplomatFfiUse('icu4x_Locale_to_string_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_to_string_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XLocale_normalizing_eq(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> otherData,
- int otherLength,
-);
+external void _icu4x_Locale_to_string_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XLocale_strict_cmp_')
-@ffi.Native<
- ffi.Int8 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XLocale_strict_cmp_')
+@_DiplomatFfiUse('icu4x_Locale_normalizing_eq_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Locale_normalizing_eq_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLocale_strict_cmp_(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> otherData,
- int otherLength,
-);
+external bool _icu4x_Locale_normalizing_eq_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 other);
-@_DiplomatFfiUse('ICU4XLocale_total_cmp_')
-@ffi.Native<
- ffi.Int8 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocale_total_cmp_')
+@_DiplomatFfiUse('icu4x_Locale_compare_to_string_mv1')
+@ffi.Native<ffi.Int8 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Locale_compare_to_string_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLocale_total_cmp_(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> other,
-);
+external int _icu4x_Locale_compare_to_string_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 other);
+
+@_DiplomatFfiUse('icu4x_Locale_compare_to_mv1')
+@ffi.Native<ffi.Int8 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Locale_compare_to_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Locale_compare_to_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleCanonicalizer.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleCanonicalizer.g.dart
index 951868a..e48047f 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleCanonicalizer.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleCanonicalizer.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// A locale canonicalizer.
///
-/// See the [Rust documentation for `LocaleCanonicalizer`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html) for more information.
+/// See the [Rust documentation for `LocaleCanonicalizer`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleCanonicalizer.html) for more information.
final class LocaleCanonicalizer implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,78 +23,87 @@
}
}
- @_DiplomatFfiUse('ICU4XLocaleCanonicalizer_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocaleCanonicalizer_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LocaleCanonicalizer_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LocaleCanonicalizer_destroy_mv1));
- /// Create a new [`LocaleCanonicalizer`].
+ /// Create a new [LocaleCanonicalizer] using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.new) for more information.
+ /// See the [Rust documentation for `new_common`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleCanonicalizer.html#method.new_common) for more information.
+ factory LocaleCanonicalizer() {
+ final result = _icu4x_LocaleCanonicalizer_create_common_mv1();
+ return LocaleCanonicalizer._fromFfi(result, []);
+ }
+
+ /// Create a new [LocaleCanonicalizer].
///
- /// Throws [Error] on failure.
- factory LocaleCanonicalizer(DataProvider provider) {
- final result = _ICU4XLocaleCanonicalizer_create(provider._ffi);
+ /// See the [Rust documentation for `new_common`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleCanonicalizer.html#method.new_common) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LocaleCanonicalizer.withProvider(DataProvider provider) {
+ final result = _icu4x_LocaleCanonicalizer_create_common_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LocaleCanonicalizer._fromFfi(result.union.ok, []);
}
- /// Create a new [`LocaleCanonicalizer`] with extended data.
+ /// Create a new [LocaleCanonicalizer] with extended data using compiled data.
///
- /// See the [Rust documentation for `new_with_expander`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.new_with_expander) for more information.
+ /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleCanonicalizer.html#method.new_extended) for more information.
+ factory LocaleCanonicalizer.extended() {
+ final result = _icu4x_LocaleCanonicalizer_create_extended_mv1();
+ return LocaleCanonicalizer._fromFfi(result, []);
+ }
+
+ /// Create a new [LocaleCanonicalizer] with extended data.
///
- /// Throws [Error] on failure.
- factory LocaleCanonicalizer.extended(DataProvider provider) {
- final result = _ICU4XLocaleCanonicalizer_create_extended(provider._ffi);
+ /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleCanonicalizer.html#method.new_extended) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LocaleCanonicalizer.extendedWithProvider(DataProvider provider) {
+ final result = _icu4x_LocaleCanonicalizer_create_extended_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LocaleCanonicalizer._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `canonicalize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.canonicalize) for more information.
+ /// See the [Rust documentation for `canonicalize`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleCanonicalizer.html#method.canonicalize) for more information.
TransformResult canonicalize(Locale locale) {
- final result = _ICU4XLocaleCanonicalizer_canonicalize(_ffi, locale._ffi);
+ final result = _icu4x_LocaleCanonicalizer_canonicalize_mv1(_ffi, locale._ffi);
return TransformResult.values[result];
}
+
}
-@_DiplomatFfiUse('ICU4XLocaleCanonicalizer_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleCanonicalizer_destroy',
-)
+@_DiplomatFfiUse('icu4x_LocaleCanonicalizer_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LocaleCanonicalizer_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocaleCanonicalizer_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LocaleCanonicalizer_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocaleCanonicalizer_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleCanonicalizer_create',
-)
+@_DiplomatFfiUse('icu4x_LocaleCanonicalizer_create_common_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleCanonicalizer_create_common_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleCanonicalizer_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleCanonicalizer_create_common_mv1();
-@_DiplomatFfiUse('ICU4XLocaleCanonicalizer_create_extended')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleCanonicalizer_create_extended',
-)
+@_DiplomatFfiUse('icu4x_LocaleCanonicalizer_create_common_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleCanonicalizer_create_common_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleCanonicalizer_create_extended(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_LocaleCanonicalizer_create_common_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XLocaleCanonicalizer_canonicalize')
-@ffi.Native<
- ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleCanonicalizer_canonicalize')
+@_DiplomatFfiUse('icu4x_LocaleCanonicalizer_create_extended_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleCanonicalizer_create_extended_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLocaleCanonicalizer_canonicalize(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleCanonicalizer_create_extended_mv1();
+
+@_DiplomatFfiUse('icu4x_LocaleCanonicalizer_create_extended_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleCanonicalizer_create_extended_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_LocaleCanonicalizer_create_extended_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_LocaleCanonicalizer_canonicalize_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleCanonicalizer_canonicalize_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_LocaleCanonicalizer_canonicalize_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleDirection.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleDirection.g.dart
index 7117b5f..823d54d 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleDirection.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleDirection.g.dart
@@ -1,6 +1,17 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `Direction`](https://docs.rs/icu/latest/icu/locid_transform/enum.Direction.html) for more information.
-enum LocaleDirection { leftToRight, rightToLeft, unknown }
+/// See the [Rust documentation for `Direction`](https://docs.rs/icu/2.0.0/icu/locale/enum.Direction.html) for more information.
+enum LocaleDirection {
+
+ leftToRight,
+
+ rightToLeft,
+
+ unknown;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleDirectionality.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleDirectionality.g.dart
index 585c840..ff36048 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleDirectionality.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleDirectionality.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LocaleDirectionality`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html) for more information.
+/// See the [Rust documentation for `LocaleDirectionality`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html) for more information.
final class LocaleDirectionality implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,122 +21,109 @@
}
}
- @_DiplomatFfiUse('ICU4XLocaleDirectionality_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocaleDirectionality_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LocaleDirectionality_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LocaleDirectionality_destroy_mv1));
- /// Construct a new ICU4XLocaleDirectionality instance
+ /// Construct a new LocaleDirectionality instance using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.new) for more information.
+ /// See the [Rust documentation for `new_common`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html#method.new_common) for more information.
+ factory LocaleDirectionality() {
+ final result = _icu4x_LocaleDirectionality_create_common_mv1();
+ return LocaleDirectionality._fromFfi(result, []);
+ }
+
+ /// Construct a new LocaleDirectionality instance using a particular data source.
///
- /// Throws [Error] on failure.
- factory LocaleDirectionality(DataProvider provider) {
- final result = _ICU4XLocaleDirectionality_create(provider._ffi);
+ /// See the [Rust documentation for `new_common`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html#method.new_common) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LocaleDirectionality.withProvider(DataProvider provider) {
+ final result = _icu4x_LocaleDirectionality_create_common_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LocaleDirectionality._fromFfi(result.union.ok, []);
}
- /// Construct a new ICU4XLocaleDirectionality instance with a custom expander
+ /// Construct a new LocaleDirectionality instance using compiled data.
///
- /// See the [Rust documentation for `new_with_expander`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.new_with_expander) for more information.
+ /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html#method.new_extended) for more information.
+ factory LocaleDirectionality.extended() {
+ final result = _icu4x_LocaleDirectionality_create_extended_mv1();
+ return LocaleDirectionality._fromFfi(result, []);
+ }
+
+ /// Construct a new LocaleDirectionality instance using a particular data source.
///
- /// Throws [Error] on failure.
- factory LocaleDirectionality.withExpander(
- DataProvider provider,
- LocaleExpander expander,
- ) {
- final result = _ICU4XLocaleDirectionality_create_with_expander(
- provider._ffi,
- expander._ffi,
- );
+ /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html#method.new_extended) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LocaleDirectionality.extendedWithProvider(DataProvider provider) {
+ final result = _icu4x_LocaleDirectionality_create_extended_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LocaleDirectionality._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.get) for more information.
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html#method.get) for more information.
LocaleDirection operator [](Locale locale) {
- final result = _ICU4XLocaleDirectionality_get(_ffi, locale._ffi);
+ final result = _icu4x_LocaleDirectionality_get_mv1(_ffi, locale._ffi);
return LocaleDirection.values[result];
}
- /// See the [Rust documentation for `is_left_to_right`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.is_left_to_right) for more information.
+ /// See the [Rust documentation for `is_left_to_right`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html#method.is_left_to_right) for more information.
bool isLeftToRight(Locale locale) {
- final result = _ICU4XLocaleDirectionality_is_left_to_right(
- _ffi,
- locale._ffi,
- );
+ final result = _icu4x_LocaleDirectionality_is_left_to_right_mv1(_ffi, locale._ffi);
return result;
}
- /// See the [Rust documentation for `is_right_to_left`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.is_right_to_left) for more information.
+ /// See the [Rust documentation for `is_right_to_left`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleDirectionality.html#method.is_right_to_left) for more information.
bool isRightToLeft(Locale locale) {
- final result = _ICU4XLocaleDirectionality_is_right_to_left(
- _ffi,
- locale._ffi,
- );
+ final result = _icu4x_LocaleDirectionality_is_right_to_left_mv1(_ffi, locale._ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XLocaleDirectionality_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleDirectionality_destroy',
-)
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocaleDirectionality_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LocaleDirectionality_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocaleDirectionality_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleDirectionality_create',
-)
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_create_common_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_create_common_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleDirectionality_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleDirectionality_create_common_mv1();
-@_DiplomatFfiUse('ICU4XLocaleDirectionality_create_with_expander')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_create_with_expander')
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_create_common_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_create_common_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleDirectionality_create_with_expander(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> expander,
-);
+external _ResultOpaqueInt32 _icu4x_LocaleDirectionality_create_common_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XLocaleDirectionality_get')
-@ffi.Native<
- ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_get')
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_create_extended_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_create_extended_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLocaleDirectionality_get(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleDirectionality_create_extended_mv1();
-@_DiplomatFfiUse('ICU4XLocaleDirectionality_is_left_to_right')
-@ffi.Native<
- ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_is_left_to_right')
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_create_extended_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_create_extended_with_provider_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XLocaleDirectionality_is_left_to_right(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external _ResultOpaqueInt32 _icu4x_LocaleDirectionality_create_extended_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XLocaleDirectionality_is_right_to_left')
-@ffi.Native<
- ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_is_right_to_left')
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_get_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_get_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XLocaleDirectionality_is_right_to_left(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external int _icu4x_LocaleDirectionality_get_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_is_left_to_right_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_is_left_to_right_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_LocaleDirectionality_is_left_to_right_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_LocaleDirectionality_is_right_to_left_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleDirectionality_is_right_to_left_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_LocaleDirectionality_is_right_to_left_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleDisplayNamesFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleDisplayNamesFormatter.g.dart
index 8229529..0cbf5b8 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleDisplayNamesFormatter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleDisplayNamesFormatter.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `LocaleDisplayNamesFormatter`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html) for more information.
+/// See the [Rust documentation for `LocaleDisplayNamesFormatter`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.LocaleDisplayNamesFormatter.html) for more information.
final class LocaleDisplayNamesFormatter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,89 +21,66 @@
}
}
- @_DiplomatFfiUse('ICU4XLocaleDisplayNamesFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocaleDisplayNamesFormatter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LocaleDisplayNamesFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LocaleDisplayNamesFormatter_destroy_mv1));
- /// Creates a new `LocaleDisplayNamesFormatter` from locale data and an options bag.
+ /// Creates a new `LocaleDisplayNamesFormatter` from locale data and an options bag using compiled data.
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.try_new) for more information.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.LocaleDisplayNamesFormatter.html#method.try_new) for more information.
///
- /// Throws [Error] on failure.
- factory LocaleDisplayNamesFormatter(
- DataProvider provider,
- Locale locale,
- DisplayNamesOptions options,
- ) {
- final temp = ffi2.Arena();
- final result = _ICU4XLocaleDisplayNamesFormatter_create(
- provider._ffi,
- locale._ffi,
- options._toFfi(temp),
- );
- temp.releaseAll();
+ /// Throws [DataError] on failure.
+ factory LocaleDisplayNamesFormatter(Locale locale, DisplayNamesOptions options) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LocaleDisplayNamesFormatter_create_v1_mv1(locale._ffi, options._toFfi(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return LocaleDisplayNamesFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new `LocaleDisplayNamesFormatter` from locale data and an options bag using a particular data source.
+ ///
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.LocaleDisplayNamesFormatter.html#method.try_new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LocaleDisplayNamesFormatter.createWithProvider(DataProvider provider, Locale locale, DisplayNamesOptions options) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_LocaleDisplayNamesFormatter_create_v1_with_provider_mv1(provider._ffi, locale._ffi, options._toFfi(temp.arena));
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return LocaleDisplayNamesFormatter._fromFfi(result.union.ok, []);
}
/// Returns the locale-specific display name of a locale.
///
- /// See the [Rust documentation for `of`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.of) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `of`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.LocaleDisplayNamesFormatter.html#method.of) for more information.
String of(Locale locale) {
- final writeable = _Writeable();
- final result = _ICU4XLocaleDisplayNamesFormatter_of(
- _ffi,
- locale._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final write = _Write();
+ _icu4x_LocaleDisplayNamesFormatter_of_mv1(_ffi, locale._ffi, write._ffi);
+ return write.finalize();
}
+
}
-@_DiplomatFfiUse('ICU4XLocaleDisplayNamesFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleDisplayNamesFormatter_destroy',
-)
+@_DiplomatFfiUse('icu4x_LocaleDisplayNamesFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LocaleDisplayNamesFormatter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocaleDisplayNamesFormatter_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_LocaleDisplayNamesFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocaleDisplayNamesFormatter_create')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- _DisplayNamesOptionsFfi,
- )
->(isLeaf: true, symbol: 'ICU4XLocaleDisplayNamesFormatter_create')
+@_DiplomatFfiUse('icu4x_LocaleDisplayNamesFormatter_create_v1_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _DisplayNamesOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LocaleDisplayNamesFormatter_create_v1_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleDisplayNamesFormatter_create(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- _DisplayNamesOptionsFfi options,
-);
+external _ResultOpaqueInt32 _icu4x_LocaleDisplayNamesFormatter_create_v1_mv1(ffi.Pointer<ffi.Opaque> locale, _DisplayNamesOptionsFfi options);
-@_DiplomatFfiUse('ICU4XLocaleDisplayNamesFormatter_of')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XLocaleDisplayNamesFormatter_of')
+@_DiplomatFfiUse('icu4x_LocaleDisplayNamesFormatter_create_v1_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _DisplayNamesOptionsFfi)>(isLeaf: true, symbol: 'icu4x_LocaleDisplayNamesFormatter_create_v1_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XLocaleDisplayNamesFormatter_of(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_LocaleDisplayNamesFormatter_create_v1_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _DisplayNamesOptionsFfi options);
+
+@_DiplomatFfiUse('icu4x_LocaleDisplayNamesFormatter_of_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleDisplayNamesFormatter_of_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_LocaleDisplayNamesFormatter_of_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleExpander.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleExpander.g.dart
index b1a7eb8..eb0c4ed 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleExpander.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleExpander.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// A locale expander.
///
-/// See the [Rust documentation for `LocaleExpander`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html) for more information.
+/// See the [Rust documentation for `LocaleExpander`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html) for more information.
final class LocaleExpander implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,113 +23,109 @@
}
}
- @_DiplomatFfiUse('ICU4XLocaleExpander_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocaleExpander_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LocaleExpander_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LocaleExpander_destroy_mv1));
- /// Create a new [`LocaleExpander`].
+ /// Create a new [LocaleExpander] using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.new) for more information.
+ /// See the [Rust documentation for `new_common`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html#method.new_common) for more information.
+ factory LocaleExpander() {
+ final result = _icu4x_LocaleExpander_create_common_mv1();
+ return LocaleExpander._fromFfi(result, []);
+ }
+
+ /// Create a new [LocaleExpander] using a new_common data source.
///
- /// Throws [Error] on failure.
- factory LocaleExpander(DataProvider provider) {
- final result = _ICU4XLocaleExpander_create(provider._ffi);
+ /// See the [Rust documentation for `new_common`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html#method.new_common) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LocaleExpander.withProvider(DataProvider provider) {
+ final result = _icu4x_LocaleExpander_create_common_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LocaleExpander._fromFfi(result.union.ok, []);
}
- /// Create a new [`LocaleExpander`] with extended data.
+ /// Create a new [LocaleExpander] with extended data using compiled data.
///
- /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.new_extended) for more information.
+ /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html#method.new_extended) for more information.
+ factory LocaleExpander.extended() {
+ final result = _icu4x_LocaleExpander_create_extended_mv1();
+ return LocaleExpander._fromFfi(result, []);
+ }
+
+ /// Create a new [LocaleExpander] with extended data using a particular data source.
///
- /// Throws [Error] on failure.
- factory LocaleExpander.extended(DataProvider provider) {
- final result = _ICU4XLocaleExpander_create_extended(provider._ffi);
+ /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html#method.new_extended) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory LocaleExpander.extendedWithProvider(DataProvider provider) {
+ final result = _icu4x_LocaleExpander_create_extended_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LocaleExpander._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `maximize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.maximize) for more information.
+ /// See the [Rust documentation for `maximize`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html#method.maximize) for more information.
TransformResult maximize(Locale locale) {
- final result = _ICU4XLocaleExpander_maximize(_ffi, locale._ffi);
+ final result = _icu4x_LocaleExpander_maximize_mv1(_ffi, locale._ffi);
return TransformResult.values[result];
}
- /// See the [Rust documentation for `minimize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.minimize) for more information.
+ /// See the [Rust documentation for `minimize`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html#method.minimize) for more information.
TransformResult minimize(Locale locale) {
- final result = _ICU4XLocaleExpander_minimize(_ffi, locale._ffi);
+ final result = _icu4x_LocaleExpander_minimize_mv1(_ffi, locale._ffi);
return TransformResult.values[result];
}
- /// See the [Rust documentation for `minimize_favor_script`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.minimize_favor_script) for more information.
+ /// See the [Rust documentation for `minimize_favor_script`](https://docs.rs/icu/2.0.0/icu/locale/struct.LocaleExpander.html#method.minimize_favor_script) for more information.
TransformResult minimizeFavorScript(Locale locale) {
- final result = _ICU4XLocaleExpander_minimize_favor_script(
- _ffi,
- locale._ffi,
- );
+ final result = _icu4x_LocaleExpander_minimize_favor_script_mv1(_ffi, locale._ffi);
return TransformResult.values[result];
}
+
}
-@_DiplomatFfiUse('ICU4XLocaleExpander_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleExpander_destroy',
-)
+@_DiplomatFfiUse('icu4x_LocaleExpander_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LocaleExpander_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocaleExpander_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LocaleExpander_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocaleExpander_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleExpander_create',
-)
+@_DiplomatFfiUse('icu4x_LocaleExpander_create_common_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleExpander_create_common_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleExpander_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleExpander_create_common_mv1();
-@_DiplomatFfiUse('ICU4XLocaleExpander_create_extended')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleExpander_create_extended',
-)
+@_DiplomatFfiUse('icu4x_LocaleExpander_create_common_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleExpander_create_common_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleExpander_create_extended(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_LocaleExpander_create_common_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XLocaleExpander_maximize')
-@ffi.Native<
- ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleExpander_maximize')
+@_DiplomatFfiUse('icu4x_LocaleExpander_create_extended_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleExpander_create_extended_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLocaleExpander_maximize(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleExpander_create_extended_mv1();
-@_DiplomatFfiUse('ICU4XLocaleExpander_minimize')
-@ffi.Native<
- ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleExpander_minimize')
+@_DiplomatFfiUse('icu4x_LocaleExpander_create_extended_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleExpander_create_extended_with_provider_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLocaleExpander_minimize(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external _ResultOpaqueInt32 _icu4x_LocaleExpander_create_extended_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XLocaleExpander_minimize_favor_script')
-@ffi.Native<
- ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XLocaleExpander_minimize_favor_script')
+@_DiplomatFfiUse('icu4x_LocaleExpander_maximize_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleExpander_maximize_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XLocaleExpander_minimize_favor_script(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external int _icu4x_LocaleExpander_maximize_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_LocaleExpander_minimize_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleExpander_minimize_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_LocaleExpander_minimize_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_LocaleExpander_minimize_favor_script_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleExpander_minimize_favor_script_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_LocaleExpander_minimize_favor_script_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleFallbackConfig.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleFallbackConfig.g.dart
index 3dd14c7..fbc089a 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleFallbackConfig.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleFallbackConfig.g.dart
@@ -1,76 +1,47 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
final class _LocaleFallbackConfigFfi extends ffi.Struct {
@ffi.Int32()
external int priority;
- external _SliceUtf8 extensionKey;
- @ffi.Int32()
- external int fallbackSupplement;
}
/// Collection of configurations for the ICU4X fallback algorithm.
///
-/// See the [Rust documentation for `LocaleFallbackConfig`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbackConfig.html) for more information.
+/// See the [Rust documentation for `LocaleFallbackConfig`](https://docs.rs/icu/2.0.0/icu/locale/fallback/struct.LocaleFallbackConfig.html) for more information.
final class LocaleFallbackConfig {
LocaleFallbackPriority priority;
- String extensionKey;
- LocaleFallbackSupplement fallbackSupplement;
- LocaleFallbackConfig({
- required this.priority,
- required this.extensionKey,
- required this.fallbackSupplement,
- });
+ LocaleFallbackConfig({required this.priority});
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ LocaleFallbackConfig._fromFfi(_LocaleFallbackConfigFfi ffi) :
+ priority = LocaleFallbackPriority.values[ffi.priority];
// ignore: unused_element
- LocaleFallbackConfig._fromFfi(
- _LocaleFallbackConfigFfi ffi,
- core.List<Object> aEdges,
- ) : priority = LocaleFallbackPriority.values[ffi.priority],
- extensionKey = ffi.extensionKey._toDart(aEdges),
- fallbackSupplement =
- LocaleFallbackSupplement.values[ffi.fallbackSupplement];
-
- // If this struct contains any slices, their lifetime-edge-relevant objects (typically _FinalizedArenas) will only
- // be constructed here, and can be appended to any relevant lifetime arrays here. <lifetime>AppendArray accepts a list
- // of arrays for each lifetime to do so. It accepts multiple lists per lifetime in case the caller needs to tie a lifetime to multiple
- // output arrays. Null is equivalent to an empty list: this lifetime is not being borrowed from.
- // ignore: unused_element
- _LocaleFallbackConfigFfi _toFfi(
- ffi.Allocator temp, {
- core.List<core.List<Object>> aAppendArray = const [],
- }) {
+ _LocaleFallbackConfigFfi _toFfi(ffi.Allocator temp) {
final struct = ffi.Struct.create<_LocaleFallbackConfigFfi>();
struct.priority = priority.index;
- final extensionKeyView = extensionKey.utf8View;
- struct.extensionKey._length = extensionKeyView.length;
- struct.extensionKey._data = extensionKeyView.allocIn(
- aAppendArray.isNotEmpty
- ? _FinalizedArena.withLifetime(aAppendArray).arena
- : temp,
- );
- struct.fallbackSupplement = fallbackSupplement.index;
return struct;
}
+
@override
bool operator ==(Object other) =>
other is LocaleFallbackConfig &&
- other.priority == priority &&
- other.extensionKey == extensionKey &&
- other.fallbackSupplement == fallbackSupplement;
+ other.priority == priority;
@override
- int get hashCode =>
- Object.hashAll([priority, extensionKey, fallbackSupplement]);
-
- // Return all fields corresponding to lifetime `'a`
- // without handling lifetime dependencies (this is the job of the caller)
- // This is all fields that may be borrowed from if borrowing `'a`,
- // assuming that there are no `'other: a`. bounds. In case of such bounds,
- // the caller should take care to also call _fieldsForLifetimeOther
- // ignore: unused_element
- core.List<Object> get _fieldsForLifetimeA => [extensionKey];
+ int get hashCode => Object.hashAll([
+ priority,
+ ]);
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleFallbackIterator.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleFallbackIterator.g.dart
index 142e0cf..abbb6f1 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleFallbackIterator.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleFallbackIterator.g.dart
@@ -1,12 +1,12 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An iterator over the locale under fallback.
///
-/// See the [Rust documentation for `LocaleFallbackIterator`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbackIterator.html) for more information.
-final class LocaleFallbackIterator
- implements ffi.Finalizable, core.Iterator<Locale> {
+/// See the [Rust documentation for `LocaleFallbackIterator`](https://docs.rs/icu/2.0.0/icu/locale/fallback/struct.LocaleFallbackIterator.html) for more information.
+final class LocaleFallbackIterator implements ffi.Finalizable, core.Iterator<Locale> {
final ffi.Pointer<ffi.Opaque> _ffi;
// These are "used" in the sense that they keep dependencies alive
@@ -25,10 +25,8 @@
}
}
- @_DiplomatFfiUse('ICU4XLocaleFallbackIterator_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocaleFallbackIterator_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LocaleFallbackIterator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LocaleFallbackIterator_destroy_mv1));
Locale? _current;
@@ -41,28 +39,21 @@
return _current != null;
}
- /// A combination of `get` and `step`. Returns the value that `get` would return
- /// and advances the iterator until hitting `und`.
Locale? _iteratorNext() {
- final result = _ICU4XLocaleFallbackIterator_next(_ffi);
+ final result = _icu4x_LocaleFallbackIterator_next_mv1(_ffi);
return result.address == 0 ? null : Locale._fromFfi(result, []);
}
+
}
-@_DiplomatFfiUse('ICU4XLocaleFallbackIterator_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleFallbackIterator_destroy',
-)
+@_DiplomatFfiUse('icu4x_LocaleFallbackIterator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LocaleFallbackIterator_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocaleFallbackIterator_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LocaleFallbackIterator_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocaleFallbackIterator_next')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleFallbackIterator_next',
-)
+@_DiplomatFfiUse('icu4x_LocaleFallbackIterator_next_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleFallbackIterator_next_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XLocaleFallbackIterator_next(
- ffi.Pointer<ffi.Opaque> self,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleFallbackIterator_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleFallbackPriority.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleFallbackPriority.g.dart
index 5ae3f24..3373f84 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleFallbackPriority.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleFallbackPriority.g.dart
@@ -1,8 +1,17 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// Priority mode for the ICU4X fallback algorithm.
///
-/// See the [Rust documentation for `LocaleFallbackPriority`](https://docs.rs/icu/latest/icu/locid_transform/fallback/enum.LocaleFallbackPriority.html) for more information.
-enum LocaleFallbackPriority { language, region, collation }
+/// See the [Rust documentation for `LocaleFallbackPriority`](https://docs.rs/icu/2.0.0/icu/locale/fallback/enum.LocaleFallbackPriority.html) for more information.
+enum LocaleFallbackPriority {
+
+ language,
+
+ region;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleFallbackSupplement.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleFallbackSupplement.g.dart
deleted file mode 100644
index 6ee7014..0000000
--- a/pkgs/intl4x/lib/src/bindings/LocaleFallbackSupplement.g.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// What additional data is required to load when performing fallback.
-///
-/// See the [Rust documentation for `LocaleFallbackSupplement`](https://docs.rs/icu/latest/icu/locid_transform/fallback/enum.LocaleFallbackSupplement.html) for more information.
-enum LocaleFallbackSupplement { none, collation }
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleFallbacker.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleFallbacker.g.dart
index be43145..0503f21 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleFallbacker.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleFallbacker.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An object that runs the ICU4X locale fallback algorithm.
///
-/// See the [Rust documentation for `LocaleFallbacker`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html) for more information.
+/// See the [Rust documentation for `LocaleFallbacker`](https://docs.rs/icu_locale/2.0.0/icu_locale/struct.LocaleFallbacker.html) for more information.
final class LocaleFallbacker implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,82 +23,74 @@
}
}
- @_DiplomatFfiUse('ICU4XLocaleFallbacker_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocaleFallbacker_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LocaleFallbacker_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LocaleFallbacker_destroy_mv1));
+
+ /// Creates a new `LocaleFallbacker` from compiled data.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu_locale/2.0.0/icu_locale/struct.LocaleFallbacker.html#method.new) for more information.
+ factory LocaleFallbacker() {
+ final result = _icu4x_LocaleFallbacker_create_mv1();
+ return LocaleFallbacker._fromFfi(result, []);
+ }
/// Creates a new `LocaleFallbacker` from a data provider.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu_locale/2.0.0/icu_locale/struct.LocaleFallbacker.html#method.new) for more information.
///
- /// Throws [Error] on failure.
- factory LocaleFallbacker(DataProvider provider) {
- final result = _ICU4XLocaleFallbacker_create(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory LocaleFallbacker.withProvider(DataProvider provider) {
+ final result = _icu4x_LocaleFallbacker_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return LocaleFallbacker._fromFfi(result.union.ok, []);
}
/// Creates a new `LocaleFallbacker` without data for limited functionality.
///
- /// See the [Rust documentation for `new_without_data`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.new_without_data) for more information.
+ /// See the [Rust documentation for `new_without_data`](https://docs.rs/icu_locale/2.0.0/icu_locale/struct.LocaleFallbacker.html#method.new_without_data) for more information.
factory LocaleFallbacker.withoutData() {
- final result = _ICU4XLocaleFallbacker_create_without_data();
+ final result = _icu4x_LocaleFallbacker_without_data_mv1();
return LocaleFallbacker._fromFfi(result, []);
}
/// Associates this `LocaleFallbacker` with configuration options.
///
- /// See the [Rust documentation for `for_config`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.for_config) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `for_config`](https://docs.rs/icu_locale/2.0.0/icu_locale/struct.LocaleFallbacker.html#method.for_config) for more information.
LocaleFallbackerWithConfig forConfig(LocaleFallbackConfig config) {
- final temp = ffi2.Arena();
+ final temp = _FinalizedArena();
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XLocaleFallbacker_for_config(_ffi, config._toFfi(temp));
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return LocaleFallbackerWithConfig._fromFfi(result.union.ok, [], aEdges);
+ final result = _icu4x_LocaleFallbacker_for_config_mv1(_ffi, config._toFfi(temp.arena));
+ return LocaleFallbackerWithConfig._fromFfi(result, [], aEdges);
}
+
}
-@_DiplomatFfiUse('ICU4XLocaleFallbacker_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleFallbacker_destroy',
-)
+@_DiplomatFfiUse('icu4x_LocaleFallbacker_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LocaleFallbacker_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocaleFallbacker_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_LocaleFallbacker_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocaleFallbacker_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleFallbacker_create',
-)
+@_DiplomatFfiUse('icu4x_LocaleFallbacker_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleFallbacker_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleFallbacker_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleFallbacker_create_mv1();
-@_DiplomatFfiUse('ICU4XLocaleFallbacker_create_without_data')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(
- isLeaf: true,
- symbol: 'ICU4XLocaleFallbacker_create_without_data',
-)
+@_DiplomatFfiUse('icu4x_LocaleFallbacker_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleFallbacker_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XLocaleFallbacker_create_without_data();
+external _ResultOpaqueInt32 _icu4x_LocaleFallbacker_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XLocaleFallbacker_for_config')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _LocaleFallbackConfigFfi)
->(isLeaf: true, symbol: 'ICU4XLocaleFallbacker_for_config')
+@_DiplomatFfiUse('icu4x_LocaleFallbacker_without_data_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_LocaleFallbacker_without_data_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XLocaleFallbacker_for_config(
- ffi.Pointer<ffi.Opaque> self,
- _LocaleFallbackConfigFfi config,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleFallbacker_without_data_mv1();
+
+@_DiplomatFfiUse('icu4x_LocaleFallbacker_for_config_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _LocaleFallbackConfigFfi)>(isLeaf: true, symbol: 'icu4x_LocaleFallbacker_for_config_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleFallbacker_for_config_mv1(ffi.Pointer<ffi.Opaque> self, _LocaleFallbackConfigFfi config);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleFallbackerWithConfig.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleFallbackerWithConfig.g.dart
index bfb0454..6136993 100644
--- a/pkgs/intl4x/lib/src/bindings/LocaleFallbackerWithConfig.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/LocaleFallbackerWithConfig.g.dart
@@ -1,12 +1,13 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An object that runs the ICU4X locale fallback algorithm with specific configurations.
///
-/// See the [Rust documentation for `LocaleFallbacker`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html) for more information.
+/// See the [Rust documentation for `LocaleFallbacker`](https://docs.rs/icu_locale/2.0.0/icu_locale/struct.LocaleFallbacker.html) for more information.
///
-/// See the [Rust documentation for `LocaleFallbackerWithConfig`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbackerWithConfig.html) for more information.
+/// See the [Rust documentation for `LocaleFallbackerWithConfig`](https://docs.rs/icu/2.0.0/icu/locale/fallback/struct.LocaleFallbackerWithConfig.html) for more information.
final class LocaleFallbackerWithConfig implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -26,45 +27,29 @@
}
}
- @_DiplomatFfiUse('ICU4XLocaleFallbackerWithConfig_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLocaleFallbackerWithConfig_destroy),
- );
+ @_DiplomatFfiUse('icu4x_LocaleFallbackerWithConfig_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_LocaleFallbackerWithConfig_destroy_mv1));
/// Creates an iterator from a locale with each step of fallback.
///
- /// See the [Rust documentation for `fallback_for`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.fallback_for) for more information.
+ /// See the [Rust documentation for `fallback_for`](https://docs.rs/icu_locale/2.0.0/icu_locale/struct.LocaleFallbacker.html#method.fallback_for) for more information.
LocaleFallbackIterator fallbackForLocale(Locale locale) {
// This lifetime edge depends on lifetimes: 'a, 'b
core.List<Object> aEdges = [this];
- final result = _ICU4XLocaleFallbackerWithConfig_fallback_for_locale(
- _ffi,
- locale._ffi,
- );
+ final result = _icu4x_LocaleFallbackerWithConfig_fallback_for_locale_mv1(_ffi, locale._ffi);
return LocaleFallbackIterator._fromFfi(result, [], aEdges);
}
+
}
-@_DiplomatFfiUse('ICU4XLocaleFallbackerWithConfig_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLocaleFallbackerWithConfig_destroy',
-)
+@_DiplomatFfiUse('icu4x_LocaleFallbackerWithConfig_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_LocaleFallbackerWithConfig_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLocaleFallbackerWithConfig_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_LocaleFallbackerWithConfig_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLocaleFallbackerWithConfig_fallback_for_locale')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XLocaleFallbackerWithConfig_fallback_for_locale')
+@_DiplomatFfiUse('icu4x_LocaleFallbackerWithConfig_fallback_for_locale_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_LocaleFallbackerWithConfig_fallback_for_locale_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XLocaleFallbackerWithConfig_fallback_for_locale(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_LocaleFallbackerWithConfig_fallback_for_locale_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> locale);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/LocaleParseError.g.dart b/pkgs/intl4x/lib/src/bindings/LocaleParseError.g.dart
new file mode 100644
index 0000000..3ec06a2
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/LocaleParseError.g.dart
@@ -0,0 +1,19 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/icu/2.0.0/icu/locale/enum.ParseError.html)
+enum LocaleParseError {
+
+ unknown,
+
+ language,
+
+ subtag,
+
+ extension;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Logger.g.dart b/pkgs/intl4x/lib/src/bindings/Logger.g.dart
index 84f52ec..0d79eac 100644
--- a/pkgs/intl4x/lib/src/bindings/Logger.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Logger.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -20,10 +21,8 @@
}
}
- @_DiplomatFfiUse('ICU4XLogger_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XLogger_destroy),
- );
+ @_DiplomatFfiUse('icu4x_Logger_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Logger_destroy_mv1));
/// Initialize the logger using `simple_logger`
///
@@ -31,37 +30,20 @@
///
/// Returns `false` if there was already a logger set.
static bool initSimpleLogger() {
- final result = _ICU4XLogger_init_simple_logger();
+ final result = _icu4x_Logger_init_simple_logger_mv1();
return result;
}
- /// Deprecated: since ICU4X 1.4, this now happens automatically if the `log` feature is enabled.
- static bool initConsoleLogger() {
- final result = _ICU4XLogger_init_console_logger();
- return result;
- }
}
-@_DiplomatFfiUse('ICU4XLogger_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XLogger_destroy',
-)
+@_DiplomatFfiUse('icu4x_Logger_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Logger_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XLogger_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_Logger_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XLogger_init_simple_logger')
-@ffi.Native<ffi.Bool Function()>(
- isLeaf: true,
- symbol: 'ICU4XLogger_init_simple_logger',
-)
+@_DiplomatFfiUse('icu4x_Logger_init_simple_logger_mv1')
+@ffi.Native<ffi.Bool Function()>(isLeaf: true, symbol: 'icu4x_Logger_init_simple_logger_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XLogger_init_simple_logger();
+external bool _icu4x_Logger_init_simple_logger_mv1();
-@_DiplomatFfiUse('ICU4XLogger_init_console_logger')
-@ffi.Native<ffi.Bool Function()>(
- isLeaf: true,
- symbol: 'ICU4XLogger_init_console_logger',
-)
-// ignore: non_constant_identifier_names
-external bool _ICU4XLogger_init_console_logger();
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/MeasureUnit.g.dart b/pkgs/intl4x/lib/src/bindings/MeasureUnit.g.dart
index a0ffeb4..0cfa169 100644
--- a/pkgs/intl4x/lib/src/bindings/MeasureUnit.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/MeasureUnit.g.dart
@@ -1,13 +1,14 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X Measurement Unit object which represents a single unit of measurement
/// such as `meter`, `second`, `kilometer-per-hour`, `square-meter`, etc.
///
-/// You can create an instance of this object using [`MeasureUnitParser`] by calling the `parse_measure_unit` method.
+/// You can create an instance of this object using [MeasureUnitParser] by calling the `parse` method.
///
-/// See the [Rust documentation for `MeasureUnit`](https://docs.rs/icu/latest/icu/experimental/units/measureunit/struct.MeasureUnit.html) for more information.
+/// See the [Rust documentation for `MeasureUnit`](https://docs.rs/icu/2.0.0/icu/experimental/measure/measureunit/struct.MeasureUnit.html) for more information.
final class MeasureUnit implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -25,16 +26,14 @@
}
}
- @_DiplomatFfiUse('ICU4XMeasureUnit_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XMeasureUnit_destroy),
- );
+ @_DiplomatFfiUse('icu4x_MeasureUnit_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_MeasureUnit_destroy_mv1));
+
}
-@_DiplomatFfiUse('ICU4XMeasureUnit_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XMeasureUnit_destroy',
-)
+@_DiplomatFfiUse('icu4x_MeasureUnit_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_MeasureUnit_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XMeasureUnit_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_MeasureUnit_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/MeasureUnitParser.g.dart b/pkgs/intl4x/lib/src/bindings/MeasureUnitParser.g.dart
index d236785..b7588a3 100644
--- a/pkgs/intl4x/lib/src/bindings/MeasureUnitParser.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/MeasureUnitParser.g.dart
@@ -1,76 +1,79 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X Measurement Unit parser object which is capable of parsing the CLDR unit identifier
-/// (e.g. `meter-per-square-second`) and get the [`MeasureUnit`].
+/// An ICU4X Measure Unit Parser object, capable of parsing the CLDR unit identifier (e.g. `meter-per-square-second`) and get the [MeasureUnit].
///
-/// See the [Rust documentation for `MeasureUnitParser`](https://docs.rs/icu/latest/icu/experimental/units/measureunit/struct.MeasureUnitParser.html) for more information.
+/// See the [Rust documentation for `MeasureUnitParser`](https://docs.rs/icu/2.0.0/icu/experimental/measure/parser/struct.MeasureUnitParser.html) for more information.
final class MeasureUnitParser implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
// These are "used" in the sense that they keep dependencies alive
// ignore: unused_field
final core.List<Object> _selfEdge;
- // ignore: unused_field
- final core.List<Object> _aEdge;
// This takes in a list of lifetime edges (including for &self borrows)
// corresponding to data this may borrow from. These should be flat arrays containing
// references to objects, and this object will hold on to them to keep them alive and
// maintain borrow validity.
- MeasureUnitParser._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
+ MeasureUnitParser._fromFfi(this._ffi, this._selfEdge) {
if (_selfEdge.isEmpty) {
_finalizer.attach(this, _ffi.cast());
}
}
- @_DiplomatFfiUse('ICU4XMeasureUnitParser_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XMeasureUnitParser_destroy),
- );
+ @_DiplomatFfiUse('icu4x_MeasureUnitParser_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_MeasureUnitParser_destroy_mv1));
- /// Parses the CLDR unit identifier (e.g. `meter-per-square-second`) and returns the corresponding [`MeasureUnit`].
- /// Returns an error if the unit identifier is not valid.
+ /// Construct a new [MeasureUnitParser] instance using compiled data.
///
- /// See the [Rust documentation for `parse`](https://docs.rs/icu/latest/icu/experimental/units/measureunit/struct.MeasureUnitParser.html#method.parse) for more information.
- ///
- /// Throws [Error] on failure.
- MeasureUnit parse(String unitId) {
- final temp = ffi2.Arena();
- final unitIdView = unitId.utf8View;
- final result = _ICU4XMeasureUnitParser_parse(
- _ffi,
- unitIdView.allocIn(temp),
- unitIdView.length,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return MeasureUnit._fromFfi(result.union.ok, []);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/experimental/measure/parser/struct.MeasureUnitParser.html#method.new) for more information.
+ factory MeasureUnitParser() {
+ final result = _icu4x_MeasureUnitParser_create_mv1();
+ return MeasureUnitParser._fromFfi(result, []);
}
+
+ /// Construct a new [MeasureUnitParser] instance using a particular data source.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/experimental/measure/parser/struct.MeasureUnitParser.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory MeasureUnitParser.withProvider(DataProvider provider) {
+ final result = _icu4x_MeasureUnitParser_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return MeasureUnitParser._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `parse`](https://docs.rs/icu/2.0.0/icu/experimental/measure/parser/struct.MeasureUnitParser.html#method.parse) for more information.
+ MeasureUnit? parse(String unitId) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_MeasureUnitParser_parse_mv1(_ffi, unitId._utf8AllocIn(temp.arena));
+ return result.address == 0 ? null : MeasureUnit._fromFfi(result, []);
+ }
+
}
-@_DiplomatFfiUse('ICU4XMeasureUnitParser_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XMeasureUnitParser_destroy',
-)
+@_DiplomatFfiUse('icu4x_MeasureUnitParser_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_MeasureUnitParser_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XMeasureUnitParser_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_MeasureUnitParser_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XMeasureUnitParser_parse')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XMeasureUnitParser_parse')
+@_DiplomatFfiUse('icu4x_MeasureUnitParser_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_MeasureUnitParser_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XMeasureUnitParser_parse(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> unitIdData,
- int unitIdLength,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_MeasureUnitParser_create_mv1();
+
+@_DiplomatFfiUse('icu4x_MeasureUnitParser_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_MeasureUnitParser_create_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_MeasureUnitParser_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_MeasureUnitParser_parse_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_MeasureUnitParser_parse_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_MeasureUnitParser_parse_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 unitId);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/MetazoneCalculator.g.dart b/pkgs/intl4x/lib/src/bindings/MetazoneCalculator.g.dart
deleted file mode 100644
index e921e6d..0000000
--- a/pkgs/intl4x/lib/src/bindings/MetazoneCalculator.g.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An object capable of computing the metazone from a timezone.
-///
-/// This can be used via `maybe_calculate_metazone()` on [`CustomTimeZone`].
-///
-/// [`CustomTimeZone`]: crate::timezone::ffi::ICU4XCustomTimeZone
-///
-/// See the [Rust documentation for `MetazoneCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html) for more information.
-final class MetazoneCalculator implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- MetazoneCalculator._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XMetazoneCalculator_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XMetazoneCalculator_destroy),
- );
-
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.new) for more information.
- ///
- /// Throws [Error] on failure.
- factory MetazoneCalculator(DataProvider provider) {
- final result = _ICU4XMetazoneCalculator_create(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return MetazoneCalculator._fromFfi(result.union.ok, []);
- }
-}
-
-@_DiplomatFfiUse('ICU4XMetazoneCalculator_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XMetazoneCalculator_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XMetazoneCalculator_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XMetazoneCalculator_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XMetazoneCalculator_create',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XMetazoneCalculator_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/PluralCategories.g.dart b/pkgs/intl4x/lib/src/bindings/PluralCategories.g.dart
index 84b8866..f38c3e9 100644
--- a/pkgs/intl4x/lib/src/bindings/PluralCategories.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/PluralCategories.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -31,13 +32,13 @@
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
- PluralCategories._fromFfi(_PluralCategoriesFfi ffi)
- : zero = ffi.zero,
- one = ffi.one,
- two = ffi.two,
- few = ffi.few,
- many = ffi.many,
- other = ffi.other;
+ PluralCategories._fromFfi(_PluralCategoriesFfi ffi) :
+ zero = ffi.zero,
+ one = ffi.one,
+ two = ffi.two,
+ few = ffi.few,
+ many = ffi.many,
+ other = ffi.other;
// ignore: unused_element
_PluralCategoriesFfi _toFfi(ffi.Allocator temp) {
@@ -51,6 +52,7 @@
return struct;
}
+
@override
bool operator ==(Object other) =>
other is PluralCategories &&
@@ -62,5 +64,14 @@
other.other == this.other;
@override
- int get hashCode => Object.hashAll([zero, one, two, few, many, other]);
+ int get hashCode => Object.hashAll([
+ zero,
+ one,
+ two,
+ few,
+ many,
+ other,
+ ]);
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/PluralCategory.g.dart b/pkgs/intl4x/lib/src/bindings/PluralCategory.g.dart
index cf59d91..a523987 100644
--- a/pkgs/intl4x/lib/src/bindings/PluralCategory.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/PluralCategory.g.dart
@@ -1,9 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `PluralCategory`](https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html) for more information.
+/// See the [Rust documentation for `PluralCategory`](https://docs.rs/icu/2.0.0/icu/plurals/enum.PluralCategory.html) for more information.
enum PluralCategory {
+
zero,
one,
@@ -19,31 +21,23 @@
/// Construct from a string in the format
/// [specified in TR35](https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules)
///
- /// See the [Rust documentation for `get_for_cldr_string`](https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html#method.get_for_cldr_string) for more information.
+ /// See the [Rust documentation for `get_for_cldr_string`](https://docs.rs/icu/2.0.0/icu/plurals/enum.PluralCategory.html#method.get_for_cldr_string) for more information.
///
- /// See the [Rust documentation for `get_for_cldr_bytes`](https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html#method.get_for_cldr_bytes) for more information.
+ /// See the [Rust documentation for `get_for_cldr_bytes`](https://docs.rs/icu/2.0.0/icu/plurals/enum.PluralCategory.html#method.get_for_cldr_bytes) for more information.
static PluralCategory? getForCldrString(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XPluralCategory_get_for_cldr_string(
- sView.allocIn(temp),
- sView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_PluralCategory_get_for_cldr_string_mv1(s._utf8AllocIn(temp.arena));
if (!result.isOk) {
return null;
}
return PluralCategory.values[result.union.ok];
}
+
}
-@_DiplomatFfiUse('ICU4XPluralCategory_get_for_cldr_string')
-@ffi.Native<_ResultInt32Void Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XPluralCategory_get_for_cldr_string',
-)
+@_DiplomatFfiUse('icu4x_PluralCategory_get_for_cldr_string_mv1')
+@ffi.Native<_ResultInt32Void Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_PluralCategory_get_for_cldr_string_mv1')
// ignore: non_constant_identifier_names
-external _ResultInt32Void _ICU4XPluralCategory_get_for_cldr_string(
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
-);
+external _ResultInt32Void _icu4x_PluralCategory_get_for_cldr_string_mv1(_SliceUtf8 s);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/PluralOperands.g.dart b/pkgs/intl4x/lib/src/bindings/PluralOperands.g.dart
index f5acbcd..93a8e53 100644
--- a/pkgs/intl4x/lib/src/bindings/PluralOperands.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/PluralOperands.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `PluralOperands`](https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html) for more information.
+/// See the [Rust documentation for `PluralOperands`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralOperands.html) for more information.
final class PluralOperands implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,64 +21,57 @@
}
}
- @_DiplomatFfiUse('ICU4XPluralOperands_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XPluralOperands_destroy),
- );
+ @_DiplomatFfiUse('icu4x_PluralOperands_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_PluralOperands_destroy_mv1));
/// Construct for a given string representing a number
///
- /// See the [Rust documentation for `from_str`](https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html#method.from_str) for more information.
+ /// See the [Rust documentation for `from_str`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralOperands.html#method.from_str) for more information.
///
- /// Throws [Error] on failure.
+ /// Throws [DecimalParseError] on failure.
factory PluralOperands.fromString(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XPluralOperands_create_from_string(
- sView.allocIn(temp),
- sView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_PluralOperands_from_string_mv1(s._utf8AllocIn(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DecimalParseError.values[result.union.err];
}
return PluralOperands._fromFfi(result.union.ok, []);
}
+ /// Construct for a given integer
+ factory PluralOperands.fromInt(int i) {
+ final result = _icu4x_PluralOperands_from_int64_mv1(i);
+ return PluralOperands._fromFfi(result, []);
+ }
+
/// Construct from a FixedDecimal
///
/// Retains at most 18 digits each from the integer and fraction parts.
- factory PluralOperands.fromFixedDecimal(FixedDecimal x) {
- final result = _ICU4XPluralOperands_create_from_fixed_decimal(x._ffi);
+ factory PluralOperands.fromFixedDecimal(Decimal x) {
+ final result = _icu4x_PluralOperands_from_fixed_decimal_mv1(x._ffi);
return PluralOperands._fromFfi(result, []);
}
+
}
-@_DiplomatFfiUse('ICU4XPluralOperands_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XPluralOperands_destroy',
-)
+@_DiplomatFfiUse('icu4x_PluralOperands_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_PluralOperands_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XPluralOperands_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_PluralOperands_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XPluralOperands_create_from_string')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XPluralOperands_create_from_string',
-)
+@_DiplomatFfiUse('icu4x_PluralOperands_from_string_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_PluralOperands_from_string_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XPluralOperands_create_from_string(
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
-);
+external _ResultOpaqueInt32 _icu4x_PluralOperands_from_string_mv1(_SliceUtf8 s);
-@_DiplomatFfiUse('ICU4XPluralOperands_create_from_fixed_decimal')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPluralOperands_create_from_fixed_decimal',
-)
+@_DiplomatFfiUse('icu4x_PluralOperands_from_int64_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Int64)>(isLeaf: true, symbol: 'icu4x_PluralOperands_from_int64_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XPluralOperands_create_from_fixed_decimal(
- ffi.Pointer<ffi.Opaque> x,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_PluralOperands_from_int64_mv1(int i);
+
+@_DiplomatFfiUse('icu4x_PluralOperands_from_fixed_decimal_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PluralOperands_from_fixed_decimal_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_PluralOperands_from_fixed_decimal_mv1(ffi.Pointer<ffi.Opaque> x);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/PluralRules.g.dart b/pkgs/intl4x/lib/src/bindings/PluralRules.g.dart
index 985917b..0ba4b6f 100644
--- a/pkgs/intl4x/lib/src/bindings/PluralRules.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/PluralRules.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `PluralRules`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html) for more information.
+/// See the [Rust documentation for `PluralRules`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralRules.html) for more information.
final class PluralRules implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,101 +21,112 @@
}
}
- @_DiplomatFfiUse('ICU4XPluralRules_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XPluralRules_destroy),
- );
+ @_DiplomatFfiUse('icu4x_PluralRules_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_PluralRules_destroy_mv1));
- /// Construct an [`PluralRules`] for the given locale, for cardinal numbers
+ /// Construct an [PluralRules] for the given locale, for cardinal numbers, using compiled data.
///
- /// See the [Rust documentation for `try_new_cardinal`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_cardinal) for more information.
+ /// See the [Rust documentation for `try_new_cardinal`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralRules.html#method.try_new_cardinal) for more information.
///
- /// Throws [Error] on failure.
- factory PluralRules.cardinal(DataProvider provider, Locale locale) {
- final result = _ICU4XPluralRules_create_cardinal(
- provider._ffi,
- locale._ffi,
- );
+ /// Throws [DataError] on failure.
+ factory PluralRules.cardinal(Locale locale) {
+ final result = _icu4x_PluralRules_create_cardinal_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PluralRules._fromFfi(result.union.ok, []);
}
- /// Construct an [`PluralRules`] for the given locale, for ordinal numbers
+ /// Construct an [PluralRules] for the given locale, for cardinal numbers, using a particular data source.
///
- /// See the [Rust documentation for `try_new_ordinal`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal) for more information.
+ /// See the [Rust documentation for `try_new_cardinal`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralRules.html#method.try_new_cardinal) for more information.
///
- /// Throws [Error] on failure.
- factory PluralRules.ordinal(DataProvider provider, Locale locale) {
- final result = _ICU4XPluralRules_create_ordinal(provider._ffi, locale._ffi);
+ /// Throws [DataError] on failure.
+ factory PluralRules.cardinalWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_PluralRules_create_cardinal_with_provider_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return PluralRules._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [PluralRules] for the given locale, for ordinal numbers, using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new_ordinal`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralRules.html#method.try_new_ordinal) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PluralRules.ordinal(Locale locale) {
+ final result = _icu4x_PluralRules_create_ordinal_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return PluralRules._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [PluralRules] for the given locale, for ordinal numbers, using a particular data source.
+ ///
+ /// See the [Rust documentation for `try_new_ordinal`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralRules.html#method.try_new_ordinal) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PluralRules.ordinalWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_PluralRules_create_ordinal_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return PluralRules._fromFfi(result.union.ok, []);
}
/// Get the category for a given number represented as operands
///
- /// See the [Rust documentation for `category_for`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.category_for) for more information.
+ /// See the [Rust documentation for `category_for`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralRules.html#method.category_for) for more information.
PluralCategory categoryFor(PluralOperands op) {
- final result = _ICU4XPluralRules_category_for(_ffi, op._ffi);
+ final result = _icu4x_PluralRules_category_for_mv1(_ffi, op._ffi);
return PluralCategory.values[result];
}
/// Get all of the categories needed in the current locale
///
- /// See the [Rust documentation for `categories`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.categories) for more information.
+ /// See the [Rust documentation for `categories`](https://docs.rs/icu/2.0.0/icu/plurals/struct.PluralRules.html#method.categories) for more information.
PluralCategories get categories {
- final result = _ICU4XPluralRules_categories(_ffi);
+ final result = _icu4x_PluralRules_categories_mv1(_ffi);
return PluralCategories._fromFfi(result);
}
+
}
-@_DiplomatFfiUse('ICU4XPluralRules_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XPluralRules_destroy',
-)
+@_DiplomatFfiUse('icu4x_PluralRules_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_PluralRules_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XPluralRules_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_PluralRules_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XPluralRules_create_cardinal')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XPluralRules_create_cardinal')
+@_DiplomatFfiUse('icu4x_PluralRules_create_cardinal_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PluralRules_create_cardinal_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XPluralRules_create_cardinal(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external _ResultOpaqueInt32 _icu4x_PluralRules_create_cardinal_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XPluralRules_create_ordinal')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XPluralRules_create_ordinal')
+@_DiplomatFfiUse('icu4x_PluralRules_create_cardinal_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PluralRules_create_cardinal_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XPluralRules_create_ordinal(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external _ResultOpaqueInt32 _icu4x_PluralRules_create_cardinal_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XPluralRules_category_for')
-@ffi.Native<
- ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XPluralRules_category_for')
+@_DiplomatFfiUse('icu4x_PluralRules_create_ordinal_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PluralRules_create_ordinal_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XPluralRules_category_for(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> op,
-);
+external _ResultOpaqueInt32 _icu4x_PluralRules_create_ordinal_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XPluralRules_categories')
-@ffi.Native<_PluralCategoriesFfi Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPluralRules_categories',
-)
+@_DiplomatFfiUse('icu4x_PluralRules_create_ordinal_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PluralRules_create_ordinal_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _PluralCategoriesFfi _ICU4XPluralRules_categories(
- ffi.Pointer<ffi.Opaque> self,
-);
+external _ResultOpaqueInt32 _icu4x_PluralRules_create_ordinal_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_PluralRules_category_for_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PluralRules_category_for_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_PluralRules_category_for_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> op);
+
+@_DiplomatFfiUse('icu4x_PluralRules_categories_mv1')
+@ffi.Native<_PluralCategoriesFfi Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PluralRules_categories_mv1')
+// ignore: non_constant_identifier_names
+external _PluralCategoriesFfi _icu4x_PluralRules_categories_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/PropertyValueNameToEnumMapper.g.dart b/pkgs/intl4x/lib/src/bindings/PropertyValueNameToEnumMapper.g.dart
index 6c074f5..9b01d56 100644
--- a/pkgs/intl4x/lib/src/bindings/PropertyValueNameToEnumMapper.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/PropertyValueNameToEnumMapper.g.dart
@@ -1,12 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// A type capable of looking up a property value from a string name.
///
-/// See the [Rust documentation for `PropertyValueNameToEnumMapper`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapper.html) for more information.
+/// See the [Rust documentation for `PropertyParser`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParser.html) for more information.
///
-/// See the [Rust documentation for `PropertyValueNameToEnumMapperBorrowed`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html) for more information.
+/// See the [Rust documentation for `PropertyParserBorrowed`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParserBorrowed.html) for more information.
+///
+/// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParser.html#method.new) for more information.
final class PropertyValueNameToEnumMapper implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,25 +27,17 @@
}
}
- @_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XPropertyValueNameToEnumMapper_destroy),
- );
+ @_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_PropertyValueNameToEnumMapper_destroy_mv1));
/// Get the property value matching the given name, using strict matching
///
/// Returns -1 if the name is unknown for this property
///
- /// See the [Rust documentation for `get_strict`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html#method.get_strict) for more information.
+ /// See the [Rust documentation for `get_strict`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParserBorrowed.html#method.get_strict) for more information.
int getStrict(String name) {
- final temp = ffi2.Arena();
- final nameView = name.utf8View;
- final result = _ICU4XPropertyValueNameToEnumMapper_get_strict(
- _ffi,
- nameView.allocIn(temp),
- nameView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_PropertyValueNameToEnumMapper_get_strict_mv1(_ffi, name._utf8AllocIn(temp.arena));
return result;
}
@@ -50,297 +45,369 @@
///
/// Returns -1 if the name is unknown for this property
///
- /// See the [Rust documentation for `get_loose`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html#method.get_loose) for more information.
+ /// See the [Rust documentation for `get_loose`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyParserBorrowed.html#method.get_loose) for more information.
int getLoose(String name) {
- final temp = ffi2.Arena();
- final nameView = name.utf8View;
- final result = _ICU4XPropertyValueNameToEnumMapper_get_loose(
- _ffi,
- nameView.allocIn(temp),
- nameView.length,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final result = _icu4x_PropertyValueNameToEnumMapper_get_loose_mv1(_ffi, name._utf8AllocIn(temp.arena));
return result;
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategory.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `General_Category` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.generalCategory(DataProvider provider) {
- final result = _ICU4XPropertyValueNameToEnumMapper_load_general_category(
- provider._ffi,
- );
+ /// See the [Rust documentation for `GeneralCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html) for more information.
+ factory PropertyValueNameToEnumMapper.generalCategory() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_general_category_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `General_Category` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `GeneralCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/enum.GeneralCategory.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.generalCategoryWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_general_category_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.HangulSyllableType.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Hangul_Syllable_Type` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.hangulSyllableType(
- DataProvider provider,
- ) {
- final result =
- _ICU4XPropertyValueNameToEnumMapper_load_hangul_syllable_type(
- provider._ffi,
- );
+ /// See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html) for more information.
+ factory PropertyValueNameToEnumMapper.hangulSyllableType() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Hangul_Syllable_Type` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.HangulSyllableType.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.hangulSyllableTypeWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.EastAsianWidth.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `East_Asian_Width` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.eastAsianWidth(DataProvider provider) {
- final result = _ICU4XPropertyValueNameToEnumMapper_load_east_asian_width(
- provider._ffi,
- );
+ /// See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html) for more information.
+ factory PropertyValueNameToEnumMapper.eastAsianWidth() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `East_Asian_Width` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.EastAsianWidth.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.eastAsianWidthWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.BidiClass.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Bidi_Class` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.bidiClass(DataProvider provider) {
- final result = _ICU4XPropertyValueNameToEnumMapper_load_bidi_class(
- provider._ffi,
- );
+ /// See the [Rust documentation for `BidiClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html) for more information.
+ factory PropertyValueNameToEnumMapper.bidiClass() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_bidi_class_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Bidi_Class` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `BidiClass`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.BidiClass.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.bidiClassWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_bidi_class_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.IndicSyllabicCategory.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Indic_Syllabic_Category` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.indicSyllabicCategory(
- DataProvider provider,
- ) {
- final result =
- _ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category(
- provider._ffi,
- );
+ /// See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html) for more information.
+ factory PropertyValueNameToEnumMapper.indicSyllabicCategory() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Indic_Syllabic_Category` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.IndicSyllabicCategory.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.indicSyllabicCategoryWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.LineBreak.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Line_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.lineBreak(DataProvider provider) {
- final result = _ICU4XPropertyValueNameToEnumMapper_load_line_break(
- provider._ffi,
- );
+ /// See the [Rust documentation for `LineBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html) for more information.
+ factory PropertyValueNameToEnumMapper.lineBreak() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_line_break_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Line_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `LineBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.LineBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.lineBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_line_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GraphemeClusterBreak.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Grapheme_Cluster_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.graphemeClusterBreak(
- DataProvider provider,
- ) {
- final result =
- _ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break(
- provider._ffi,
- );
+ /// See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeClusterBreak.html) for more information.
+ factory PropertyValueNameToEnumMapper.graphemeClusterBreak() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Grapheme_Cluster_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.GraphemeClusterBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.graphemeClusterBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.WordBreak.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Word_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.wordBreak(DataProvider provider) {
- final result = _ICU4XPropertyValueNameToEnumMapper_load_word_break(
- provider._ffi,
- );
+ /// See the [Rust documentation for `WordBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html) for more information.
+ factory PropertyValueNameToEnumMapper.wordBreak() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_word_break_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Word_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `WordBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.wordBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_word_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.SentenceBreak.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Sentence_Break` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.sentenceBreak(DataProvider provider) {
- final result = _ICU4XPropertyValueNameToEnumMapper_load_sentence_break(
- provider._ffi,
- );
+ /// See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html) for more information.
+ factory PropertyValueNameToEnumMapper.sentenceBreak() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_sentence_break_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Sentence_Break` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.sentenceBreakWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_sentence_break_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
- /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.Script.html#method.name_to_enum_mapper) for more information.
+ /// Create a name-to-enum mapper for the `Script` property, using compiled data.
///
- /// Throws [Error] on failure.
- factory PropertyValueNameToEnumMapper.script(DataProvider provider) {
- final result = _ICU4XPropertyValueNameToEnumMapper_load_script(
- provider._ffi,
- );
+ /// See the [Rust documentation for `Script`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html) for more information.
+ factory PropertyValueNameToEnumMapper.script() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_script_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Script` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `Script`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.scriptWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_script_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
}
+
+ /// Create a name-to-enum mapper for the `Vertical_Orientation` property, using compiled data.
+ ///
+ /// See the [Rust documentation for `VerticalOrientation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html) for more information.
+ factory PropertyValueNameToEnumMapper.verticalOrientation() {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_mv1();
+ return PropertyValueNameToEnumMapper._fromFfi(result, []);
+ }
+
+ /// Create a name-to-enum mapper for the `Vertical_Orientation` property, using a particular data source.
+ ///
+ /// See the [Rust documentation for `VerticalOrientation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory PropertyValueNameToEnumMapper.verticalOrientationWithProvider(DataProvider provider) {
+ final result = _icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return PropertyValueNameToEnumMapper._fromFfi(result.union.ok, []);
+ }
+
}
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_destroy',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XPropertyValueNameToEnumMapper_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_PropertyValueNameToEnumMapper_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_get_strict')
-@ffi.Native<
- ffi.Int16 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_get_strict')
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_get_strict_mv1')
+@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_get_strict_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XPropertyValueNameToEnumMapper_get_strict(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> nameData,
- int nameLength,
-);
+external int _icu4x_PropertyValueNameToEnumMapper_get_strict_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 name);
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_get_loose')
-@ffi.Native<
- ffi.Int16 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_get_loose')
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_get_loose_mv1')
+@ffi.Native<ffi.Int16 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_get_loose_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XPropertyValueNameToEnumMapper_get_loose(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> nameData,
- int nameLength,
-);
+external int _icu4x_PropertyValueNameToEnumMapper_get_loose_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 name);
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_general_category')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_general_category',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_general_category_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_general_category_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XPropertyValueNameToEnumMapper_load_general_category(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_general_category_mv1();
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_hangul_syllable_type')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_hangul_syllable_type',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_general_category_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_general_category_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XPropertyValueNameToEnumMapper_load_hangul_syllable_type(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_general_category_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_east_asian_width')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_east_asian_width',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XPropertyValueNameToEnumMapper_load_east_asian_width(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_mv1();
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_bidi_class')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_bidi_class',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_bidi_class(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_hangul_syllable_type_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse(
- 'ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category',
-)
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_mv1();
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_line_break')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_line_break',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_line_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_east_asian_width_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse(
- 'ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break',
-)
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_bidi_class_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_bidi_class_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_bidi_class_mv1();
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_word_break')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_word_break',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_bidi_class_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_bidi_class_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_word_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_bidi_class_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_sentence_break')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_sentence_break',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XPropertyValueNameToEnumMapper_load_sentence_break(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_mv1();
-@_DiplomatFfiUse('ICU4XPropertyValueNameToEnumMapper_load_script')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XPropertyValueNameToEnumMapper_load_script',
-)
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_script(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_indic_syllabic_category_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_line_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_line_break_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_line_break_mv1();
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_line_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_line_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_line_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_mv1();
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_grapheme_cluster_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_word_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_word_break_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_word_break_mv1();
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_word_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_word_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_word_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_sentence_break_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_sentence_break_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_sentence_break_mv1();
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_sentence_break_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_sentence_break_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_sentence_break_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_script_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_script_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_script_mv1();
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_script_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_script_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_script_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_mv1();
+
+@_DiplomatFfiUse('icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_PropertyValueNameToEnumMapper_create_vertical_orientation_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/RegionDisplayNames.g.dart b/pkgs/intl4x/lib/src/bindings/RegionDisplayNames.g.dart
index a519517..40c2731 100644
--- a/pkgs/intl4x/lib/src/bindings/RegionDisplayNames.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/RegionDisplayNames.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `RegionDisplayNames`](https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html) for more information.
+/// See the [Rust documentation for `RegionDisplayNames`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.RegionDisplayNames.html) for more information.
final class RegionDisplayNames implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,20 +21,33 @@
}
}
- @_DiplomatFfiUse('ICU4XRegionDisplayNames_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XRegionDisplayNames_destroy),
- );
+ @_DiplomatFfiUse('icu4x_RegionDisplayNames_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_RegionDisplayNames_destroy_mv1));
- /// Creates a new `RegionDisplayNames` from locale data and an options bag.
+ /// Creates a new `RegionDisplayNames` from locale data and an options bag using compiled data.
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html#method.try_new) for more information.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.RegionDisplayNames.html#method.try_new) for more information.
///
- /// Throws [Error] on failure.
- factory RegionDisplayNames(DataProvider provider, Locale locale) {
- final result = _ICU4XRegionDisplayNames_create(provider._ffi, locale._ffi);
+ /// Throws [DataError] on failure.
+ factory RegionDisplayNames(Locale locale, DisplayNamesOptions options) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_RegionDisplayNames_create_v1_mv1(locale._ffi, options._toFfi(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return RegionDisplayNames._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new `RegionDisplayNames` from locale data and an options bag using a particular data source.
+ ///
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.RegionDisplayNames.html#method.try_new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory RegionDisplayNames.createWithProvider(DataProvider provider, Locale locale, DisplayNamesOptions options) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_RegionDisplayNames_create_v1_with_provider_mv1(provider._ffi, locale._ffi, options._toFfi(temp.arena));
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return RegionDisplayNames._fromFfi(result.union.ok, []);
}
@@ -42,58 +56,39 @@
/// Note that the function returns an empty string in case the display name for a given
/// region code is not found.
///
- /// See the [Rust documentation for `of`](https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html#method.of) for more information.
+ /// See the [Rust documentation for `of`](https://docs.rs/icu/2.0.0/icu/experimental/displaynames/struct.RegionDisplayNames.html#method.of) for more information.
///
- /// Throws [Error] on failure.
+ /// Throws [LocaleParseError] on failure.
String of(String region) {
- final temp = ffi2.Arena();
- final regionView = region.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XRegionDisplayNames_of(
- _ffi,
- regionView.allocIn(temp),
- regionView.length,
- writeable._ffi,
- );
- temp.releaseAll();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ final result = _icu4x_RegionDisplayNames_of_mv1(_ffi, region._utf8AllocIn(temp.arena), write._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw LocaleParseError.values[result.union.err];
}
- return writeable.finalize();
+ return write.finalize();
}
+
}
-@_DiplomatFfiUse('ICU4XRegionDisplayNames_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XRegionDisplayNames_destroy',
-)
+@_DiplomatFfiUse('icu4x_RegionDisplayNames_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_RegionDisplayNames_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XRegionDisplayNames_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_RegionDisplayNames_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XRegionDisplayNames_create')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XRegionDisplayNames_create')
+@_DiplomatFfiUse('icu4x_RegionDisplayNames_create_v1_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _DisplayNamesOptionsFfi)>(isLeaf: true, symbol: 'icu4x_RegionDisplayNames_create_v1_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XRegionDisplayNames_create(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external _ResultOpaqueInt32 _icu4x_RegionDisplayNames_create_v1_mv1(ffi.Pointer<ffi.Opaque> locale, _DisplayNamesOptionsFfi options);
-@_DiplomatFfiUse('ICU4XRegionDisplayNames_of')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XRegionDisplayNames_of')
+@_DiplomatFfiUse('icu4x_RegionDisplayNames_create_v1_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _DisplayNamesOptionsFfi)>(isLeaf: true, symbol: 'icu4x_RegionDisplayNames_create_v1_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XRegionDisplayNames_of(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> regionData,
- int regionLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_RegionDisplayNames_create_v1_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _DisplayNamesOptionsFfi options);
+
+@_DiplomatFfiUse('icu4x_RegionDisplayNames_of_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_RegionDisplayNames_of_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidInt32 _icu4x_RegionDisplayNames_of_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 region, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ReorderedIndexMap.g.dart b/pkgs/intl4x/lib/src/bindings/ReorderedIndexMap.g.dart
index a4325e5..425dcc9 100644
--- a/pkgs/intl4x/lib/src/bindings/ReorderedIndexMap.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ReorderedIndexMap.g.dart
@@ -1,4 +1,5 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
@@ -6,7 +7,7 @@
///
/// `map[visualIndex] = sourceIndex`
///
-/// Produced by `reorder_visual()` on [`Bidi`].
+/// Produced by `reorder_visual()` on [Bidi].
final class ReorderedIndexMap implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,28 +25,26 @@
}
}
- @_DiplomatFfiUse('ICU4XReorderedIndexMap_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XReorderedIndexMap_destroy),
- );
+ @_DiplomatFfiUse('icu4x_ReorderedIndexMap_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ReorderedIndexMap_destroy_mv1));
/// Get this as a slice/array of indices
core.List<int> get asSlice {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XReorderedIndexMap_as_slice(_ffi);
+ final result = _icu4x_ReorderedIndexMap_as_slice_mv1(_ffi);
return result._toDart(aEdges);
}
/// The length of this map
int get length {
- final result = _ICU4XReorderedIndexMap_len(_ffi);
+ final result = _icu4x_ReorderedIndexMap_len_mv1(_ffi);
return result;
}
/// Whether this map is empty
bool get isEmpty {
- final result = _ICU4XReorderedIndexMap_is_empty(_ffi);
+ final result = _icu4x_ReorderedIndexMap_is_empty_mv1(_ffi);
return result;
}
@@ -53,52 +52,35 @@
/// (note that 0 is also a valid in-bounds value, please use `len()`
/// to avoid out-of-bounds)
int operator [](int index) {
- final result = _ICU4XReorderedIndexMap_get(_ffi, index);
+ final result = _icu4x_ReorderedIndexMap_get_mv1(_ffi, index);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XReorderedIndexMap_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XReorderedIndexMap_destroy',
-)
+@_DiplomatFfiUse('icu4x_ReorderedIndexMap_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ReorderedIndexMap_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XReorderedIndexMap_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_ReorderedIndexMap_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XReorderedIndexMap_as_slice')
-@ffi.Native<_SliceUsize Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XReorderedIndexMap_as_slice',
-)
+@_DiplomatFfiUse('icu4x_ReorderedIndexMap_as_slice_mv1')
+@ffi.Native<_SliceUsize Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ReorderedIndexMap_as_slice_mv1')
// ignore: non_constant_identifier_names
-external _SliceUsize _ICU4XReorderedIndexMap_as_slice(
- ffi.Pointer<ffi.Opaque> self,
-);
+external _SliceUsize _icu4x_ReorderedIndexMap_as_slice_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XReorderedIndexMap_len')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XReorderedIndexMap_len',
-)
+@_DiplomatFfiUse('icu4x_ReorderedIndexMap_len_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ReorderedIndexMap_len_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XReorderedIndexMap_len(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_ReorderedIndexMap_len_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XReorderedIndexMap_is_empty')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XReorderedIndexMap_is_empty',
-)
+@_DiplomatFfiUse('icu4x_ReorderedIndexMap_is_empty_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ReorderedIndexMap_is_empty_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XReorderedIndexMap_is_empty(ffi.Pointer<ffi.Opaque> self);
+external bool _icu4x_ReorderedIndexMap_is_empty_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XReorderedIndexMap_get')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XReorderedIndexMap_get',
-)
+@_DiplomatFfiUse('icu4x_ReorderedIndexMap_get_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(isLeaf: true, symbol: 'icu4x_ReorderedIndexMap_get_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XReorderedIndexMap_get(
- ffi.Pointer<ffi.Opaque> self,
- int index,
-);
+external int _icu4x_ReorderedIndexMap_get_mv1(ffi.Pointer<ffi.Opaque> self, int index);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ResolvedCollatorOptions.g.dart b/pkgs/intl4x/lib/src/bindings/ResolvedCollatorOptions.g.dart
deleted file mode 100644
index a9870f1..0000000
--- a/pkgs/intl4x/lib/src/bindings/ResolvedCollatorOptions.g.dart
+++ /dev/null
@@ -1,83 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-final class _ResolvedCollatorOptionsFfi extends ffi.Struct {
- @ffi.Int32()
- external int strength;
- @ffi.Int32()
- external int alternateHandling;
- @ffi.Int32()
- external int caseFirst;
- @ffi.Int32()
- external int maxVariable;
- @ffi.Int32()
- external int caseLevel;
- @ffi.Int32()
- external int numeric;
- @ffi.Int32()
- external int backwardSecondLevel;
-}
-
-/// See the [Rust documentation for `ResolvedCollatorOptions`](https://docs.rs/icu/latest/icu/collator/struct.ResolvedCollatorOptions.html) for more information.
-final class ResolvedCollatorOptions {
- final CollatorStrength strength;
- final CollatorAlternateHandling alternateHandling;
- final CollatorCaseFirst caseFirst;
- final CollatorMaxVariable maxVariable;
- final CollatorCaseLevel caseLevel;
- final CollatorNumeric numeric;
- final CollatorBackwardSecondLevel backwardSecondLevel;
-
- // This struct contains borrowed fields, so this takes in a list of
- // "edges" corresponding to where each lifetime's data may have been borrowed from
- // and passes it down to individual fields containing the borrow.
- // This method does not attempt to handle any dependencies between lifetimes, the caller
- // should handle this when constructing edge arrays.
- // ignore: unused_element
- ResolvedCollatorOptions._fromFfi(_ResolvedCollatorOptionsFfi ffi)
- : strength = CollatorStrength.values[ffi.strength],
- alternateHandling =
- CollatorAlternateHandling.values[ffi.alternateHandling],
- caseFirst = CollatorCaseFirst.values[ffi.caseFirst],
- maxVariable = CollatorMaxVariable.values[ffi.maxVariable],
- caseLevel = CollatorCaseLevel.values[ffi.caseLevel],
- numeric = CollatorNumeric.values[ffi.numeric],
- backwardSecondLevel =
- CollatorBackwardSecondLevel.values[ffi.backwardSecondLevel];
-
- // ignore: unused_element
- _ResolvedCollatorOptionsFfi _toFfi(ffi.Allocator temp) {
- final struct = ffi.Struct.create<_ResolvedCollatorOptionsFfi>();
- struct.strength = strength.index;
- struct.alternateHandling = alternateHandling.index;
- struct.caseFirst = caseFirst.index;
- struct.maxVariable = maxVariable.index;
- struct.caseLevel = caseLevel.index;
- struct.numeric = numeric.index;
- struct.backwardSecondLevel = backwardSecondLevel.index;
- return struct;
- }
-
- @override
- bool operator ==(Object other) =>
- other is ResolvedCollatorOptions &&
- other.strength == strength &&
- other.alternateHandling == alternateHandling &&
- other.caseFirst == caseFirst &&
- other.maxVariable == maxVariable &&
- other.caseLevel == caseLevel &&
- other.numeric == numeric &&
- other.backwardSecondLevel == backwardSecondLevel;
-
- @override
- int get hashCode => Object.hashAll([
- strength,
- alternateHandling,
- caseFirst,
- maxVariable,
- caseLevel,
- numeric,
- backwardSecondLevel,
- ]);
-}
diff --git a/pkgs/intl4x/lib/src/bindings/Rfc9557ParseError.g.dart b/pkgs/intl4x/lib/src/bindings/Rfc9557ParseError.g.dart
new file mode 100644
index 0000000..cb420d0
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/Rfc9557ParseError.g.dart
@@ -0,0 +1,21 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/icu/2.0.0/icu/calendar/enum.ParseError.html), [2](https://docs.rs/icu/2.0.0/icu/time/enum.ParseError.html)
+enum Rfc9557ParseError {
+
+ unknown,
+
+ invalidSyntax,
+
+ outOfRange,
+
+ missingFields,
+
+ unknownCalendar;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/RoundingIncrement.g.dart b/pkgs/intl4x/lib/src/bindings/RoundingIncrement.g.dart
deleted file mode 100644
index 5570592..0000000
--- a/pkgs/intl4x/lib/src/bindings/RoundingIncrement.g.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// Increment used in a rounding operation.
-///
-/// See the [Rust documentation for `RoundingIncrement`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.RoundingIncrement.html) for more information.
-enum RoundingIncrement {
- multiplesOf1,
-
- multiplesOf2,
-
- multiplesOf5,
-
- multiplesOf25,
-}
diff --git a/pkgs/intl4x/lib/src/bindings/Script.g.dart b/pkgs/intl4x/lib/src/bindings/Script.g.dart
new file mode 100644
index 0000000..acbeda7
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/Script.g.dart
@@ -0,0 +1,748 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `Script`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html) for more information.
+enum Script {
+ /// See the [Rust documentation for `Adlam`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Adlam) for more information.
+ adlam,
+ /// See the [Rust documentation for `Ahom`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Ahom) for more information.
+ ahom,
+ /// See the [Rust documentation for `AnatolianHieroglyphs`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.AnatolianHieroglyphs) for more information.
+ anatolianHieroglyphs,
+ /// See the [Rust documentation for `Arabic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Arabic) for more information.
+ arabic,
+ /// See the [Rust documentation for `Armenian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Armenian) for more information.
+ armenian,
+ /// See the [Rust documentation for `Avestan`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Avestan) for more information.
+ avestan,
+ /// See the [Rust documentation for `Balinese`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Balinese) for more information.
+ balinese,
+ /// See the [Rust documentation for `Bamum`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Bamum) for more information.
+ bamum,
+ /// See the [Rust documentation for `BassaVah`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.BassaVah) for more information.
+ bassaVah,
+ /// See the [Rust documentation for `Batak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Batak) for more information.
+ batak,
+ /// See the [Rust documentation for `Bengali`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Bengali) for more information.
+ bengali,
+ /// See the [Rust documentation for `Bhaiksuki`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Bhaiksuki) for more information.
+ bhaiksuki,
+ /// See the [Rust documentation for `Bopomofo`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Bopomofo) for more information.
+ bopomofo,
+ /// See the [Rust documentation for `Brahmi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Brahmi) for more information.
+ brahmi,
+ /// See the [Rust documentation for `Braille`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Braille) for more information.
+ braille,
+ /// See the [Rust documentation for `Buginese`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Buginese) for more information.
+ buginese,
+ /// See the [Rust documentation for `Buhid`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Buhid) for more information.
+ buhid,
+ /// See the [Rust documentation for `CanadianAboriginal`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.CanadianAboriginal) for more information.
+ canadianAboriginal,
+ /// See the [Rust documentation for `Carian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Carian) for more information.
+ carian,
+ /// See the [Rust documentation for `CaucasianAlbanian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.CaucasianAlbanian) for more information.
+ caucasianAlbanian,
+ /// See the [Rust documentation for `Chakma`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Chakma) for more information.
+ chakma,
+ /// See the [Rust documentation for `Cham`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Cham) for more information.
+ cham,
+ /// See the [Rust documentation for `Cherokee`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Cherokee) for more information.
+ cherokee,
+ /// See the [Rust documentation for `Chorasmian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Chorasmian) for more information.
+ chorasmian,
+ /// See the [Rust documentation for `Common`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Common) for more information.
+ common,
+ /// See the [Rust documentation for `Coptic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Coptic) for more information.
+ coptic,
+ /// See the [Rust documentation for `Cuneiform`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Cuneiform) for more information.
+ cuneiform,
+ /// See the [Rust documentation for `Cypriot`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Cypriot) for more information.
+ cypriot,
+ /// See the [Rust documentation for `CyproMinoan`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.CyproMinoan) for more information.
+ cyproMinoan,
+ /// See the [Rust documentation for `Cyrillic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Cyrillic) for more information.
+ cyrillic,
+ /// See the [Rust documentation for `Deseret`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Deseret) for more information.
+ deseret,
+ /// See the [Rust documentation for `Devanagari`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Devanagari) for more information.
+ devanagari,
+ /// See the [Rust documentation for `DivesAkuru`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.DivesAkuru) for more information.
+ divesAkuru,
+ /// See the [Rust documentation for `Dogra`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Dogra) for more information.
+ dogra,
+ /// See the [Rust documentation for `Duployan`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Duployan) for more information.
+ duployan,
+ /// See the [Rust documentation for `EgyptianHieroglyphs`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.EgyptianHieroglyphs) for more information.
+ egyptianHieroglyphs,
+ /// See the [Rust documentation for `Elbasan`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Elbasan) for more information.
+ elbasan,
+ /// See the [Rust documentation for `Elymaic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Elymaic) for more information.
+ elymaic,
+ /// See the [Rust documentation for `Ethiopian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Ethiopian) for more information.
+ ethiopian,
+ /// See the [Rust documentation for `Georgian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Georgian) for more information.
+ georgian,
+ /// See the [Rust documentation for `Glagolitic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Glagolitic) for more information.
+ glagolitic,
+ /// See the [Rust documentation for `Gothic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Gothic) for more information.
+ gothic,
+ /// See the [Rust documentation for `Grantha`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Grantha) for more information.
+ grantha,
+ /// See the [Rust documentation for `Greek`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Greek) for more information.
+ greek,
+ /// See the [Rust documentation for `Gujarati`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Gujarati) for more information.
+ gujarati,
+ /// See the [Rust documentation for `GunjalaGondi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.GunjalaGondi) for more information.
+ gunjalaGondi,
+ /// See the [Rust documentation for `Gurmukhi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Gurmukhi) for more information.
+ gurmukhi,
+ /// See the [Rust documentation for `Han`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Han) for more information.
+ han,
+ /// See the [Rust documentation for `Hangul`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Hangul) for more information.
+ hangul,
+ /// See the [Rust documentation for `HanifiRohingya`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.HanifiRohingya) for more information.
+ hanifiRohingya,
+ /// See the [Rust documentation for `Hanunoo`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Hanunoo) for more information.
+ hanunoo,
+ /// See the [Rust documentation for `Hatran`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Hatran) for more information.
+ hatran,
+ /// See the [Rust documentation for `Hebrew`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Hebrew) for more information.
+ hebrew,
+ /// See the [Rust documentation for `Hiragana`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Hiragana) for more information.
+ hiragana,
+ /// See the [Rust documentation for `ImperialAramaic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.ImperialAramaic) for more information.
+ imperialAramaic,
+ /// See the [Rust documentation for `Inherited`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Inherited) for more information.
+ inherited,
+ /// See the [Rust documentation for `InscriptionalPahlavi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.InscriptionalPahlavi) for more information.
+ inscriptionalPahlavi,
+ /// See the [Rust documentation for `InscriptionalParthian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.InscriptionalParthian) for more information.
+ inscriptionalParthian,
+ /// See the [Rust documentation for `Javanese`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Javanese) for more information.
+ javanese,
+ /// See the [Rust documentation for `Kaithi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Kaithi) for more information.
+ kaithi,
+ /// See the [Rust documentation for `Kannada`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Kannada) for more information.
+ kannada,
+ /// See the [Rust documentation for `Katakana`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Katakana) for more information.
+ katakana,
+ /// See the [Rust documentation for `Kawi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Kawi) for more information.
+ kawi,
+ /// See the [Rust documentation for `KayahLi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.KayahLi) for more information.
+ kayahLi,
+ /// See the [Rust documentation for `Kharoshthi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Kharoshthi) for more information.
+ kharoshthi,
+ /// See the [Rust documentation for `KhitanSmallScript`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.KhitanSmallScript) for more information.
+ khitanSmallScript,
+ /// See the [Rust documentation for `Khmer`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Khmer) for more information.
+ khmer,
+ /// See the [Rust documentation for `Khojki`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Khojki) for more information.
+ khojki,
+ /// See the [Rust documentation for `Khudawadi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Khudawadi) for more information.
+ khudawadi,
+ /// See the [Rust documentation for `Lao`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Lao) for more information.
+ lao,
+ /// See the [Rust documentation for `Latin`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Latin) for more information.
+ latin,
+ /// See the [Rust documentation for `Lepcha`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Lepcha) for more information.
+ lepcha,
+ /// See the [Rust documentation for `Limbu`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Limbu) for more information.
+ limbu,
+ /// See the [Rust documentation for `LinearA`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.LinearA) for more information.
+ linearA,
+ /// See the [Rust documentation for `LinearB`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.LinearB) for more information.
+ linearB,
+ /// See the [Rust documentation for `Lisu`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Lisu) for more information.
+ lisu,
+ /// See the [Rust documentation for `Lycian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Lycian) for more information.
+ lycian,
+ /// See the [Rust documentation for `Lydian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Lydian) for more information.
+ lydian,
+ /// See the [Rust documentation for `Mahajani`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Mahajani) for more information.
+ mahajani,
+ /// See the [Rust documentation for `Makasar`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Makasar) for more information.
+ makasar,
+ /// See the [Rust documentation for `Malayalam`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Malayalam) for more information.
+ malayalam,
+ /// See the [Rust documentation for `Mandaic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Mandaic) for more information.
+ mandaic,
+ /// See the [Rust documentation for `Manichaean`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Manichaean) for more information.
+ manichaean,
+ /// See the [Rust documentation for `Marchen`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Marchen) for more information.
+ marchen,
+ /// See the [Rust documentation for `MasaramGondi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.MasaramGondi) for more information.
+ masaramGondi,
+ /// See the [Rust documentation for `Medefaidrin`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Medefaidrin) for more information.
+ medefaidrin,
+ /// See the [Rust documentation for `MeeteiMayek`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.MeeteiMayek) for more information.
+ meeteiMayek,
+ /// See the [Rust documentation for `MendeKikakui`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.MendeKikakui) for more information.
+ mendeKikakui,
+ /// See the [Rust documentation for `MeroiticCursive`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.MeroiticCursive) for more information.
+ meroiticCursive,
+ /// See the [Rust documentation for `MeroiticHieroglyphs`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.MeroiticHieroglyphs) for more information.
+ meroiticHieroglyphs,
+ /// See the [Rust documentation for `Miao`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Miao) for more information.
+ miao,
+ /// See the [Rust documentation for `Modi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Modi) for more information.
+ modi,
+ /// See the [Rust documentation for `Mongolian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Mongolian) for more information.
+ mongolian,
+ /// See the [Rust documentation for `Mro`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Mro) for more information.
+ mro,
+ /// See the [Rust documentation for `Multani`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Multani) for more information.
+ multani,
+ /// See the [Rust documentation for `Myanmar`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Myanmar) for more information.
+ myanmar,
+ /// See the [Rust documentation for `Nabataean`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Nabataean) for more information.
+ nabataean,
+ /// See the [Rust documentation for `NagMundari`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.NagMundari) for more information.
+ nagMundari,
+ /// See the [Rust documentation for `Nandinagari`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Nandinagari) for more information.
+ nandinagari,
+ /// See the [Rust documentation for `Nastaliq`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Nastaliq) for more information.
+ nastaliq,
+ /// See the [Rust documentation for `NewTaiLue`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.NewTaiLue) for more information.
+ newTaiLue,
+ /// See the [Rust documentation for `Newa`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Newa) for more information.
+ newa,
+ /// See the [Rust documentation for `Nko`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Nko) for more information.
+ nko,
+ /// See the [Rust documentation for `Nushu`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Nushu) for more information.
+ nushu,
+ /// See the [Rust documentation for `NyiakengPuachueHmong`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.NyiakengPuachueHmong) for more information.
+ nyiakengPuachueHmong,
+ /// See the [Rust documentation for `Ogham`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Ogham) for more information.
+ ogham,
+ /// See the [Rust documentation for `OlChiki`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OlChiki) for more information.
+ olChiki,
+ /// See the [Rust documentation for `OldHungarian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldHungarian) for more information.
+ oldHungarian,
+ /// See the [Rust documentation for `OldItalic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldItalic) for more information.
+ oldItalic,
+ /// See the [Rust documentation for `OldNorthArabian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldNorthArabian) for more information.
+ oldNorthArabian,
+ /// See the [Rust documentation for `OldPermic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldPermic) for more information.
+ oldPermic,
+ /// See the [Rust documentation for `OldPersian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldPersian) for more information.
+ oldPersian,
+ /// See the [Rust documentation for `OldSogdian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldSogdian) for more information.
+ oldSogdian,
+ /// See the [Rust documentation for `OldSouthArabian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldSouthArabian) for more information.
+ oldSouthArabian,
+ /// See the [Rust documentation for `OldTurkic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldTurkic) for more information.
+ oldTurkic,
+ /// See the [Rust documentation for `OldUyghur`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.OldUyghur) for more information.
+ oldUyghur,
+ /// See the [Rust documentation for `Oriya`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Oriya) for more information.
+ oriya,
+ /// See the [Rust documentation for `Osage`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Osage) for more information.
+ osage,
+ /// See the [Rust documentation for `Osmanya`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Osmanya) for more information.
+ osmanya,
+ /// See the [Rust documentation for `PahawhHmong`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.PahawhHmong) for more information.
+ pahawhHmong,
+ /// See the [Rust documentation for `Palmyrene`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Palmyrene) for more information.
+ palmyrene,
+ /// See the [Rust documentation for `PauCinHau`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.PauCinHau) for more information.
+ pauCinHau,
+ /// See the [Rust documentation for `PhagsPa`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.PhagsPa) for more information.
+ phagsPa,
+ /// See the [Rust documentation for `Phoenician`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Phoenician) for more information.
+ phoenician,
+ /// See the [Rust documentation for `PsalterPahlavi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.PsalterPahlavi) for more information.
+ psalterPahlavi,
+ /// See the [Rust documentation for `Rejang`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Rejang) for more information.
+ rejang,
+ /// See the [Rust documentation for `Runic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Runic) for more information.
+ runic,
+ /// See the [Rust documentation for `Samaritan`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Samaritan) for more information.
+ samaritan,
+ /// See the [Rust documentation for `Saurashtra`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Saurashtra) for more information.
+ saurashtra,
+ /// See the [Rust documentation for `Sharada`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Sharada) for more information.
+ sharada,
+ /// See the [Rust documentation for `Shavian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Shavian) for more information.
+ shavian,
+ /// See the [Rust documentation for `Siddham`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Siddham) for more information.
+ siddham,
+ /// See the [Rust documentation for `SignWriting`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.SignWriting) for more information.
+ signWriting,
+ /// See the [Rust documentation for `Sinhala`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Sinhala) for more information.
+ sinhala,
+ /// See the [Rust documentation for `Sogdian`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Sogdian) for more information.
+ sogdian,
+ /// See the [Rust documentation for `SoraSompeng`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.SoraSompeng) for more information.
+ soraSompeng,
+ /// See the [Rust documentation for `Soyombo`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Soyombo) for more information.
+ soyombo,
+ /// See the [Rust documentation for `Sundanese`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Sundanese) for more information.
+ sundanese,
+ /// See the [Rust documentation for `SylotiNagri`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.SylotiNagri) for more information.
+ sylotiNagri,
+ /// See the [Rust documentation for `Syriac`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Syriac) for more information.
+ syriac,
+ /// See the [Rust documentation for `Tagalog`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tagalog) for more information.
+ tagalog,
+ /// See the [Rust documentation for `Tagbanwa`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tagbanwa) for more information.
+ tagbanwa,
+ /// See the [Rust documentation for `TaiLe`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.TaiLe) for more information.
+ taiLe,
+ /// See the [Rust documentation for `TaiTham`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.TaiTham) for more information.
+ taiTham,
+ /// See the [Rust documentation for `TaiViet`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.TaiViet) for more information.
+ taiViet,
+ /// See the [Rust documentation for `Takri`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Takri) for more information.
+ takri,
+ /// See the [Rust documentation for `Tamil`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tamil) for more information.
+ tamil,
+ /// See the [Rust documentation for `Tangsa`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tangsa) for more information.
+ tangsa,
+ /// See the [Rust documentation for `Tangut`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tangut) for more information.
+ tangut,
+ /// See the [Rust documentation for `Telugu`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Telugu) for more information.
+ telugu,
+ /// See the [Rust documentation for `Thaana`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Thaana) for more information.
+ thaana,
+ /// See the [Rust documentation for `Thai`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Thai) for more information.
+ thai,
+ /// See the [Rust documentation for `Tibetan`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tibetan) for more information.
+ tibetan,
+ /// See the [Rust documentation for `Tifinagh`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tifinagh) for more information.
+ tifinagh,
+ /// See the [Rust documentation for `Tirhuta`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Tirhuta) for more information.
+ tirhuta,
+ /// See the [Rust documentation for `Toto`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Toto) for more information.
+ toto,
+ /// See the [Rust documentation for `Ugaritic`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Ugaritic) for more information.
+ ugaritic,
+ /// See the [Rust documentation for `Unknown`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Unknown) for more information.
+ unknown,
+ /// See the [Rust documentation for `Vai`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Vai) for more information.
+ vai,
+ /// See the [Rust documentation for `Vithkuqi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Vithkuqi) for more information.
+ vithkuqi,
+ /// See the [Rust documentation for `Wancho`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Wancho) for more information.
+ wancho,
+ /// See the [Rust documentation for `WarangCiti`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.WarangCiti) for more information.
+ warangCiti,
+ /// See the [Rust documentation for `Yezidi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Yezidi) for more information.
+ yezidi,
+ /// See the [Rust documentation for `Yi`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.Yi) for more information.
+ yi,
+ /// See the [Rust documentation for `ZanabazarSquare`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#associatedconstant.ZanabazarSquare) for more information.
+ zanabazarSquare;
+
+ int get _ffi {
+ switch (this) {
+ case adlam:
+ return 167;
+ case ahom:
+ return 161;
+ case anatolianHieroglyphs:
+ return 156;
+ case arabic:
+ return 2;
+ case armenian:
+ return 3;
+ case avestan:
+ return 117;
+ case balinese:
+ return 62;
+ case bamum:
+ return 130;
+ case bassaVah:
+ return 134;
+ case batak:
+ return 63;
+ case bengali:
+ return 4;
+ case bhaiksuki:
+ return 168;
+ case bopomofo:
+ return 5;
+ case brahmi:
+ return 65;
+ case braille:
+ return 46;
+ case buginese:
+ return 55;
+ case buhid:
+ return 44;
+ case canadianAboriginal:
+ return 40;
+ case carian:
+ return 104;
+ case caucasianAlbanian:
+ return 159;
+ case chakma:
+ return 118;
+ case cham:
+ return 66;
+ case cherokee:
+ return 6;
+ case chorasmian:
+ return 189;
+ case common:
+ return 0;
+ case coptic:
+ return 7;
+ case cuneiform:
+ return 101;
+ case cypriot:
+ return 47;
+ case cyproMinoan:
+ return 193;
+ case cyrillic:
+ return 8;
+ case deseret:
+ return 9;
+ case devanagari:
+ return 10;
+ case divesAkuru:
+ return 190;
+ case dogra:
+ return 178;
+ case duployan:
+ return 135;
+ case egyptianHieroglyphs:
+ return 71;
+ case elbasan:
+ return 136;
+ case elymaic:
+ return 185;
+ case ethiopian:
+ return 11;
+ case georgian:
+ return 12;
+ case glagolitic:
+ return 56;
+ case gothic:
+ return 13;
+ case grantha:
+ return 137;
+ case greek:
+ return 14;
+ case gujarati:
+ return 15;
+ case gunjalaGondi:
+ return 179;
+ case gurmukhi:
+ return 16;
+ case han:
+ return 17;
+ case hangul:
+ return 18;
+ case hanifiRohingya:
+ return 182;
+ case hanunoo:
+ return 43;
+ case hatran:
+ return 162;
+ case hebrew:
+ return 19;
+ case hiragana:
+ return 20;
+ case imperialAramaic:
+ return 116;
+ case inherited:
+ return 1;
+ case inscriptionalPahlavi:
+ return 122;
+ case inscriptionalParthian:
+ return 125;
+ case javanese:
+ return 78;
+ case kaithi:
+ return 120;
+ case kannada:
+ return 21;
+ case katakana:
+ return 22;
+ case kawi:
+ return 198;
+ case kayahLi:
+ return 79;
+ case kharoshthi:
+ return 57;
+ case khitanSmallScript:
+ return 191;
+ case khmer:
+ return 23;
+ case khojki:
+ return 157;
+ case khudawadi:
+ return 145;
+ case lao:
+ return 24;
+ case latin:
+ return 25;
+ case lepcha:
+ return 82;
+ case limbu:
+ return 48;
+ case linearA:
+ return 83;
+ case linearB:
+ return 49;
+ case lisu:
+ return 131;
+ case lycian:
+ return 107;
+ case lydian:
+ return 108;
+ case mahajani:
+ return 160;
+ case makasar:
+ return 180;
+ case malayalam:
+ return 26;
+ case mandaic:
+ return 84;
+ case manichaean:
+ return 121;
+ case marchen:
+ return 169;
+ case masaramGondi:
+ return 175;
+ case medefaidrin:
+ return 181;
+ case meeteiMayek:
+ return 115;
+ case mendeKikakui:
+ return 140;
+ case meroiticCursive:
+ return 141;
+ case meroiticHieroglyphs:
+ return 86;
+ case miao:
+ return 92;
+ case modi:
+ return 163;
+ case mongolian:
+ return 27;
+ case mro:
+ return 149;
+ case multani:
+ return 164;
+ case myanmar:
+ return 28;
+ case nabataean:
+ return 143;
+ case nagMundari:
+ return 199;
+ case nandinagari:
+ return 187;
+ case nastaliq:
+ return 200;
+ case newTaiLue:
+ return 59;
+ case newa:
+ return 170;
+ case nko:
+ return 87;
+ case nushu:
+ return 150;
+ case nyiakengPuachueHmong:
+ return 186;
+ case ogham:
+ return 29;
+ case olChiki:
+ return 109;
+ case oldHungarian:
+ return 76;
+ case oldItalic:
+ return 30;
+ case oldNorthArabian:
+ return 142;
+ case oldPermic:
+ return 89;
+ case oldPersian:
+ return 61;
+ case oldSogdian:
+ return 184;
+ case oldSouthArabian:
+ return 133;
+ case oldTurkic:
+ return 88;
+ case oldUyghur:
+ return 194;
+ case oriya:
+ return 31;
+ case osage:
+ return 171;
+ case osmanya:
+ return 50;
+ case pahawhHmong:
+ return 75;
+ case palmyrene:
+ return 144;
+ case pauCinHau:
+ return 165;
+ case phagsPa:
+ return 90;
+ case phoenician:
+ return 91;
+ case psalterPahlavi:
+ return 123;
+ case rejang:
+ return 110;
+ case runic:
+ return 32;
+ case samaritan:
+ return 126;
+ case saurashtra:
+ return 111;
+ case sharada:
+ return 151;
+ case shavian:
+ return 51;
+ case siddham:
+ return 166;
+ case signWriting:
+ return 112;
+ case sinhala:
+ return 33;
+ case sogdian:
+ return 183;
+ case soraSompeng:
+ return 152;
+ case soyombo:
+ return 176;
+ case sundanese:
+ return 113;
+ case sylotiNagri:
+ return 58;
+ case syriac:
+ return 34;
+ case tagalog:
+ return 42;
+ case tagbanwa:
+ return 45;
+ case taiLe:
+ return 52;
+ case taiTham:
+ return 106;
+ case taiViet:
+ return 127;
+ case takri:
+ return 153;
+ case tamil:
+ return 35;
+ case tangsa:
+ return 195;
+ case tangut:
+ return 154;
+ case telugu:
+ return 36;
+ case thaana:
+ return 37;
+ case thai:
+ return 38;
+ case tibetan:
+ return 39;
+ case tifinagh:
+ return 60;
+ case tirhuta:
+ return 158;
+ case toto:
+ return 196;
+ case ugaritic:
+ return 53;
+ case unknown:
+ return 103;
+ case vai:
+ return 99;
+ case vithkuqi:
+ return 197;
+ case wancho:
+ return 188;
+ case warangCiti:
+ return 146;
+ case yezidi:
+ return 192;
+ case yi:
+ return 41;
+ case zanabazarSquare:
+ return 177;
+ }
+ }
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static Script forChar(Rune ch) {
+ final result = _icu4x_Script_for_char_mv1(ch);
+ return Script.values.firstWhere((v) => v._ffi == result);
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_Script_long_name_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_Script_short_name_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_Script_to_integer_value_mv1(_ffi);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.Script.html#method.from_icu4c_value) for more information.
+ static Script? fromIntegerValue(int other) {
+ final result = _icu4x_Script_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return Script.values.firstWhere((v) => v._ffi == result.union.ok);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_Script_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_Script_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Script_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_Script_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Script_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_Script_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_Script_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Script_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_Script_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_Script_to_integer_value_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_Script_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Script_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_Script_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_Script_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_Script_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ScriptExtensionsSet.g.dart b/pkgs/intl4x/lib/src/bindings/ScriptExtensionsSet.g.dart
index 11d440d..13e5e30 100644
--- a/pkgs/intl4x/lib/src/bindings/ScriptExtensionsSet.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ScriptExtensionsSet.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An object that represents the Script_Extensions property for a single character
///
-/// See the [Rust documentation for `ScriptExtensionsSet`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html) for more information.
+/// See the [Rust documentation for `ScriptExtensionsSet`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptExtensionsSet.html) for more information.
final class ScriptExtensionsSet implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,73 +25,56 @@
}
}
- @_DiplomatFfiUse('ICU4XScriptExtensionsSet_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XScriptExtensionsSet_destroy),
- );
+ @_DiplomatFfiUse('icu4x_ScriptExtensionsSet_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ScriptExtensionsSet_destroy_mv1));
/// Check if the Script_Extensions property of the given code point covers the given script
///
- /// See the [Rust documentation for `contains`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.contains) for more information.
+ /// See the [Rust documentation for `contains`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptExtensionsSet.html#method.contains) for more information.
bool contains(int script) {
- final result = _ICU4XScriptExtensionsSet_contains(_ffi, script);
+ final result = _icu4x_ScriptExtensionsSet_contains_mv1(_ffi, script);
return result;
}
/// Get the number of scripts contained in here
///
- /// See the [Rust documentation for `iter`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information.
+ /// See the [Rust documentation for `iter`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information.
int get count {
- final result = _ICU4XScriptExtensionsSet_count(_ffi);
+ final result = _icu4x_ScriptExtensionsSet_count_mv1(_ffi);
return result;
}
/// Get script at index
///
- /// See the [Rust documentation for `iter`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information.
+ /// See the [Rust documentation for `iter`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information.
int? scriptAt(int index) {
- final result = _ICU4XScriptExtensionsSet_script_at(_ffi, index);
+ final result = _icu4x_ScriptExtensionsSet_script_at_mv1(_ffi, index);
if (!result.isOk) {
return null;
}
return result.union.ok;
}
+
}
-@_DiplomatFfiUse('ICU4XScriptExtensionsSet_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XScriptExtensionsSet_destroy',
-)
+@_DiplomatFfiUse('icu4x_ScriptExtensionsSet_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ScriptExtensionsSet_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XScriptExtensionsSet_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_ScriptExtensionsSet_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XScriptExtensionsSet_contains')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)>(
- isLeaf: true,
- symbol: 'ICU4XScriptExtensionsSet_contains',
-)
+@_DiplomatFfiUse('icu4x_ScriptExtensionsSet_contains_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_ScriptExtensionsSet_contains_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XScriptExtensionsSet_contains(
- ffi.Pointer<ffi.Opaque> self,
- int script,
-);
+external bool _icu4x_ScriptExtensionsSet_contains_mv1(ffi.Pointer<ffi.Opaque> self, int script);
-@_DiplomatFfiUse('ICU4XScriptExtensionsSet_count')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XScriptExtensionsSet_count',
-)
+@_DiplomatFfiUse('icu4x_ScriptExtensionsSet_count_mv1')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ScriptExtensionsSet_count_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XScriptExtensionsSet_count(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_ScriptExtensionsSet_count_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XScriptExtensionsSet_script_at')
-@ffi.Native<_ResultUint16Void Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(
- isLeaf: true,
- symbol: 'ICU4XScriptExtensionsSet_script_at',
-)
+@_DiplomatFfiUse('icu4x_ScriptExtensionsSet_script_at_mv1')
+@ffi.Native<_ResultUint16Void Function(ffi.Pointer<ffi.Opaque>, ffi.Size)>(isLeaf: true, symbol: 'icu4x_ScriptExtensionsSet_script_at_mv1')
// ignore: non_constant_identifier_names
-external _ResultUint16Void _ICU4XScriptExtensionsSet_script_at(
- ffi.Pointer<ffi.Opaque> self,
- int index,
-);
+external _ResultUint16Void _icu4x_ScriptExtensionsSet_script_at_mv1(ffi.Pointer<ffi.Opaque> self, int index);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ScriptWithExtensions.g.dart b/pkgs/intl4x/lib/src/bindings/ScriptWithExtensions.g.dart
index cae225e..a3b59f5 100644
--- a/pkgs/intl4x/lib/src/bindings/ScriptWithExtensions.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ScriptWithExtensions.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X ScriptWithExtensions map object, capable of holding a map of codepoints to scriptextensions values
///
-/// See the [Rust documentation for `ScriptWithExtensions`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensions.html) for more information.
+/// See the [Rust documentation for `ScriptWithExtensions`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensions.html) for more information.
final class ScriptWithExtensions implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,124 +23,101 @@
}
}
- @_DiplomatFfiUse('ICU4XScriptWithExtensions_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XScriptWithExtensions_destroy),
- );
+ @_DiplomatFfiUse('icu4x_ScriptWithExtensions_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ScriptWithExtensions_destroy_mv1));
- /// See the [Rust documentation for `script_with_extensions`](https://docs.rs/icu/latest/icu/properties/script/fn.script_with_extensions.html) for more information.
+ /// Create a map for the `Script`/`Script_Extensions` properties, using compiled data.
///
- /// Throws [Error] on failure.
- factory ScriptWithExtensions(DataProvider provider) {
- final result = _ICU4XScriptWithExtensions_create(provider._ffi);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensions.html#method.new) for more information.
+ factory ScriptWithExtensions() {
+ final result = _icu4x_ScriptWithExtensions_create_mv1();
+ return ScriptWithExtensions._fromFfi(result, []);
+ }
+
+ /// Create a map for the `Script`/`Script_Extensions` properties, using compiled data.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensions.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory ScriptWithExtensions.withProvider(DataProvider provider) {
+ final result = _icu4x_ScriptWithExtensions_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return ScriptWithExtensions._fromFfi(result.union.ok, []);
}
/// Get the Script property value for a code point
///
- /// See the [Rust documentation for `get_script_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val) for more information.
- int getScriptVal(int codePoint) {
- final result = _ICU4XScriptWithExtensions_get_script_val(_ffi, codePoint);
+ /// See the [Rust documentation for `get_script_val`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val) for more information.
+ int getScriptVal(Rune ch) {
+ final result = _icu4x_ScriptWithExtensions_get_script_val_mv1(_ffi, ch);
return result;
}
/// Check if the Script_Extensions property of the given code point covers the given script
///
- /// See the [Rust documentation for `has_script`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information.
- bool hasScript(int codePoint, int script) {
- final result = _ICU4XScriptWithExtensions_has_script(
- _ffi,
- codePoint,
- script,
- );
+ /// See the [Rust documentation for `has_script`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information.
+ bool hasScript(Rune ch, int script) {
+ final result = _icu4x_ScriptWithExtensions_has_script_mv1(_ffi, ch, script);
return result;
}
/// Borrow this object for a slightly faster variant with more operations
///
- /// See the [Rust documentation for `as_borrowed`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensions.html#method.as_borrowed) for more information.
+ /// See the [Rust documentation for `as_borrowed`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensions.html#method.as_borrowed) for more information.
ScriptWithExtensionsBorrowed get asBorrowed {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XScriptWithExtensions_as_borrowed(_ffi);
+ final result = _icu4x_ScriptWithExtensions_as_borrowed_mv1(_ffi);
return ScriptWithExtensionsBorrowed._fromFfi(result, [], aEdges);
}
/// Get a list of ranges of code points that contain this script in their Script_Extensions values
///
- /// See the [Rust documentation for `get_script_extensions_ranges`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_ranges) for more information.
+ /// See the [Rust documentation for `get_script_extensions_ranges`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_ranges) for more information.
CodePointRangeIterator iterRangesForScript(int script) {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XScriptWithExtensions_iter_ranges_for_script(
- _ffi,
- script,
- );
+ final result = _icu4x_ScriptWithExtensions_iter_ranges_for_script_mv1(_ffi, script);
return CodePointRangeIterator._fromFfi(result, [], aEdges);
}
+
}
-@_DiplomatFfiUse('ICU4XScriptWithExtensions_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensions_destroy',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensions_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensions_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XScriptWithExtensions_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_ScriptWithExtensions_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XScriptWithExtensions_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensions_create',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensions_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensions_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XScriptWithExtensions_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_ScriptWithExtensions_create_mv1();
-@_DiplomatFfiUse('ICU4XScriptWithExtensions_get_script_val')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensions_get_script_val',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensions_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensions_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XScriptWithExtensions_get_script_val(
- ffi.Pointer<ffi.Opaque> self,
- int codePoint,
-);
+external _ResultOpaqueInt32 _icu4x_ScriptWithExtensions_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XScriptWithExtensions_has_script')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint16)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensions_has_script',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensions_get_script_val_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensions_get_script_val_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XScriptWithExtensions_has_script(
- ffi.Pointer<ffi.Opaque> self,
- int codePoint,
- int script,
-);
+external int _icu4x_ScriptWithExtensions_get_script_val_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XScriptWithExtensions_as_borrowed')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensions_as_borrowed',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensions_has_script_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensions_has_script_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XScriptWithExtensions_as_borrowed(
- ffi.Pointer<ffi.Opaque> self,
-);
+external bool _icu4x_ScriptWithExtensions_has_script_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch, int script);
-@_DiplomatFfiUse('ICU4XScriptWithExtensions_iter_ranges_for_script')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)
->(isLeaf: true, symbol: 'ICU4XScriptWithExtensions_iter_ranges_for_script')
+@_DiplomatFfiUse('icu4x_ScriptWithExtensions_as_borrowed_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensions_as_borrowed_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XScriptWithExtensions_iter_ranges_for_script(
- ffi.Pointer<ffi.Opaque> self,
- int script,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_ScriptWithExtensions_as_borrowed_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_ScriptWithExtensions_iter_ranges_for_script_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensions_iter_ranges_for_script_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_ScriptWithExtensions_iter_ranges_for_script_mv1(ffi.Pointer<ffi.Opaque> self, int script);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ScriptWithExtensionsBorrowed.g.dart b/pkgs/intl4x/lib/src/bindings/ScriptWithExtensionsBorrowed.g.dart
index 6aaab7e..7016366 100644
--- a/pkgs/intl4x/lib/src/bindings/ScriptWithExtensionsBorrowed.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ScriptWithExtensionsBorrowed.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// A slightly faster ICU4XScriptWithExtensions object
+/// A slightly faster ScriptWithExtensions object
///
-/// See the [Rust documentation for `ScriptWithExtensionsBorrowed`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html) for more information.
+/// See the [Rust documentation for `ScriptWithExtensionsBorrowed`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html) for more information.
final class ScriptWithExtensionsBorrowed implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -18,127 +19,76 @@
// corresponding to data this may borrow from. These should be flat arrays containing
// references to objects, and this object will hold on to them to keep them alive and
// maintain borrow validity.
- ScriptWithExtensionsBorrowed._fromFfi(
- this._ffi,
- this._selfEdge,
- this._aEdge,
- ) {
+ ScriptWithExtensionsBorrowed._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
if (_selfEdge.isEmpty) {
_finalizer.attach(this, _ffi.cast());
}
}
- @_DiplomatFfiUse('ICU4XScriptWithExtensionsBorrowed_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XScriptWithExtensionsBorrowed_destroy),
- );
+ @_DiplomatFfiUse('icu4x_ScriptWithExtensionsBorrowed_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ScriptWithExtensionsBorrowed_destroy_mv1));
/// Get the Script property value for a code point
+ /// Get the Script property value for a code point
///
- /// See the [Rust documentation for `get_script_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val) for more information.
- int getScriptVal(int codePoint) {
- final result = _ICU4XScriptWithExtensionsBorrowed_get_script_val(
- _ffi,
- codePoint,
- );
+ /// See the [Rust documentation for `get_script_val`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val) for more information.
+ int getScriptVal(Rune ch) {
+ final result = _icu4x_ScriptWithExtensionsBorrowed_get_script_val_mv1(_ffi, ch);
return result;
}
/// Get the Script property value for a code point
///
- /// See the [Rust documentation for `get_script_extensions_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_val) for more information.
- ScriptExtensionsSet getScriptExtensionsVal(int codePoint) {
+ /// See the [Rust documentation for `get_script_extensions_val`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_val) for more information.
+ ScriptExtensionsSet getScriptExtensionsVal(Rune ch) {
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this];
- final result = _ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val(
- _ffi,
- codePoint,
- );
+ final result = _icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_val_mv1(_ffi, ch);
return ScriptExtensionsSet._fromFfi(result, [], aEdges);
}
/// Check if the Script_Extensions property of the given code point covers the given script
///
- /// See the [Rust documentation for `has_script`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information.
- bool hasScript(int codePoint, int script) {
- final result = _ICU4XScriptWithExtensionsBorrowed_has_script(
- _ffi,
- codePoint,
- script,
- );
+ /// See the [Rust documentation for `has_script`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information.
+ bool hasScript(Rune ch, int script) {
+ final result = _icu4x_ScriptWithExtensionsBorrowed_has_script_mv1(_ffi, ch, script);
return result;
}
/// Build the CodePointSetData corresponding to a codepoints matching a particular script
/// in their Script_Extensions
///
- /// See the [Rust documentation for `get_script_extensions_set`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_set) for more information.
+ /// See the [Rust documentation for `get_script_extensions_set`](https://docs.rs/icu/2.0.0/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_set) for more information.
CodePointSetData getScriptExtensionsSet(int script) {
- final result = _ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set(
- _ffi,
- script,
- );
+ final result = _icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_set_mv1(_ffi, script);
return CodePointSetData._fromFfi(result, []);
}
+
}
-@_DiplomatFfiUse('ICU4XScriptWithExtensionsBorrowed_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensionsBorrowed_destroy',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensionsBorrowed_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensionsBorrowed_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XScriptWithExtensionsBorrowed_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_ScriptWithExtensionsBorrowed_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XScriptWithExtensionsBorrowed_get_script_val')
-@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensionsBorrowed_get_script_val',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensionsBorrowed_get_script_val_mv1')
+@ffi.Native<ffi.Uint16 Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensionsBorrowed_get_script_val_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XScriptWithExtensionsBorrowed_get_script_val(
- ffi.Pointer<ffi.Opaque> self,
- int codePoint,
-);
+external int _icu4x_ScriptWithExtensionsBorrowed_get_script_val_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)
->(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_val_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_val_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val(
- ffi.Pointer<ffi.Opaque> self,
- int codePoint,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_val_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch);
-@_DiplomatFfiUse('ICU4XScriptWithExtensionsBorrowed_has_script')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint16)>(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensionsBorrowed_has_script',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensionsBorrowed_has_script_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensionsBorrowed_has_script_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XScriptWithExtensionsBorrowed_has_script(
- ffi.Pointer<ffi.Opaque> self,
- int codePoint,
- int script,
-);
+external bool _icu4x_ScriptWithExtensionsBorrowed_has_script_mv1(ffi.Pointer<ffi.Opaque> self, Rune ch, int script);
-@_DiplomatFfiUse('ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)
->(
- isLeaf: true,
- symbol: 'ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set',
-)
+@_DiplomatFfiUse('icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_set_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_set_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set(
- ffi.Pointer<ffi.Opaque> self,
- int script,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_ScriptWithExtensionsBorrowed_get_script_extensions_set_mv1(ffi.Pointer<ffi.Opaque> self, int script);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/SegmenterWordType.g.dart b/pkgs/intl4x/lib/src/bindings/SegmenterWordType.g.dart
index c2daaf2..e19a880 100644
--- a/pkgs/intl4x/lib/src/bindings/SegmenterWordType.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/SegmenterWordType.g.dart
@@ -1,26 +1,28 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `WordType`](https://docs.rs/icu/latest/icu/segmenter/enum.WordType.html) for more information.
+/// See the [Rust documentation for `WordType`](https://docs.rs/icu/2.0.0/icu/segmenter/options/enum.WordType.html) for more information.
enum SegmenterWordType {
+
none,
number,
letter;
- /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/enum.WordType.html#method.is_word_like) for more information.
+ /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/2.0.0/icu/segmenter/options/enum.WordType.html#method.is_word_like) for more information.
bool get isWordLike {
- final result = _ICU4XSegmenterWordType_is_word_like(index);
+ final result = _icu4x_SegmenterWordType_is_word_like_mv1(index);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XSegmenterWordType_is_word_like')
-@ffi.Native<ffi.Bool Function(ffi.Int32)>(
- isLeaf: true,
- symbol: 'ICU4XSegmenterWordType_is_word_like',
-)
+@_DiplomatFfiUse('icu4x_SegmenterWordType_is_word_like_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_SegmenterWordType_is_word_like_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XSegmenterWordType_is_word_like(int self);
+external bool _icu4x_SegmenterWordType_is_word_like_mv1(int self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/SentenceBreak.g.dart b/pkgs/intl4x/lib/src/bindings/SentenceBreak.g.dart
new file mode 100644
index 0000000..109c947
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/SentenceBreak.g.dart
@@ -0,0 +1,113 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html) for more information.
+enum SentenceBreak {
+ /// See the [Rust documentation for `Other`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Other) for more information.
+ other,
+ /// See the [Rust documentation for `ATerm`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.ATerm) for more information.
+ aTerm,
+ /// See the [Rust documentation for `Close`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Close) for more information.
+ close,
+ /// See the [Rust documentation for `Format`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Format) for more information.
+ format,
+ /// See the [Rust documentation for `Lower`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Lower) for more information.
+ lower,
+ /// See the [Rust documentation for `Numeric`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Numeric) for more information.
+ numeric,
+ /// See the [Rust documentation for `OLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.OLetter) for more information.
+ oLetter,
+ /// See the [Rust documentation for `Sep`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Sep) for more information.
+ sep,
+ /// See the [Rust documentation for `Sp`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Sp) for more information.
+ sp,
+ /// See the [Rust documentation for `STerm`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.STerm) for more information.
+ sTerm,
+ /// See the [Rust documentation for `Upper`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Upper) for more information.
+ upper,
+ /// See the [Rust documentation for `CR`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.CR) for more information.
+ cr,
+ /// See the [Rust documentation for `Extend`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.Extend) for more information.
+ extend,
+ /// See the [Rust documentation for `LF`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.LF) for more information.
+ lf,
+ /// See the [Rust documentation for `SContinue`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#associatedconstant.SContinue) for more information.
+ sContinue;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static SentenceBreak forChar(Rune ch) {
+ final result = _icu4x_SentenceBreak_for_char_mv1(ch);
+ return SentenceBreak.values[result];
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_SentenceBreak_long_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_SentenceBreak_short_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_SentenceBreak_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.SentenceBreak.html#method.from_icu4c_value) for more information.
+ static SentenceBreak? fromIntegerValue(int other) {
+ final result = _icu4x_SentenceBreak_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return SentenceBreak.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_SentenceBreak_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_SentenceBreak_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_SentenceBreak_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_SentenceBreak_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_SentenceBreak_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_SentenceBreak_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_SentenceBreak_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_SentenceBreak_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_SentenceBreak_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_SentenceBreak_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_SentenceBreak_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_SentenceBreak_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_SentenceBreak_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_SentenceBreak_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_SentenceBreak_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorLatin1.g.dart b/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorLatin1.g.dart
index 84437af..c195621 100644
--- a/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorLatin1.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorLatin1.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html) for more information.
+/// See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.SentenceBreakIterator.html) for more information.
final class SentenceBreakIteratorLatin1 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,37 +23,28 @@
}
}
- @_DiplomatFfiUse('ICU4XSentenceBreakIteratorLatin1_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XSentenceBreakIteratorLatin1_destroy),
- );
+ @_DiplomatFfiUse('icu4x_SentenceBreakIteratorLatin1_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_SentenceBreakIteratorLatin1_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.SentenceBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XSentenceBreakIteratorLatin1_next(_ffi);
+ final result = _icu4x_SentenceBreakIteratorLatin1_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XSentenceBreakIteratorLatin1_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceBreakIteratorLatin1_destroy',
-)
+@_DiplomatFfiUse('icu4x_SentenceBreakIteratorLatin1_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_SentenceBreakIteratorLatin1_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XSentenceBreakIteratorLatin1_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_SentenceBreakIteratorLatin1_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XSentenceBreakIteratorLatin1_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceBreakIteratorLatin1_next',
-)
+@_DiplomatFfiUse('icu4x_SentenceBreakIteratorLatin1_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_SentenceBreakIteratorLatin1_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XSentenceBreakIteratorLatin1_next(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_SentenceBreakIteratorLatin1_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf16.g.dart b/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf16.g.dart
index d40c085..304d911 100644
--- a/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf16.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf16.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html) for more information.
+/// See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.SentenceBreakIterator.html) for more information.
final class SentenceBreakIteratorUtf16 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,37 +23,28 @@
}
}
- @_DiplomatFfiUse('ICU4XSentenceBreakIteratorUtf16_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XSentenceBreakIteratorUtf16_destroy),
- );
+ @_DiplomatFfiUse('icu4x_SentenceBreakIteratorUtf16_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_SentenceBreakIteratorUtf16_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.SentenceBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XSentenceBreakIteratorUtf16_next(_ffi);
+ final result = _icu4x_SentenceBreakIteratorUtf16_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XSentenceBreakIteratorUtf16_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceBreakIteratorUtf16_destroy',
-)
+@_DiplomatFfiUse('icu4x_SentenceBreakIteratorUtf16_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_SentenceBreakIteratorUtf16_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XSentenceBreakIteratorUtf16_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_SentenceBreakIteratorUtf16_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XSentenceBreakIteratorUtf16_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceBreakIteratorUtf16_next',
-)
+@_DiplomatFfiUse('icu4x_SentenceBreakIteratorUtf16_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_SentenceBreakIteratorUtf16_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XSentenceBreakIteratorUtf16_next(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_SentenceBreakIteratorUtf16_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf8.g.dart b/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf8.g.dart
index 6492468..8d9cdea 100644
--- a/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf8.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/SentenceBreakIteratorUtf8.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html) for more information.
+/// See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.SentenceBreakIterator.html) for more information.
final class SentenceBreakIteratorUtf8 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,35 +23,28 @@
}
}
- @_DiplomatFfiUse('ICU4XSentenceBreakIteratorUtf8_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XSentenceBreakIteratorUtf8_destroy),
- );
+ @_DiplomatFfiUse('icu4x_SentenceBreakIteratorUtf8_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_SentenceBreakIteratorUtf8_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.SentenceBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XSentenceBreakIteratorUtf8_next(_ffi);
+ final result = _icu4x_SentenceBreakIteratorUtf8_next_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XSentenceBreakIteratorUtf8_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceBreakIteratorUtf8_destroy',
-)
+@_DiplomatFfiUse('icu4x_SentenceBreakIteratorUtf8_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_SentenceBreakIteratorUtf8_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XSentenceBreakIteratorUtf8_destroy(
- ffi.Pointer<ffi.Void> self,
-);
+external void _icu4x_SentenceBreakIteratorUtf8_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XSentenceBreakIteratorUtf8_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceBreakIteratorUtf8_next',
-)
+@_DiplomatFfiUse('icu4x_SentenceBreakIteratorUtf8_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_SentenceBreakIteratorUtf8_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XSentenceBreakIteratorUtf8_next(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_SentenceBreakIteratorUtf8_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/SentenceSegmenter.g.dart b/pkgs/intl4x/lib/src/bindings/SentenceSegmenter.g.dart
index f39958d..6623143 100644
--- a/pkgs/intl4x/lib/src/bindings/SentenceSegmenter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/SentenceSegmenter.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X sentence-break segmenter, capable of finding sentence breakpoints in strings.
///
-/// See the [Rust documentation for `SentenceSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html) for more information.
+/// See the [Rust documentation for `SentenceSegmenter`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.SentenceSegmenter.html) for more information.
final class SentenceSegmenter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,20 +23,35 @@
}
}
- @_DiplomatFfiUse('ICU4XSentenceSegmenter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XSentenceSegmenter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_SentenceSegmenter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_SentenceSegmenter_destroy_mv1));
- /// Construct an [`SentenceSegmenter`].
+ /// Construct a [SentenceSegmenter] using compiled data. This does not assume any content locale.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.SentenceSegmenter.html#method.new) for more information.
+ factory SentenceSegmenter() {
+ final result = _icu4x_SentenceSegmenter_create_mv1();
+ return SentenceSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct a [SentenceSegmenter] for content known to be of a given locale, using compiled data.
///
- /// Throws [Error] on failure.
- factory SentenceSegmenter(DataProvider provider) {
- final result = _ICU4XSentenceSegmenter_create(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory SentenceSegmenter.withContentLocale(Locale locale) {
+ final result = _icu4x_SentenceSegmenter_create_with_content_locale_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return SentenceSegmenter._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct a [SentenceSegmenter] for content known to be of a given locale, using a particular data source.
+ ///
+ /// Throws [DataError] on failure.
+ factory SentenceSegmenter.withContentLocaleAndProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_SentenceSegmenter_create_with_content_locale_and_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return SentenceSegmenter._fromFfi(result.union.ok, []);
}
@@ -45,50 +61,40 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.segment_utf16) for more information.
+ /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.SentenceSegmenterBorrowed.html#method.segment_utf16) for more information.
SentenceBreakIteratorUtf16 segment(String input) {
- final inputView = input.utf16View;
final inputArena = _FinalizedArena();
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this, inputArena];
- final result = _ICU4XSentenceSegmenter_segment_utf16(
- _ffi,
- inputView.allocIn(inputArena.arena),
- inputView.length,
- );
+ final result = _icu4x_SentenceSegmenter_segment_utf16_mv1(_ffi, input._utf16AllocIn(inputArena.arena));
return SentenceBreakIteratorUtf16._fromFfi(result, [], aEdges);
}
+
}
-@_DiplomatFfiUse('ICU4XSentenceSegmenter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceSegmenter_destroy',
-)
+@_DiplomatFfiUse('icu4x_SentenceSegmenter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_SentenceSegmenter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XSentenceSegmenter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_SentenceSegmenter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XSentenceSegmenter_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XSentenceSegmenter_create',
-)
+@_DiplomatFfiUse('icu4x_SentenceSegmenter_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_SentenceSegmenter_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XSentenceSegmenter_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_SentenceSegmenter_create_mv1();
-@_DiplomatFfiUse('ICU4XSentenceSegmenter_segment_utf16')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint16>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XSentenceSegmenter_segment_utf16')
+@_DiplomatFfiUse('icu4x_SentenceSegmenter_create_with_content_locale_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_SentenceSegmenter_create_with_content_locale_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XSentenceSegmenter_segment_utf16(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint16> inputData,
- int inputLength,
-);
+external _ResultOpaqueInt32 _icu4x_SentenceSegmenter_create_with_content_locale_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_SentenceSegmenter_create_with_content_locale_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_SentenceSegmenter_create_with_content_locale_and_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_SentenceSegmenter_create_with_content_locale_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_SentenceSegmenter_segment_utf16_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_SentenceSegmenter_segment_utf16_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_SentenceSegmenter_segment_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 input);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/Time.g.dart b/pkgs/intl4x/lib/src/bindings/Time.g.dart
index 1f58a74..8f2c0d2 100644
--- a/pkgs/intl4x/lib/src/bindings/Time.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Time.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X Time object representing a time in terms of hour, minute, second, nanosecond
///
-/// See the [Rust documentation for `Time`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html) for more information.
+/// See the [Rust documentation for `Time`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html) for more information.
final class Time implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,126 +23,139 @@
}
}
- @_DiplomatFfiUse('ICU4XTime_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XTime_destroy),
- );
+ @_DiplomatFfiUse('icu4x_Time_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_Time_destroy_mv1));
- /// Creates a new [`Time`] given field values
+ /// Creates a new [Time] given field values
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#method.try_new) for more information.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#method.try_new) for more information.
///
- /// Throws [Error] on failure.
- factory Time(int hour, int minute, int second, int nanosecond) {
- final result = _ICU4XTime_create(hour, minute, second, nanosecond);
+ /// Throws [CalendarError] on failure.
+ factory Time(int hour, int minute, int second, int subsecond) {
+ final result = _icu4x_Time_create_mv1(hour, minute, second, subsecond);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw CalendarError.values[result.union.err];
}
return Time._fromFfi(result.union.ok, []);
}
- /// Creates a new [`Time`] representing midnight (00:00.000).
+ /// Creates a new [Time] from an IXDTF string.
///
- /// See the [Rust documentation for `midnight`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#method.midnight) for more information.
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#method.try_from_str) for more information.
///
- /// Throws [Error] on failure.
- factory Time.midnight() {
- final result = _ICU4XTime_create_midnight();
+ /// Throws [Rfc9557ParseError] on failure.
+ factory Time.fromString(String v) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_Time_from_string_mv1(v._utf8AllocIn(temp.arena));
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return Time._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new [Time] representing the start of the day (00:00:00.000).
+ ///
+ /// See the [Rust documentation for `start_of_day`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#method.start_of_day) for more information.
+ ///
+ /// Throws [CalendarError] on failure.
+ factory Time.startOfDay() {
+ final result = _icu4x_Time_start_of_day_mv1();
+ if (!result.isOk) {
+ throw CalendarError.values[result.union.err];
+ }
+ return Time._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new [Time] representing noon (12:00:00.000).
+ ///
+ /// See the [Rust documentation for `noon`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#method.noon) for more information.
+ ///
+ /// Throws [CalendarError] on failure.
+ factory Time.noon() {
+ final result = _icu4x_Time_noon_mv1();
+ if (!result.isOk) {
+ throw CalendarError.values[result.union.err];
}
return Time._fromFfi(result.union.ok, []);
}
/// Returns the hour in this time
///
- /// See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.hour) for more information.
+ /// See the [Rust documentation for `hour`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#structfield.hour) for more information.
int get hour {
- final result = _ICU4XTime_hour(_ffi);
+ final result = _icu4x_Time_hour_mv1(_ffi);
return result;
}
/// Returns the minute in this time
///
- /// See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.minute) for more information.
+ /// See the [Rust documentation for `minute`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#structfield.minute) for more information.
int get minute {
- final result = _ICU4XTime_minute(_ffi);
+ final result = _icu4x_Time_minute_mv1(_ffi);
return result;
}
/// Returns the second in this time
///
- /// See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.second) for more information.
+ /// See the [Rust documentation for `second`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#structfield.second) for more information.
int get second {
- final result = _ICU4XTime_second(_ffi);
+ final result = _icu4x_Time_second_mv1(_ffi);
return result;
}
- /// Returns the nanosecond in this time
+ /// Returns the subsecond in this time as nanoseconds
///
- /// See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/struct.Time.html#structfield.nanosecond) for more information.
- int get nanosecond {
- final result = _ICU4XTime_nanosecond(_ffi);
+ /// See the [Rust documentation for `subsecond`](https://docs.rs/icu/2.0.0/icu/time/struct.Time.html#structfield.subsecond) for more information.
+ int get subsecond {
+ final result = _icu4x_Time_subsecond_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XTime_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XTime_destroy',
-)
+@_DiplomatFfiUse('icu4x_Time_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_Time_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XTime_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_Time_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XTime_create')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint32)
->(isLeaf: true, symbol: 'ICU4XTime_create')
+@_DiplomatFfiUse('icu4x_Time_create_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_Time_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XTime_create(
- int hour,
- int minute,
- int second,
- int nanosecond,
-);
+external _ResultOpaqueInt32 _icu4x_Time_create_mv1(int hour, int minute, int second, int subsecond);
-@_DiplomatFfiUse('ICU4XTime_create_midnight')
-@ffi.Native<_ResultOpaqueInt32 Function()>(
- isLeaf: true,
- symbol: 'ICU4XTime_create_midnight',
-)
+@_DiplomatFfiUse('icu4x_Time_from_string_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_Time_from_string_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XTime_create_midnight();
+external _ResultOpaqueInt32 _icu4x_Time_from_string_mv1(_SliceUtf8 v);
-@_DiplomatFfiUse('ICU4XTime_hour')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTime_hour',
-)
+@_DiplomatFfiUse('icu4x_Time_start_of_day_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function()>(isLeaf: true, symbol: 'icu4x_Time_start_of_day_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XTime_hour(ffi.Pointer<ffi.Opaque> self);
+external _ResultOpaqueInt32 _icu4x_Time_start_of_day_mv1();
-@_DiplomatFfiUse('ICU4XTime_minute')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTime_minute',
-)
+@_DiplomatFfiUse('icu4x_Time_noon_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function()>(isLeaf: true, symbol: 'icu4x_Time_noon_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XTime_minute(ffi.Pointer<ffi.Opaque> self);
+external _ResultOpaqueInt32 _icu4x_Time_noon_mv1();
-@_DiplomatFfiUse('ICU4XTime_second')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTime_second',
-)
+@_DiplomatFfiUse('icu4x_Time_hour_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Time_hour_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XTime_second(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_Time_hour_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XTime_nanosecond')
-@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTime_nanosecond',
-)
+@_DiplomatFfiUse('icu4x_Time_minute_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Time_minute_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XTime_nanosecond(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_Time_minute_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Time_second_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Time_second_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Time_second_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_Time_subsecond_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_Time_subsecond_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_Time_subsecond_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/TimeFormatter.g.dart
index f575626..f7338ef 100644
--- a/pkgs/intl4x/lib/src/bindings/TimeFormatter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/TimeFormatter.g.dart
@@ -1,10 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X TimeFormatter object capable of formatting an [`Time`] type (and others) as a string
-///
-/// See the [Rust documentation for `TimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html) for more information.
+/// See the [Rust documentation for `NoCalendarFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/type.NoCalendarFormatter.html) for more information.
final class TimeFormatter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,151 +21,66 @@
}
}
- @_DiplomatFfiUse('ICU4XTimeFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XTimeFormatter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_TimeFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeFormatter_destroy_mv1));
- /// Creates a new [`TimeFormatter`] from locale data.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/type.NoCalendarFormatter.html#method.try_new) for more information.
///
- /// See the [Rust documentation for `try_new_with_length`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.try_new_with_length) for more information.
+ /// See the [Rust documentation for `T`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html) for more information.
///
- /// Throws [Error] on failure.
- factory TimeFormatter.withLength(
- DataProvider provider,
- Locale locale,
- TimeLength length,
- ) {
- final result = _ICU4XTimeFormatter_create_with_length(
- provider._ffi,
- locale._ffi,
- length.index,
- );
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeFormatter(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_TimeFormatter_create_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return TimeFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`Time`] to a string.
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/datetime/type.NoCalendarFormatter.html#method.try_new) for more information.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information.
+ /// See the [Rust documentation for `T`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html) for more information.
///
- /// Throws [Error] on failure.
- String formatTime(Time value) {
- final writeable = _Writeable();
- final result = _ICU4XTimeFormatter_format_time(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html#method.with_time_precision), [2](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html#method.with_alignment), [3](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/struct.T.html#method.for_length)
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeFormatter.withProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_TimeFormatter_create_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return TimeFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`DateTime`] to a string.
- ///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information.
- ///
- /// Throws [Error] on failure.
- String formatDatetime(DateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XTimeFormatter_format_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/type.NoCalendarFormatter.html#method.format) for more information.
+ String format(Time time) {
+ final write = _Write();
+ _icu4x_TimeFormatter_format_mv1(_ffi, time._ffi, write._ffi);
+ return write.finalize();
}
- /// Formats a [`IsoDateTime`] to a string.
- ///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information.
- ///
- /// Throws [Error] on failure.
- String formatIsoDatetime(IsoDateTime value) {
- final writeable = _Writeable();
- final result = _ICU4XTimeFormatter_format_iso_datetime(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
}
-@_DiplomatFfiUse('ICU4XTimeFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XTimeFormatter_destroy',
-)
+@_DiplomatFfiUse('icu4x_TimeFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TimeFormatter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XTimeFormatter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_TimeFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XTimeFormatter_create_with_length')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XTimeFormatter_create_with_length')
+@_DiplomatFfiUse('icu4x_TimeFormatter_create_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_TimeFormatter_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XTimeFormatter_create_with_length(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int length,
-);
+external _ResultOpaqueInt32 _icu4x_TimeFormatter_create_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XTimeFormatter_format_time')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeFormatter_format_time')
+@_DiplomatFfiUse('icu4x_TimeFormatter_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_TimeFormatter_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeFormatter_format_time(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_TimeFormatter_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
-@_DiplomatFfiUse('ICU4XTimeFormatter_format_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeFormatter_format_datetime')
+@_DiplomatFfiUse('icu4x_TimeFormatter_format_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeFormatter_format_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeFormatter_format_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external void _icu4x_TimeFormatter_format_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> time, ffi.Pointer<ffi.Opaque> write);
-@_DiplomatFfiUse('ICU4XTimeFormatter_format_iso_datetime')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeFormatter_format_iso_datetime')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeFormatter_format_iso_datetime(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeLength.g.dart b/pkgs/intl4x/lib/src/bindings/TimeLength.g.dart
deleted file mode 100644
index affc7c5..0000000
--- a/pkgs/intl4x/lib/src/bindings/TimeLength.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `Time`](https://docs.rs/icu/latest/icu/datetime/options/length/enum.Time.html) for more information.
-enum TimeLength { full, long, medium, short }
diff --git a/pkgs/intl4x/lib/src/bindings/TimePrecision.g.dart b/pkgs/intl4x/lib/src/bindings/TimePrecision.g.dart
new file mode 100644
index 0000000..e171df9
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimePrecision.g.dart
@@ -0,0 +1,53 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `TimePrecision`](https://docs.rs/icu/2.0.0/icu/datetime/options/enum.TimePrecision.html) for more information.
+///
+/// See the [Rust documentation for `SubsecondDigits`](https://docs.rs/icu/2.0.0/icu/datetime/options/enum.SubsecondDigits.html) for more information.
+enum TimePrecision {
+
+ hour,
+
+ minute,
+
+ minuteOptional,
+
+ second,
+
+ subsecond1,
+
+ subsecond2,
+
+ subsecond3,
+
+ subsecond4,
+
+ subsecond5,
+
+ subsecond6,
+
+ subsecond7,
+
+ subsecond8,
+
+ subsecond9;
+
+ /// See the [Rust documentation for `try_from_int`](https://docs.rs/icu/2.0.0/icu/datetime/options/enum.SubsecondDigits.html#method.try_from_int) for more information.
+ static TimePrecision? fromSubsecondDigits(int digits) {
+ final result = _icu4x_TimePrecision_from_subsecond_digits_mv1(digits);
+ if (!result.isOk) {
+ return null;
+ }
+ return TimePrecision.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_TimePrecision_from_subsecond_digits_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_TimePrecision_from_subsecond_digits_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_TimePrecision_from_subsecond_digits_mv1(int digits);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZone.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZone.g.dart
new file mode 100644
index 0000000..9fffd54
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZone.g.dart
@@ -0,0 +1,98 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `TimeZone`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZone.html) for more information.
+final class TimeZone implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ TimeZone._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_TimeZone_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeZone_destroy_mv1));
+
+ /// The unknown time zone.
+ ///
+ /// See the [Rust documentation for `unknown`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.unknown) for more information.
+ factory TimeZone.unknown() {
+ final result = _icu4x_TimeZone_unknown_mv1();
+ return TimeZone._fromFfi(result, []);
+ }
+
+ /// Whether the time zone is the unknown zone.
+ ///
+ /// See the [Rust documentation for `is_unknown`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZone.html#method.is_unknown) for more information.
+ bool isUnknown() {
+ final result = _icu4x_TimeZone_is_unknown_mv1(_ffi);
+ return result;
+ }
+
+ /// Creates a time zone from a BCP-47 string.
+ ///
+ /// Returns the unknown time zone if the string is not a valid BCP-47 subtag.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZone.html)
+ factory TimeZone.fromBcp47(String id) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_TimeZone_create_from_bcp47_mv1(id._utf8AllocIn(temp.arena));
+ return TimeZone._fromFfi(result, []);
+ }
+
+ /// See the [Rust documentation for `with_offset`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZone.html#method.with_offset) for more information.
+ TimeZoneInfo withOffset(UtcOffset offset) {
+ final result = _icu4x_TimeZone_with_offset_mv1(_ffi, offset._ffi);
+ return TimeZoneInfo._fromFfi(result, []);
+ }
+
+ /// See the [Rust documentation for `without_offset`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZone.html#method.without_offset) for more information.
+ TimeZoneInfo withoutOffset() {
+ final result = _icu4x_TimeZone_without_offset_mv1(_ffi);
+ return TimeZoneInfo._fromFfi(result, []);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_TimeZone_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TimeZone_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_TimeZone_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_TimeZone_unknown_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_TimeZone_unknown_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZone_unknown_mv1();
+
+@_DiplomatFfiUse('icu4x_TimeZone_is_unknown_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZone_is_unknown_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_TimeZone_is_unknown_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_TimeZone_create_from_bcp47_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_TimeZone_create_from_bcp47_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZone_create_from_bcp47_mv1(_SliceUtf8 id);
+
+@_DiplomatFfiUse('icu4x_TimeZone_with_offset_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZone_with_offset_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZone_with_offset_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> offset);
+
+@_DiplomatFfiUse('icu4x_TimeZone_without_offset_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZone_without_offset_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZone_without_offset_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonical.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonical.g.dart
new file mode 100644
index 0000000..f8b8ccd
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonical.g.dart
@@ -0,0 +1,55 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _TimeZoneAndCanonicalFfi extends ffi.Struct {
+ external ffi.Pointer<ffi.Opaque> timeZone;
+ external _SliceUtf8 canonical;
+}
+
+/// See the [Rust documentation for `TimeZoneAndCanonical`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneAndCanonical.html) for more information.
+final class TimeZoneAndCanonical {
+ final TimeZone timeZone;
+ final String canonical;
+
+ // ignore: unused_element
+ TimeZoneAndCanonical._fromFfi(_TimeZoneAndCanonicalFfi ffi, core.List<Object> aEdges) :
+ timeZone = TimeZone._fromFfi(ffi.timeZone, []),
+ canonical = ffi.canonical._toDart(aEdges);
+
+ // If this struct contains any slices, their lifetime-edge-relevant objects (typically _FinalizedArenas) will only
+ // be constructed here, and can be appended to any relevant lifetime arrays here. <lifetime>AppendArray accepts a list
+ // of arrays for each lifetime to do so. It accepts multiple lists per lifetime in case the caller needs to tie a lifetime to multiple
+ // output arrays. Null is equivalent to an empty list: this lifetime is not being borrowed from.
+ // ignore: unused_element
+ _TimeZoneAndCanonicalFfi _toFfi(ffi.Allocator temp, {core.List<core.List<Object>> aAppendArray = const []}) {
+ final struct = ffi.Struct.create<_TimeZoneAndCanonicalFfi>();
+ struct.timeZone = timeZone._ffi;
+ struct.canonical = canonical._utf8AllocIn(aAppendArray.isNotEmpty ? _FinalizedArena.withLifetime(aAppendArray).arena : temp);
+ return struct;
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is TimeZoneAndCanonical &&
+ other.timeZone == timeZone &&
+ other.canonical == canonical;
+
+ @override
+ int get hashCode => Object.hashAll([
+ timeZone,
+ canonical,
+ ]);
+
+ // Return all fields corresponding to lifetime `'a`
+ // without handling lifetime dependencies (this is the job of the caller)
+ // This is all fields that may be borrowed from if borrowing `'a`,
+ // assuming that there are no `'other: a`. bounds. In case of such bounds,
+ // the caller should take care to also call _fieldsForLifetimeOther
+ // ignore: unused_element
+ core.List<Object> get _fieldsForLifetimeA => [canonical];
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalAndNormalized.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalAndNormalized.g.dart
new file mode 100644
index 0000000..f79c856
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalAndNormalized.g.dart
@@ -0,0 +1,61 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _TimeZoneAndCanonicalAndNormalizedFfi extends ffi.Struct {
+ external ffi.Pointer<ffi.Opaque> timeZone;
+ external _SliceUtf8 canonical;
+ external _SliceUtf8 normalized;
+}
+
+/// See the [Rust documentation for `TimeZoneAndCanonicalAndNormalized`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneAndCanonicalAndNormalized.html) for more information.
+final class TimeZoneAndCanonicalAndNormalized {
+ final TimeZone timeZone;
+ final String canonical;
+ final String normalized;
+
+ // ignore: unused_element
+ TimeZoneAndCanonicalAndNormalized._fromFfi(_TimeZoneAndCanonicalAndNormalizedFfi ffi, core.List<Object> aEdges) :
+ timeZone = TimeZone._fromFfi(ffi.timeZone, []),
+ canonical = ffi.canonical._toDart(aEdges),
+ normalized = ffi.normalized._toDart(aEdges);
+
+ // If this struct contains any slices, their lifetime-edge-relevant objects (typically _FinalizedArenas) will only
+ // be constructed here, and can be appended to any relevant lifetime arrays here. <lifetime>AppendArray accepts a list
+ // of arrays for each lifetime to do so. It accepts multiple lists per lifetime in case the caller needs to tie a lifetime to multiple
+ // output arrays. Null is equivalent to an empty list: this lifetime is not being borrowed from.
+ // ignore: unused_element
+ _TimeZoneAndCanonicalAndNormalizedFfi _toFfi(ffi.Allocator temp, {core.List<core.List<Object>> aAppendArray = const []}) {
+ final struct = ffi.Struct.create<_TimeZoneAndCanonicalAndNormalizedFfi>();
+ struct.timeZone = timeZone._ffi;
+ struct.canonical = canonical._utf8AllocIn(aAppendArray.isNotEmpty ? _FinalizedArena.withLifetime(aAppendArray).arena : temp);
+ struct.normalized = normalized._utf8AllocIn(aAppendArray.isNotEmpty ? _FinalizedArena.withLifetime(aAppendArray).arena : temp);
+ return struct;
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is TimeZoneAndCanonicalAndNormalized &&
+ other.timeZone == timeZone &&
+ other.canonical == canonical &&
+ other.normalized == normalized;
+
+ @override
+ int get hashCode => Object.hashAll([
+ timeZone,
+ canonical,
+ normalized,
+ ]);
+
+ // Return all fields corresponding to lifetime `'a`
+ // without handling lifetime dependencies (this is the job of the caller)
+ // This is all fields that may be borrowed from if borrowing `'a`,
+ // assuming that there are no `'other: a`. bounds. In case of such bounds,
+ // the caller should take care to also call _fieldsForLifetimeOther
+ // ignore: unused_element
+ core.List<Object> get _fieldsForLifetimeA => [canonical, normalized];
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalAndNormalizedIterator.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalAndNormalizedIterator.g.dart
new file mode 100644
index 0000000..88191be
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalAndNormalizedIterator.g.dart
@@ -0,0 +1,63 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `TimeZoneAndCanonicalAndNormalizedIter`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneAndCanonicalAndNormalizedIter.html) for more information.
+final class TimeZoneAndCanonicalAndNormalizedIterator implements ffi.Finalizable, core.Iterator<TimeZoneAndCanonicalAndNormalized> {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+ // ignore: unused_field
+ final core.List<Object> _aEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ TimeZoneAndCanonicalAndNormalizedIterator._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_TimeZoneAndCanonicalAndNormalizedIterator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeZoneAndCanonicalAndNormalizedIterator_destroy_mv1));
+
+ TimeZoneAndCanonicalAndNormalized? _current;
+
+ @override
+ TimeZoneAndCanonicalAndNormalized get current => _current!;
+
+ @override
+ bool moveNext() {
+ _current = _iteratorNext();
+ return _current != null;
+ }
+
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneAndCanonicalAndNormalizedIter.html#method.next) for more information.
+ TimeZoneAndCanonicalAndNormalized? _iteratorNext() {
+ // This lifetime edge depends on lifetimes: 'a
+ core.List<Object> aEdges = [this];
+ final result = _icu4x_TimeZoneAndCanonicalAndNormalizedIterator_next_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return TimeZoneAndCanonicalAndNormalized._fromFfi(result.union.ok, aEdges);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_TimeZoneAndCanonicalAndNormalizedIterator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TimeZoneAndCanonicalAndNormalizedIterator_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_TimeZoneAndCanonicalAndNormalizedIterator_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_TimeZoneAndCanonicalAndNormalizedIterator_next_mv1')
+@ffi.Native<_ResultTimeZoneAndCanonicalAndNormalizedFfiVoid Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneAndCanonicalAndNormalizedIterator_next_mv1')
+// ignore: non_constant_identifier_names
+external _ResultTimeZoneAndCanonicalAndNormalizedFfiVoid _icu4x_TimeZoneAndCanonicalAndNormalizedIterator_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalIterator.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalIterator.g.dart
new file mode 100644
index 0000000..2401f2e
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneAndCanonicalIterator.g.dart
@@ -0,0 +1,63 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `TimeZoneAndCanonicalIter`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneAndCanonicalIter.html) for more information.
+final class TimeZoneAndCanonicalIterator implements ffi.Finalizable, core.Iterator<TimeZoneAndCanonical> {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+ // ignore: unused_field
+ final core.List<Object> _aEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ TimeZoneAndCanonicalIterator._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_TimeZoneAndCanonicalIterator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeZoneAndCanonicalIterator_destroy_mv1));
+
+ TimeZoneAndCanonical? _current;
+
+ @override
+ TimeZoneAndCanonical get current => _current!;
+
+ @override
+ bool moveNext() {
+ _current = _iteratorNext();
+ return _current != null;
+ }
+
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneAndCanonicalIter.html#method.next) for more information.
+ TimeZoneAndCanonical? _iteratorNext() {
+ // This lifetime edge depends on lifetimes: 'a
+ core.List<Object> aEdges = [this];
+ final result = _icu4x_TimeZoneAndCanonicalIterator_next_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return TimeZoneAndCanonical._fromFfi(result.union.ok, aEdges);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_TimeZoneAndCanonicalIterator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TimeZoneAndCanonicalIterator_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_TimeZoneAndCanonicalIterator_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_TimeZoneAndCanonicalIterator_next_mv1')
+@ffi.Native<_ResultTimeZoneAndCanonicalFfiVoid Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneAndCanonicalIterator_next_mv1')
+// ignore: non_constant_identifier_names
+external _ResultTimeZoneAndCanonicalFfiVoid _icu4x_TimeZoneAndCanonicalIterator_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneFormatter.g.dart
index 51273f6..1bad7d1 100644
--- a/pkgs/intl4x/lib/src/bindings/TimeZoneFormatter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneFormatter.g.dart
@@ -1,10 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X TimeZoneFormatter object capable of formatting an [`CustomTimeZone`] type (and others) as a string
-///
-/// See the [Rust documentation for `TimeZoneFormatter`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html) for more information.
+/// See the [Rust documentation for `NoCalendarFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/type.NoCalendarFormatter.html) for more information.
final class TimeZoneFormatter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,355 +21,367 @@
}
}
- @_DiplomatFfiUse('ICU4XTimeZoneFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XTimeZoneFormatter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_TimeZoneFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeZoneFormatter_destroy_mv1));
- /// Creates a new [`TimeZoneFormatter`] from locale data.
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// Uses localized GMT as the fallback format.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new) for more information.
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html)
- ///
- /// Throws [Error] on failure.
- factory TimeZoneFormatter.withLocalizedGmtFallback(
- DataProvider provider,
- Locale locale,
- ) {
- final result = _ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback(
- provider._ffi,
- locale._ffi,
- );
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.specificLong(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_specific_long_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Creates a new [`TimeZoneFormatter`] from locale data.
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// Uses ISO-8601 as the fallback format.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new) for more information.
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
///
- /// Additional information: [1](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html)
- ///
- /// Throws [Error] on failure.
- factory TimeZoneFormatter.withIso8601Fallback(
- DataProvider provider,
- Locale locale,
- IsoTimeZoneOptions options,
- ) {
- final temp = ffi2.Arena();
- final result = _ICU4XTimeZoneFormatter_create_with_iso_8601_fallback(
- provider._ffi,
- locale._ffi,
- options._toFfi(temp),
- );
- temp.releaseAll();
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.specificLongWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_specific_long_with_provider_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Loads generic non-location long format. Example: "Pacific Time"
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `include_generic_non_location_long`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_non_location_long) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- void loadGenericNonLocationLong(DataProvider provider) {
- final result = _ICU4XTimeZoneFormatter_load_generic_non_location_long(
- _ffi,
- provider._ffi,
- );
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.specificShort(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_specific_short_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Loads generic non-location short format. Example: "PT"
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `include_generic_non_location_short`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_non_location_short) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- void loadGenericNonLocationShort(DataProvider provider) {
- final result = _ICU4XTimeZoneFormatter_load_generic_non_location_short(
- _ffi,
- provider._ffi,
- );
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.specificShortWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_specific_short_with_provider_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Loads specific non-location long format. Example: "Pacific Standard Time"
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `include_specific_non_location_long`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_specific_non_location_long) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- void loadSpecificNonLocationLong(DataProvider provider) {
- final result = _ICU4XTimeZoneFormatter_load_specific_non_location_long(
- _ffi,
- provider._ffi,
- );
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.localizedOffsetLong(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_localized_offset_long_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Loads specific non-location short format. Example: "PST"
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `include_specific_non_location_short`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_specific_non_location_short) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- void loadSpecificNonLocationShort(DataProvider provider) {
- final result = _ICU4XTimeZoneFormatter_load_specific_non_location_short(
- _ffi,
- provider._ffi,
- );
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.localizedOffsetLongWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_localized_offset_long_with_provider_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Loads generic location format. Example: "Los Angeles Time"
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `include_generic_location_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_location_format) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- void loadGenericLocationFormat(DataProvider provider) {
- final result = _ICU4XTimeZoneFormatter_load_generic_location_format(
- _ffi,
- provider._ffi,
- );
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.localizedOffsetShort(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_localized_offset_short_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Loads localized GMT format. Example: "GMT-07:00"
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `include_localized_gmt_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_localized_gmt_format) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- void includeLocalizedGmtFormat() {
- final result = _ICU4XTimeZoneFormatter_include_localized_gmt_format(_ffi);
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.localizedOffsetShortWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_localized_offset_short_with_provider_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Loads ISO-8601 format. Example: "-07:00"
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `include_iso_8601_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_iso_8601_format) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- void loadIso8601Format(IsoTimeZoneOptions options) {
- final temp = ffi2.Arena();
- final result = _ICU4XTimeZoneFormatter_load_iso_8601_format(
- _ffi,
- options._toFfi(temp),
- );
- temp.releaseAll();
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.genericLong(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_generic_long_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`CustomTimeZone`] to a string.
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// See the [Rust documentation for `format_to_string`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format_to_string) for more information.
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
///
- /// Throws [Error] on failure.
- String formatCustomTimeZone(CustomTimeZone value) {
- final writeable = _Writeable();
- final result = _ICU4XTimeZoneFormatter_format_custom_time_zone(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.genericLongWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_generic_long_with_provider_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`CustomTimeZone`] to a string, performing no fallback
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `write_no_fallback`](https://docs.rs/icu/latest/icu/datetime/struct.FormattedTimeZone.html#method.write_no_fallback) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- String formatCustomTimeZoneNoFallback(CustomTimeZone value) {
- final writeable = _Writeable();
- final result = _ICU4XTimeZoneFormatter_format_custom_time_zone_no_fallback(
- _ffi,
- value._ffi,
- writeable._ffi,
- );
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.genericShort(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_generic_short_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
}
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.genericShortWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_generic_short_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.location(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_location_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.locationWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_location_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.exemplarCity(Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_exemplar_city_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory TimeZoneFormatter.exemplarCityWithProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_TimeZoneFormatter_create_exemplar_city_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return TimeZoneFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
+ ///
+ /// Throws [DateTimeWriteError] on failure.
+ String format(TimeZoneInfo zone) {
+ final write = _Write();
+ final result = _icu4x_TimeZoneFormatter_format_mv1(_ffi, zone._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeWriteError.values[result.union.err];
+ }
+ return write.finalize();
+ }
+
}
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneFormatter_destroy',
-)
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XTimeZoneFormatter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_TimeZoneFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback',
-)
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_specific_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_specific_long_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_specific_long_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_create_with_iso_8601_fallback')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- _IsoTimeZoneOptionsFfi,
- )
->(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_create_with_iso_8601_fallback')
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_specific_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_specific_long_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XTimeZoneFormatter_create_with_iso_8601_fallback(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- _IsoTimeZoneOptionsFfi options,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_specific_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_load_generic_non_location_long')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_generic_non_location_long')
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_specific_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_specific_short_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XTimeZoneFormatter_load_generic_non_location_long(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_specific_short_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_load_generic_non_location_short')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneFormatter_load_generic_non_location_short',
-)
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_specific_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_specific_short_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XTimeZoneFormatter_load_generic_non_location_short(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_specific_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_load_specific_non_location_long')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneFormatter_load_specific_non_location_long',
-)
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_localized_offset_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_localized_offset_long_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XTimeZoneFormatter_load_specific_non_location_long(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_localized_offset_long_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_load_specific_non_location_short')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneFormatter_load_specific_non_location_short',
-)
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_localized_offset_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_localized_offset_long_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XTimeZoneFormatter_load_specific_non_location_short(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_localized_offset_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_load_generic_location_format')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_generic_location_format')
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_localized_offset_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_localized_offset_short_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_generic_location_format(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_localized_offset_short_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_include_localized_gmt_format')
-@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneFormatter_include_localized_gmt_format',
-)
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_localized_offset_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_localized_offset_short_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneFormatter_include_localized_gmt_format(
- ffi.Pointer<ffi.Opaque> self,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_localized_offset_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_load_iso_8601_format')
-@ffi.Native<
- _ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, _IsoTimeZoneOptionsFfi)
->(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_iso_8601_format')
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_generic_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_generic_long_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_iso_8601_format(
- ffi.Pointer<ffi.Opaque> self,
- _IsoTimeZoneOptionsFfi options,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_generic_long_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_format_custom_time_zone')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_format_custom_time_zone')
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_generic_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_generic_long_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneFormatter_format_custom_time_zone(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_generic_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XTimeZoneFormatter_format_custom_time_zone_no_fallback')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneFormatter_format_custom_time_zone_no_fallback',
-)
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_generic_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_generic_short_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XTimeZoneFormatter_format_custom_time_zone_no_fallback(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> value,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_generic_short_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_generic_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_generic_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_generic_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_location_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_location_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_location_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_location_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_location_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_location_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_exemplar_city_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_exemplar_city_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_exemplar_city_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_create_exemplar_city_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_create_exemplar_city_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_TimeZoneFormatter_create_exemplar_city_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_TimeZoneFormatter_format_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneFormatter_format_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidInt32 _icu4x_TimeZoneFormatter_format_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> zone, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneIdMapper.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneIdMapper.g.dart
deleted file mode 100644
index 8264cf0..0000000
--- a/pkgs/intl4x/lib/src/bindings/TimeZoneIdMapper.g.dart
+++ /dev/null
@@ -1,209 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// A mapper between IANA time zone identifiers and BCP-47 time zone identifiers.
-///
-/// This mapper supports two-way mapping, but it is optimized for the case of IANA to BCP-47.
-/// It also supports normalizing and canonicalizing the IANA strings.
-///
-/// See the [Rust documentation for `TimeZoneIdMapper`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapper.html) for more information.
-final class TimeZoneIdMapper implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- TimeZoneIdMapper._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XTimeZoneIdMapper_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XTimeZoneIdMapper_destroy),
- );
-
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapper.html#method.new) for more information.
- ///
- /// Throws [Error] on failure.
- factory TimeZoneIdMapper(DataProvider provider) {
- final result = _ICU4XTimeZoneIdMapper_create(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return TimeZoneIdMapper._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `iana_to_bcp47`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperBorrowed.html#method.iana_to_bcp47) for more information.
- ///
- /// Throws [Error] on failure.
- String ianaToBcp47(String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XTimeZoneIdMapper_iana_to_bcp47(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// See the [Rust documentation for `normalize_iana`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperBorrowed.html#method.normalize_iana) for more information.
- ///
- /// Throws [Error] on failure.
- String normalizeIana(String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XTimeZoneIdMapper_normalize_iana(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// See the [Rust documentation for `canonicalize_iana`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperBorrowed.html#method.canonicalize_iana) for more information.
- ///
- /// Throws [Error] on failure.
- String canonicalizeIana(String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XTimeZoneIdMapper_canonicalize_iana(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// See the [Rust documentation for `find_canonical_iana_from_bcp47`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperBorrowed.html#method.find_canonical_iana_from_bcp47) for more information.
- ///
- /// Throws [Error] on failure.
- String findCanonicalIanaFromBcp47(String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XTimeZoneIdMapper_find_canonical_iana_from_bcp47(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapper_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneIdMapper_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XTimeZoneIdMapper_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapper_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneIdMapper_create',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XTimeZoneIdMapper_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapper_iana_to_bcp47')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeZoneIdMapper_iana_to_bcp47')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneIdMapper_iana_to_bcp47(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapper_normalize_iana')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeZoneIdMapper_normalize_iana')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneIdMapper_normalize_iana(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapper_canonicalize_iana')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeZoneIdMapper_canonicalize_iana')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneIdMapper_canonicalize_iana(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapper_find_canonical_iana_from_bcp47')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTimeZoneIdMapper_find_canonical_iana_from_bcp47')
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTimeZoneIdMapper_find_canonical_iana_from_bcp47(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneIdMapperWithFastCanonicalization.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneIdMapperWithFastCanonicalization.g.dart
deleted file mode 100644
index 8c6cfdd..0000000
--- a/pkgs/intl4x/lib/src/bindings/TimeZoneIdMapperWithFastCanonicalization.g.dart
+++ /dev/null
@@ -1,161 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// A mapper between IANA time zone identifiers and BCP-47 time zone identifiers.
-///
-/// This mapper supports two-way mapping, but it is optimized for the case of IANA to BCP-47.
-/// It also supports normalizing and canonicalizing the IANA strings.
-///
-/// See the [Rust documentation for `TimeZoneIdMapperWithFastCanonicalization`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperWithFastCanonicalization.html) for more information.
-final class TimeZoneIdMapperWithFastCanonicalization
- implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- TimeZoneIdMapperWithFastCanonicalization._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XTimeZoneIdMapperWithFastCanonicalization_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(
- _ICU4XTimeZoneIdMapperWithFastCanonicalization_destroy,
- ),
- );
-
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperWithFastCanonicalization.html#method.new) for more information.
- ///
- /// Throws [Error] on failure.
- factory TimeZoneIdMapperWithFastCanonicalization(DataProvider provider) {
- final result = _ICU4XTimeZoneIdMapperWithFastCanonicalization_create(
- provider._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return TimeZoneIdMapperWithFastCanonicalization._fromFfi(
- result.union.ok,
- [],
- );
- }
-
- /// See the [Rust documentation for `canonicalize_iana`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperWithFastCanonicalizationBorrowed.html#method.canonicalize_iana) for more information.
- ///
- /// Throws [Error] on failure.
- String canonicalizeIana(String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result =
- _ICU4XTimeZoneIdMapperWithFastCanonicalization_canonicalize_iana(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-
- /// See the [Rust documentation for `canonical_iana_from_bcp47`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneIdMapperWithFastCanonicalizationBorrowed.html#method.canonical_iana_from_bcp47) for more information.
- ///
- /// Throws [Error] on failure.
- String canonicalIanaFromBcp47(String value) {
- final temp = ffi2.Arena();
- final valueView = value.utf8View;
- final writeable = _Writeable();
- final result =
- _ICU4XTimeZoneIdMapperWithFastCanonicalization_canonical_iana_from_bcp47(
- _ffi,
- valueView.allocIn(temp),
- valueView.length,
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
- }
-}
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapperWithFastCanonicalization_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneIdMapperWithFastCanonicalization_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XTimeZoneIdMapperWithFastCanonicalization_destroy(
- ffi.Pointer<ffi.Void> self,
-);
-
-@_DiplomatFfiUse('ICU4XTimeZoneIdMapperWithFastCanonicalization_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneIdMapperWithFastCanonicalization_create',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XTimeZoneIdMapperWithFastCanonicalization_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
-
-@_DiplomatFfiUse(
- 'ICU4XTimeZoneIdMapperWithFastCanonicalization_canonicalize_iana',
-)
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(
- isLeaf: true,
- symbol: 'ICU4XTimeZoneIdMapperWithFastCanonicalization_canonicalize_iana',
-)
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XTimeZoneIdMapperWithFastCanonicalization_canonicalize_iana(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
-
-@_DiplomatFfiUse(
- 'ICU4XTimeZoneIdMapperWithFastCanonicalization_canonical_iana_from_bcp47',
-)
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- )
->(
- isLeaf: true,
- symbol:
- 'ICU4XTimeZoneIdMapperWithFastCanonicalization_canonical_iana_from_bcp47',
-)
-// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XTimeZoneIdMapperWithFastCanonicalization_canonical_iana_from_bcp47(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> valueData,
- int valueLength,
- ffi.Pointer<ffi.Opaque> writeable,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneInfo.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneInfo.g.dart
new file mode 100644
index 0000000..8333236
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneInfo.g.dart
@@ -0,0 +1,147 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `TimeZoneInfo`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html) for more information.
+final class TimeZoneInfo implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ TimeZoneInfo._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_TimeZoneInfo_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeZoneInfo_destroy_mv1));
+
+ /// Creates a time zone for UTC (Coordinated Universal Time).
+ ///
+ /// See the [Rust documentation for `utc`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.utc) for more information.
+ factory TimeZoneInfo.utc() {
+ final result = _icu4x_TimeZoneInfo_utc_mv1();
+ return TimeZoneInfo._fromFfi(result, []);
+ }
+
+ /// Creates a time zone info from parts.
+ factory TimeZoneInfo(TimeZone id, {UtcOffset? offset, TimeZoneVariant? variant}) {
+ final result = _icu4x_TimeZoneInfo_from_parts_mv1(id._ffi, offset?._ffi ?? ffi.Pointer.fromAddress(0), variant != null ? _ResultInt32Void.ok(variant.index) : _ResultInt32Void.err());
+ return TimeZoneInfo._fromFfi(result, []);
+ }
+
+ /// See the [Rust documentation for `id`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.id) for more information.
+ TimeZone id() {
+ final result = _icu4x_TimeZoneInfo_id_mv1(_ffi);
+ return TimeZone._fromFfi(result, []);
+ }
+
+ /// Sets the datetime at which to interpret the time zone
+ /// for display name lookup.
+ ///
+ /// Notes:
+ ///
+ /// - If not set, the formatting datetime is used if possible.
+ /// - The constraints are the same as with `ZoneNameTimestamp` in Rust.
+ /// - Set to year 1000 or 9999 for a reference far in the past or future.
+ ///
+ /// See the [Rust documentation for `at_date_time_iso`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.at_date_time_iso) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.ZoneNameTimestamp.html)
+ TimeZoneInfo atDateTimeIso(IsoDate date, Time time) {
+ final result = _icu4x_TimeZoneInfo_at_date_time_iso_mv1(_ffi, date._ffi, time._ffi);
+ return TimeZoneInfo._fromFfi(result, []);
+ }
+
+ /// See the [Rust documentation for `zone_name_timestamp`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.zone_name_timestamp) for more information.
+ IsoDateTime? zoneNameDateTime() {
+ final result = _icu4x_TimeZoneInfo_zone_name_date_time_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return IsoDateTime._fromFfi(result.union.ok);
+ }
+
+ /// See the [Rust documentation for `with_variant`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.with_variant) for more information.
+ TimeZoneInfo withVariant(TimeZoneVariant timeVariant) {
+ final result = _icu4x_TimeZoneInfo_with_variant_mv1(_ffi, timeVariant.index);
+ return TimeZoneInfo._fromFfi(result, []);
+ }
+
+ /// Infers the zone variant.
+ ///
+ /// Requires the offset and local time to be set.
+ ///
+ /// See the [Rust documentation for `infer_variant`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.infer_variant) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/enum.TimeZoneVariant.html)
+ bool inferVariant(VariantOffsetsCalculator offsetCalculator) {
+ final result = _icu4x_TimeZoneInfo_infer_variant_mv1(_ffi, offsetCalculator._ffi);
+ return result.isOk;
+ }
+
+ /// See the [Rust documentation for `variant`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.variant) for more information.
+ TimeZoneVariant? variant() {
+ final result = _icu4x_TimeZoneInfo_variant_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return TimeZoneVariant.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_TimeZoneInfo_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_utc_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_utc_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZoneInfo_utc_mv1();
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_from_parts_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_from_parts_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZoneInfo_from_parts_mv1(ffi.Pointer<ffi.Opaque> id, ffi.Pointer<ffi.Opaque> offset, _ResultInt32Void variant);
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_id_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_id_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZoneInfo_id_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_at_date_time_iso_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_at_date_time_iso_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZoneInfo_at_date_time_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> date, ffi.Pointer<ffi.Opaque> time);
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_zone_name_date_time_mv1')
+@ffi.Native<_ResultIsoDateTimeFfiVoid Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_zone_name_date_time_mv1')
+// ignore: non_constant_identifier_names
+external _ResultIsoDateTimeFfiVoid _icu4x_TimeZoneInfo_zone_name_date_time_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_with_variant_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_with_variant_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZoneInfo_with_variant_mv1(ffi.Pointer<ffi.Opaque> self, int timeVariant);
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_infer_variant_mv1')
+@ffi.Native<_ResultVoidVoid Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_infer_variant_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidVoid _icu4x_TimeZoneInfo_infer_variant_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> offsetCalculator);
+
+@_DiplomatFfiUse('icu4x_TimeZoneInfo_variant_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_variant_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_TimeZoneInfo_variant_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidOffsetError.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidOffsetError.g.dart
new file mode 100644
index 0000000..04e721e
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneInvalidOffsetError.g.dart
@@ -0,0 +1,20 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.InvalidOffsetError.html)
+final class TimeZoneInvalidOffsetError {
+
+ TimeZoneInvalidOffsetError();
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is TimeZoneInvalidOffsetError;
+
+ @override
+ int get hashCode => 0;
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneIterator.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneIterator.g.dart
new file mode 100644
index 0000000..9d054b9
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneIterator.g.dart
@@ -0,0 +1,58 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `TimeZoneIter`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneIter.html) for more information.
+final class TimeZoneIterator implements ffi.Finalizable, core.Iterator<TimeZone> {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+ // ignore: unused_field
+ final core.List<Object> _aEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ TimeZoneIterator._fromFfi(this._ffi, this._selfEdge, this._aEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_TimeZoneIterator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeZoneIterator_destroy_mv1));
+
+ TimeZone? _current;
+
+ @override
+ TimeZone get current => _current!;
+
+ @override
+ bool moveNext() {
+ _current = _iteratorNext();
+ return _current != null;
+ }
+
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/time/zone/iana/struct.TimeZoneIter.html#method.next) for more information.
+ TimeZone? _iteratorNext() {
+ final result = _icu4x_TimeZoneIterator_next_mv1(_ffi);
+ return result.address == 0 ? null : TimeZone._fromFfi(result, []);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_TimeZoneIterator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TimeZoneIterator_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_TimeZoneIterator_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_TimeZoneIterator_next_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TimeZoneIterator_next_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_TimeZoneIterator_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TimeZoneVariant.g.dart b/pkgs/intl4x/lib/src/bindings/TimeZoneVariant.g.dart
new file mode 100644
index 0000000..a2daca8
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/TimeZoneVariant.g.dart
@@ -0,0 +1,29 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+enum TimeZoneVariant {
+
+ standard,
+
+ daylight;
+
+ /// See the [Rust documentation for `from_rearguard_isdst`](https://docs.rs/icu/2.0.0/icu/time/zone/enum.TimeZoneVariant.html#method.from_rearguard_isdst) for more information.
+ ///
+ /// See the [Rust documentation for `with_variant`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.with_variant) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/enum.TimeZoneVariant.html)
+ static TimeZoneVariant fromRearguardIsdst(bool isdst) {
+ final result = _icu4x_TimeZoneVariant_from_rearguard_isdst_mv1(isdst);
+ return TimeZoneVariant.values[result];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_TimeZoneVariant_from_rearguard_isdst_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Bool)>(isLeaf: true, symbol: 'icu4x_TimeZoneVariant_from_rearguard_isdst_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_TimeZoneVariant_from_rearguard_isdst_mv1(bool isdst);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TitlecaseMapper.g.dart b/pkgs/intl4x/lib/src/bindings/TitlecaseMapper.g.dart
index 95c32d5..39053fa 100644
--- a/pkgs/intl4x/lib/src/bindings/TitlecaseMapper.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/TitlecaseMapper.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `TitlecaseMapper`](https://docs.rs/icu/latest/icu/casemap/struct.TitlecaseMapper.html) for more information.
+/// See the [Rust documentation for `TitlecaseMapper`](https://docs.rs/icu/2.0.0/icu/casemap/struct.TitlecaseMapper.html) for more information.
final class TitlecaseMapper implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -20,20 +21,31 @@
}
}
- @_DiplomatFfiUse('ICU4XTitlecaseMapper_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XTitlecaseMapper_destroy),
- );
+ @_DiplomatFfiUse('icu4x_TitlecaseMapper_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TitlecaseMapper_destroy_mv1));
- /// Construct a new `TitlecaseMapper` instance
+ /// Construct a new `TitlecaseMapper` instance using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/casemap/struct.TitlecaseMapper.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/casemap/struct.TitlecaseMapper.html#method.new) for more information.
///
- /// Throws [Error] on failure.
- factory TitlecaseMapper(DataProvider provider) {
- final result = _ICU4XTitlecaseMapper_create(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory TitlecaseMapper() {
+ final result = _icu4x_TitlecaseMapper_create_mv1();
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return TitlecaseMapper._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct a new `TitlecaseMapper` instance using a particular data source.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/casemap/struct.TitlecaseMapper.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory TitlecaseMapper.withProvider(DataProvider provider) {
+ final result = _icu4x_TitlecaseMapper_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return TitlecaseMapper._fromFfi(result.union.ok, []);
}
@@ -42,64 +54,51 @@
///
/// The `v1` refers to the version of the options struct, which may change as we add more options
///
- /// See the [Rust documentation for `titlecase_segment`](https://docs.rs/icu/latest/icu/casemap/struct.TitlecaseMapper.html#method.titlecase_segment) for more information.
- ///
- /// Throws [Error] on failure.
+ /// See the [Rust documentation for `titlecase_segment`](https://docs.rs/icu/2.0.0/icu/casemap/struct.TitlecaseMapperBorrowed.html#method.titlecase_segment) for more information.
String titlecaseSegment(String s, Locale locale, TitlecaseOptions options) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final writeable = _Writeable();
- final result = _ICU4XTitlecaseMapper_titlecase_segment_v1(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- locale._ffi,
- options._toFfi(temp),
- writeable._ffi,
- );
- temp.releaseAll();
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return writeable.finalize();
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_TitlecaseMapper_titlecase_segment_v1_mv1(_ffi, s._utf8AllocIn(temp.arena), locale._ffi, options._toFfi(temp.arena), write._ffi);
+ return write.finalize();
}
+
+ /// Returns the full titlecase mapping of the given string, using compiled data (avoids having to allocate a TitlecaseMapper object)
+ ///
+ /// The `v1` refers to the version of the options struct, which may change as we add more options
+ ///
+ /// See the [Rust documentation for `titlecase_segment`](https://docs.rs/icu/2.0.0/icu/casemap/struct.TitlecaseMapperBorrowed.html#method.titlecase_segment) for more information.
+ static String titlecaseSegmentWithCompiledData(String s, Locale locale, TitlecaseOptions options) {
+ final temp = _FinalizedArena();
+ final write = _Write();
+ _icu4x_TitlecaseMapper_titlecase_segment_with_compiled_data_v1_mv1(s._utf8AllocIn(temp.arena), locale._ffi, options._toFfi(temp.arena), write._ffi);
+ return write.finalize();
+ }
+
}
-@_DiplomatFfiUse('ICU4XTitlecaseMapper_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XTitlecaseMapper_destroy',
-)
+@_DiplomatFfiUse('icu4x_TitlecaseMapper_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_TitlecaseMapper_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XTitlecaseMapper_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_TitlecaseMapper_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XTitlecaseMapper_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XTitlecaseMapper_create',
-)
+@_DiplomatFfiUse('icu4x_TitlecaseMapper_create_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function()>(isLeaf: true, symbol: 'icu4x_TitlecaseMapper_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XTitlecaseMapper_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_TitlecaseMapper_create_mv1();
-@_DiplomatFfiUse('ICU4XTitlecaseMapper_titlecase_segment_v1')
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint8>,
- ffi.Size,
- ffi.Pointer<ffi.Opaque>,
- _TitlecaseOptionsFfi,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XTitlecaseMapper_titlecase_segment_v1')
+@_DiplomatFfiUse('icu4x_TitlecaseMapper_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TitlecaseMapper_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32 _ICU4XTitlecaseMapper_titlecase_segment_v1(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
- ffi.Pointer<ffi.Opaque> locale,
- _TitlecaseOptionsFfi options,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_TitlecaseMapper_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_TitlecaseMapper_titlecase_segment_v1_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, ffi.Pointer<ffi.Opaque>, _TitlecaseOptionsFfi, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TitlecaseMapper_titlecase_segment_v1_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_TitlecaseMapper_titlecase_segment_v1_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 s, ffi.Pointer<ffi.Opaque> locale, _TitlecaseOptionsFfi options, ffi.Pointer<ffi.Opaque> write);
+
+@_DiplomatFfiUse('icu4x_TitlecaseMapper_titlecase_segment_with_compiled_data_v1_mv1')
+@ffi.Native<ffi.Void Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>, _TitlecaseOptionsFfi, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_TitlecaseMapper_titlecase_segment_with_compiled_data_v1_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_TitlecaseMapper_titlecase_segment_with_compiled_data_v1_mv1(_SliceUtf8 s, ffi.Pointer<ffi.Opaque> locale, _TitlecaseOptionsFfi options, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TitlecaseOptions.g.dart b/pkgs/intl4x/lib/src/bindings/TitlecaseOptions.g.dart
index e99e997..def04c5 100644
--- a/pkgs/intl4x/lib/src/bindings/TitlecaseOptions.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/TitlecaseOptions.g.dart
@@ -1,18 +1,17 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
final class _TitlecaseOptionsFfi extends ffi.Struct {
- @ffi.Int32()
- external int leadingAdjustment;
- @ffi.Int32()
- external int trailingCase;
+ external _ResultInt32Void leadingAdjustment;
+ external _ResultInt32Void trailingCase;
}
-/// See the [Rust documentation for `TitlecaseOptions`](https://docs.rs/icu/latest/icu/casemap/titlecase/struct.TitlecaseOptions.html) for more information.
+/// See the [Rust documentation for `TitlecaseOptions`](https://docs.rs/icu/2.0.0/icu/casemap/options/struct.TitlecaseOptions.html) for more information.
final class TitlecaseOptions {
- LeadingAdjustment leadingAdjustment;
- TrailingCase trailingCase;
+ LeadingAdjustment? leadingAdjustment;
+ TrailingCase? trailingCase;
// This struct contains borrowed fields, so this takes in a list of
// "edges" corresponding to where each lifetime's data may have been borrowed from
@@ -20,24 +19,23 @@
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
- TitlecaseOptions._fromFfi(_TitlecaseOptionsFfi ffi)
- : leadingAdjustment = LeadingAdjustment.values[ffi.leadingAdjustment],
- trailingCase = TrailingCase.values[ffi.trailingCase];
+ TitlecaseOptions._fromFfi(_TitlecaseOptionsFfi ffi) :
+ leadingAdjustment = ffi.leadingAdjustment.isOk ? LeadingAdjustment.values[ffi.leadingAdjustment.union.ok] : null,
+ trailingCase = ffi.trailingCase.isOk ? TrailingCase.values[ffi.trailingCase.union.ok] : null;
// ignore: unused_element
_TitlecaseOptionsFfi _toFfi(ffi.Allocator temp) {
final struct = ffi.Struct.create<_TitlecaseOptionsFfi>();
- struct.leadingAdjustment = leadingAdjustment.index;
- struct.trailingCase = trailingCase.index;
+ LeadingAdjustment? leadingAdjustment = this.leadingAdjustment;
+ struct.leadingAdjustment = leadingAdjustment != null ? _ResultInt32Void.ok(leadingAdjustment.index) : _ResultInt32Void.err();
+ TrailingCase? trailingCase = this.trailingCase;
+ struct.trailingCase = trailingCase != null ? _ResultInt32Void.ok(trailingCase.index) : _ResultInt32Void.err();
return struct;
}
- /// See the [Rust documentation for `default`](https://docs.rs/icu/latest/icu/casemap/titlecase/struct.TitlecaseOptions.html#method.default) for more information.
- factory TitlecaseOptions({
- LeadingAdjustment? leadingAdjustment,
- TrailingCase? trailingCase,
- }) {
- final result = _ICU4XTitlecaseOptionsV1_default_options();
+ /// See the [Rust documentation for `default`](https://docs.rs/icu/2.0.0/icu/casemap/options/struct.TitlecaseOptions.html#method.default) for more information.
+ factory TitlecaseOptions({LeadingAdjustment? leadingAdjustment, TrailingCase? trailingCase}) {
+ final result = _icu4x_TitlecaseOptionsV1_default_mv1();
final dart = TitlecaseOptions._fromFfi(result);
if (leadingAdjustment != null) {
dart.leadingAdjustment = leadingAdjustment;
@@ -48,6 +46,7 @@
return dart;
}
+
@override
bool operator ==(Object other) =>
other is TitlecaseOptions &&
@@ -55,13 +54,15 @@
other.trailingCase == trailingCase;
@override
- int get hashCode => Object.hashAll([leadingAdjustment, trailingCase]);
+ int get hashCode => Object.hashAll([
+ leadingAdjustment,
+ trailingCase,
+ ]);
}
-@_DiplomatFfiUse('ICU4XTitlecaseOptionsV1_default_options')
-@ffi.Native<_TitlecaseOptionsFfi Function()>(
- isLeaf: true,
- symbol: 'ICU4XTitlecaseOptionsV1_default_options',
-)
+@_DiplomatFfiUse('icu4x_TitlecaseOptionsV1_default_mv1')
+@ffi.Native<_TitlecaseOptionsFfi Function()>(isLeaf: true, symbol: 'icu4x_TitlecaseOptionsV1_default_mv1')
// ignore: non_constant_identifier_names
-external _TitlecaseOptionsFfi _ICU4XTitlecaseOptionsV1_default_options();
+external _TitlecaseOptionsFfi _icu4x_TitlecaseOptionsV1_default_mv1();
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TrailingCase.g.dart b/pkgs/intl4x/lib/src/bindings/TrailingCase.g.dart
index dfebe66..e9774d0 100644
--- a/pkgs/intl4x/lib/src/bindings/TrailingCase.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/TrailingCase.g.dart
@@ -1,6 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `TrailingCase`](https://docs.rs/icu/latest/icu/casemap/titlecase/enum.TrailingCase.html) for more information.
-enum TrailingCase { lower, unchanged }
+/// See the [Rust documentation for `TrailingCase`](https://docs.rs/icu/2.0.0/icu/casemap/options/enum.TrailingCase.html) for more information.
+enum TrailingCase {
+
+ lower,
+
+ unchanged;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/TransformResult.g.dart b/pkgs/intl4x/lib/src/bindings/TransformResult.g.dart
index 62d9dc1..e39a227 100644
--- a/pkgs/intl4x/lib/src/bindings/TransformResult.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/TransformResult.g.dart
@@ -1,6 +1,15 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `TransformResult`](https://docs.rs/icu/latest/icu/locid_transform/enum.TransformResult.html) for more information.
-enum TransformResult { modified, unmodified }
+/// See the [Rust documentation for `TransformResult`](https://docs.rs/icu/2.0.0/icu/locale/enum.TransformResult.html) for more information.
+enum TransformResult {
+
+ modified,
+
+ unmodified;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/UnicodeSetData.g.dart b/pkgs/intl4x/lib/src/bindings/UnicodeSetData.g.dart
deleted file mode 100644
index 21ccf65..0000000
--- a/pkgs/intl4x/lib/src/bindings/UnicodeSetData.g.dart
+++ /dev/null
@@ -1,236 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// An ICU4X Unicode Set Property object, capable of querying whether a code point is contained in a set based on a Unicode property.
-///
-/// See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information.
-///
-/// See the [Rust documentation for `UnicodeSetData`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetData.html) for more information.
-///
-/// See the [Rust documentation for `UnicodeSetDataBorrowed`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html) for more information.
-final class UnicodeSetData implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- UnicodeSetData._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XUnicodeSetData_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XUnicodeSetData_destroy),
- );
-
- /// Checks whether the string is in the set.
- ///
- /// See the [Rust documentation for `contains`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html#method.contains) for more information.
- bool contains(String s) {
- final temp = ffi2.Arena();
- final sView = s.utf8View;
- final result = _ICU4XUnicodeSetData_contains(
- _ffi,
- sView.allocIn(temp),
- sView.length,
- );
- temp.releaseAll();
- return result;
- }
-
- /// Checks whether the code point is in the set.
- ///
- /// See the [Rust documentation for `contains_char`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html#method.contains_char) for more information.
- bool containsChar(Rune cp) {
- final result = _ICU4XUnicodeSetData_contains_char(_ffi, cp);
- return result;
- }
-
- /// See the [Rust documentation for `basic_emoji`](https://docs.rs/icu/latest/icu/properties/sets/fn.basic_emoji.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory UnicodeSetData.basicEmoji(DataProvider provider) {
- final result = _ICU4XUnicodeSetData_load_basic_emoji(provider._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return UnicodeSetData._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `exemplars_main`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_main.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory UnicodeSetData.exemplarsMain(DataProvider provider, Locale locale) {
- final result = _ICU4XUnicodeSetData_load_exemplars_main(
- provider._ffi,
- locale._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return UnicodeSetData._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `exemplars_auxiliary`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_auxiliary.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory UnicodeSetData.exemplarsAuxiliary(
- DataProvider provider,
- Locale locale,
- ) {
- final result = _ICU4XUnicodeSetData_load_exemplars_auxiliary(
- provider._ffi,
- locale._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return UnicodeSetData._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `exemplars_punctuation`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_punctuation.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory UnicodeSetData.exemplarsPunctuation(
- DataProvider provider,
- Locale locale,
- ) {
- final result = _ICU4XUnicodeSetData_load_exemplars_punctuation(
- provider._ffi,
- locale._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return UnicodeSetData._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `exemplars_numbers`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_numbers.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory UnicodeSetData.exemplarsNumbers(
- DataProvider provider,
- Locale locale,
- ) {
- final result = _ICU4XUnicodeSetData_load_exemplars_numbers(
- provider._ffi,
- locale._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return UnicodeSetData._fromFfi(result.union.ok, []);
- }
-
- /// See the [Rust documentation for `exemplars_index`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_index.html) for more information.
- ///
- /// Throws [Error] on failure.
- factory UnicodeSetData.exemplarsIndex(DataProvider provider, Locale locale) {
- final result = _ICU4XUnicodeSetData_load_exemplars_index(
- provider._ffi,
- locale._ffi,
- );
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return UnicodeSetData._fromFfi(result.union.ok, []);
- }
-}
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XUnicodeSetData_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XUnicodeSetData_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_contains')
-@ffi.Native<
- ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Uint8>, ffi.Size)
->(isLeaf: true, symbol: 'ICU4XUnicodeSetData_contains')
-// ignore: non_constant_identifier_names
-external bool _ICU4XUnicodeSetData_contains(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint8> sData,
- int sLength,
-);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_contains_char')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Uint32)>(
- isLeaf: true,
- symbol: 'ICU4XUnicodeSetData_contains_char',
-)
-// ignore: non_constant_identifier_names
-external bool _ICU4XUnicodeSetData_contains_char(
- ffi.Pointer<ffi.Opaque> self,
- Rune cp,
-);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_load_basic_emoji')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XUnicodeSetData_load_basic_emoji',
-)
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_basic_emoji(
- ffi.Pointer<ffi.Opaque> provider,
-);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_load_exemplars_main')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_main')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_main(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_load_exemplars_auxiliary')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_auxiliary')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_auxiliary(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_load_exemplars_punctuation')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_punctuation')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_punctuation(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_load_exemplars_numbers')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_numbers')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_numbers(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
-
-@_DiplomatFfiUse('ICU4XUnicodeSetData_load_exemplars_index')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_index')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_index(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/UnitsConverter.g.dart b/pkgs/intl4x/lib/src/bindings/UnitsConverter.g.dart
index 5385afc..f7b790a 100644
--- a/pkgs/intl4x/lib/src/bindings/UnitsConverter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/UnitsConverter.g.dart
@@ -1,12 +1,13 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X Units Converter object, capable of converting between two [`MeasureUnit`]s.
+/// An ICU4X Units Converter object, capable of converting between two [MeasureUnit]s.
///
-/// You can create an instance of this object using [`UnitsConverterFactory`] by calling the `converter` method.
+/// You can create an instance of this object using [UnitsConverterFactory] by calling the `converter` method.
///
-/// See the [Rust documentation for `UnitsConverter`](https://docs.rs/icu/latest/icu/experimental/units/converter/struct.UnitsConverter.html) for more information.
+/// See the [Rust documentation for `UnitsConverter`](https://docs.rs/icu/2.0.0/icu/experimental/units/converter/struct.UnitsConverter.html) for more information.
final class UnitsConverter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,55 +25,42 @@
}
}
- @_DiplomatFfiUse('ICU4XUnitsConverter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XUnitsConverter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_UnitsConverter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_UnitsConverter_destroy_mv1));
- /// Converts the input value in float from the input unit to the output unit (that have been used to create this converter).
+ /// Converts the input value from the input unit to the output unit (that have been used to create this converter).
/// NOTE:
/// The conversion using floating-point operations is not as accurate as the conversion using ratios.
///
- /// See the [Rust documentation for `convert`](https://docs.rs/icu/latest/icu/experimental/units/converter/struct.UnitsConverter.html#method.convert) for more information.
+ /// See the [Rust documentation for `convert`](https://docs.rs/icu/2.0.0/icu/experimental/units/converter/struct.UnitsConverter.html#method.convert) for more information.
double convertDouble(double value) {
- final result = _ICU4XUnitsConverter_convert_f64(_ffi, value);
+ final result = _icu4x_UnitsConverter_convert_double_mv1(_ffi, value);
return result;
}
- /// Clones the current [`UnitsConverter`] object.
+ /// Clones the current [UnitsConverter] object.
///
- /// See the [Rust documentation for `clone`](https://docs.rs/icu/latest/icu/experimental/units/converter/struct.UnitsConverter.html#method.clone) for more information.
+ /// See the [Rust documentation for `clone`](https://docs.rs/icu/2.0.0/icu/experimental/units/converter/struct.UnitsConverter.html#method.clone) for more information.
UnitsConverter clone() {
- final result = _ICU4XUnitsConverter_clone(_ffi);
+ final result = _icu4x_UnitsConverter_clone_mv1(_ffi);
return UnitsConverter._fromFfi(result, []);
}
+
}
-@_DiplomatFfiUse('ICU4XUnitsConverter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XUnitsConverter_destroy',
-)
+@_DiplomatFfiUse('icu4x_UnitsConverter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_UnitsConverter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XUnitsConverter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_UnitsConverter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XUnitsConverter_convert_f64')
-@ffi.Native<ffi.Double Function(ffi.Pointer<ffi.Opaque>, ffi.Double)>(
- isLeaf: true,
- symbol: 'ICU4XUnitsConverter_convert_f64',
-)
+@_DiplomatFfiUse('icu4x_UnitsConverter_convert_double_mv1')
+@ffi.Native<ffi.Double Function(ffi.Pointer<ffi.Opaque>, ffi.Double)>(isLeaf: true, symbol: 'icu4x_UnitsConverter_convert_double_mv1')
// ignore: non_constant_identifier_names
-external double _ICU4XUnitsConverter_convert_f64(
- ffi.Pointer<ffi.Opaque> self,
- double value,
-);
+external double _icu4x_UnitsConverter_convert_double_mv1(ffi.Pointer<ffi.Opaque> self, double value);
-@_DiplomatFfiUse('ICU4XUnitsConverter_clone')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XUnitsConverter_clone',
-)
+@_DiplomatFfiUse('icu4x_UnitsConverter_clone_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UnitsConverter_clone_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XUnitsConverter_clone(
- ffi.Pointer<ffi.Opaque> self,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_UnitsConverter_clone_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/UnitsConverterFactory.g.dart b/pkgs/intl4x/lib/src/bindings/UnitsConverterFactory.g.dart
index b53c401..aa932ea 100644
--- a/pkgs/intl4x/lib/src/bindings/UnitsConverterFactory.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/UnitsConverterFactory.g.dart
@@ -1,12 +1,14 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An ICU4X Units Converter Factory object, capable of creating converters a [`UnitsConverter`]
-/// for converting between two [`MeasureUnit`]s.
-/// Also, it can parse the CLDR unit identifier (e.g. `meter-per-square-second`) and get the [`MeasureUnit`].
+/// An ICU4X Units Converter Factory object, capable of creating converters a [UnitsConverter]
+/// for converting between two [MeasureUnit]s.
///
-/// See the [Rust documentation for `ConverterFactory`](https://docs.rs/icu/latest/icu/experimental/units/converter_factory/struct.ConverterFactory.html) for more information.
+/// Also, it can parse the CLDR unit identifier (e.g. `meter-per-square-second`) and get the [MeasureUnit].
+///
+/// See the [Rust documentation for `ConverterFactory`](https://docs.rs/icu/2.0.0/icu/experimental/units/converter_factory/struct.ConverterFactory.html) for more information.
final class UnitsConverterFactory implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -24,88 +26,60 @@
}
}
- @_DiplomatFfiUse('ICU4XUnitsConverterFactory_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XUnitsConverterFactory_destroy),
- );
+ @_DiplomatFfiUse('icu4x_UnitsConverterFactory_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_UnitsConverterFactory_destroy_mv1));
- /// Construct a new [`UnitsConverterFactory`] instance.
+ /// Construct a new [UnitsConverterFactory] instance using compiled data.
///
- /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/experimental/units/converter_factory/struct.ConverterFactory.html#method.new) for more information.
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/experimental/units/converter_factory/struct.ConverterFactory.html#method.new) for more information.
+ factory UnitsConverterFactory() {
+ final result = _icu4x_UnitsConverterFactory_create_mv1();
+ return UnitsConverterFactory._fromFfi(result, []);
+ }
+
+ /// Construct a new [UnitsConverterFactory] instance using a particular data source.
///
- /// Throws [Error] on failure.
- factory UnitsConverterFactory(DataProvider provider) {
- final result = _ICU4XUnitsConverterFactory_create(provider._ffi);
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/experimental/units/converter_factory/struct.ConverterFactory.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory UnitsConverterFactory.withProvider(DataProvider provider) {
+ final result = _icu4x_UnitsConverterFactory_create_with_provider_mv1(provider._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return UnitsConverterFactory._fromFfi(result.union.ok, []);
}
- /// Creates a new [`UnitsConverter`] from the input and output [`MeasureUnit`]s.
+ /// Creates a new [UnitsConverter] from the input and output [MeasureUnit]s.
/// Returns nothing if the conversion between the two units is not possible.
/// For example, conversion between `meter` and `second` is not possible.
///
- /// See the [Rust documentation for `converter`](https://docs.rs/icu/latest/icu/experimental/units/converter_factory/struct.ConverterFactory.html#method.converter) for more information.
+ /// See the [Rust documentation for `converter`](https://docs.rs/icu/2.0.0/icu/experimental/units/converter_factory/struct.ConverterFactory.html#method.converter) for more information.
UnitsConverter? converter(MeasureUnit from, MeasureUnit to) {
- final result = _ICU4XUnitsConverterFactory_converter(
- _ffi,
- from._ffi,
- to._ffi,
- );
+ final result = _icu4x_UnitsConverterFactory_converter_mv1(_ffi, from._ffi, to._ffi);
return result.address == 0 ? null : UnitsConverter._fromFfi(result, []);
}
- /// Creates a parser to parse the CLDR unit identifier (e.g. `meter-per-square-second`) and get the [`MeasureUnit`].
- ///
- /// See the [Rust documentation for `parser`](https://docs.rs/icu/latest/icu/experimental/units/converter_factory/struct.ConverterFactory.html#method.parser) for more information.
- MeasureUnitParser parser() {
- // This lifetime edge depends on lifetimes: 'a
- core.List<Object> aEdges = [this];
- final result = _ICU4XUnitsConverterFactory_parser(_ffi);
- return MeasureUnitParser._fromFfi(result, [], aEdges);
- }
}
-@_DiplomatFfiUse('ICU4XUnitsConverterFactory_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XUnitsConverterFactory_destroy',
-)
+@_DiplomatFfiUse('icu4x_UnitsConverterFactory_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_UnitsConverterFactory_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XUnitsConverterFactory_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_UnitsConverterFactory_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XUnitsConverterFactory_create')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XUnitsConverterFactory_create',
-)
+@_DiplomatFfiUse('icu4x_UnitsConverterFactory_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_UnitsConverterFactory_create_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XUnitsConverterFactory_create(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_UnitsConverterFactory_create_mv1();
-@_DiplomatFfiUse('ICU4XUnitsConverterFactory_converter')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(isLeaf: true, symbol: 'ICU4XUnitsConverterFactory_converter')
+@_DiplomatFfiUse('icu4x_UnitsConverterFactory_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UnitsConverterFactory_create_with_provider_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XUnitsConverterFactory_converter(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> from,
- ffi.Pointer<ffi.Opaque> to,
-);
+external _ResultOpaqueInt32 _icu4x_UnitsConverterFactory_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
-@_DiplomatFfiUse('ICU4XUnitsConverterFactory_parser')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XUnitsConverterFactory_parser',
-)
+@_DiplomatFfiUse('icu4x_UnitsConverterFactory_converter_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UnitsConverterFactory_converter_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XUnitsConverterFactory_parser(
- ffi.Pointer<ffi.Opaque> self,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_UnitsConverterFactory_converter_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> from, ffi.Pointer<ffi.Opaque> to);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/UtcOffset.g.dart b/pkgs/intl4x/lib/src/bindings/UtcOffset.g.dart
new file mode 100644
index 0000000..2d71a50
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/UtcOffset.g.dart
@@ -0,0 +1,167 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `UtcOffset`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html) for more information.
+final class UtcOffset implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ UtcOffset._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_UtcOffset_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_UtcOffset_destroy_mv1));
+
+ /// Creates an offset from seconds.
+ ///
+ /// Errors if the offset seconds are out of range.
+ ///
+ /// See the [Rust documentation for `try_from_seconds`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.try_from_seconds) for more information.
+ ///
+ /// Throws [TimeZoneInvalidOffsetError] on failure.
+ factory UtcOffset.fromSeconds(int seconds) {
+ final result = _icu4x_UtcOffset_from_seconds_mv1(seconds);
+ if (!result.isOk) {
+ throw TimeZoneInvalidOffsetError();
+ }
+ return UtcOffset._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates an offset from a string.
+ ///
+ /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.try_from_str) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html)
+ ///
+ /// Throws [TimeZoneInvalidOffsetError] on failure.
+ factory UtcOffset.fromString(String offset) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_UtcOffset_from_string_mv1(offset._utf8AllocIn(temp.arena));
+ if (!result.isOk) {
+ throw TimeZoneInvalidOffsetError();
+ }
+ return UtcOffset._fromFfi(result.union.ok, []);
+ }
+
+ /// Returns the value as offset seconds.
+ ///
+ /// See the [Rust documentation for `offset`](https://docs.rs/icu/2.0.0/icu/time/struct.TimeZoneInfo.html#method.offset) for more information.
+ ///
+ /// See the [Rust documentation for `to_seconds`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.to_seconds) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html)
+ int get seconds {
+ final result = _icu4x_UtcOffset_seconds_mv1(_ffi);
+ return result;
+ }
+
+ /// Returns whether the offset is positive.
+ ///
+ /// See the [Rust documentation for `is_non_negative`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.is_non_negative) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html)
+ bool get isNonNegative {
+ final result = _icu4x_UtcOffset_is_non_negative_mv1(_ffi);
+ return result;
+ }
+
+ /// Returns whether the offset is zero.
+ ///
+ /// See the [Rust documentation for `is_zero`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.is_zero) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html)
+ bool get isZero {
+ final result = _icu4x_UtcOffset_is_zero_mv1(_ffi);
+ return result;
+ }
+
+ /// Returns the hours part of the offset.
+ ///
+ /// See the [Rust documentation for `hours_part`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.hours_part) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html)
+ int get hoursPart {
+ final result = _icu4x_UtcOffset_hours_part_mv1(_ffi);
+ return result;
+ }
+
+ /// Returns the minutes part of the offset.
+ ///
+ /// See the [Rust documentation for `minutes_part`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.minutes_part) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html)
+ int get minutesPart {
+ final result = _icu4x_UtcOffset_minutes_part_mv1(_ffi);
+ return result;
+ }
+
+ /// Returns the seconds part of the offset.
+ ///
+ /// See the [Rust documentation for `seconds_part`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html#method.seconds_part) for more information.
+ ///
+ /// Additional information: [1](https://docs.rs/icu/2.0.0/icu/time/zone/struct.UtcOffset.html)
+ int get secondsPart {
+ final result = _icu4x_UtcOffset_seconds_part_mv1(_ffi);
+ return result;
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_UtcOffset_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_UtcOffset_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_UtcOffset_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_from_seconds_mv1')
+@ffi.Native<_ResultOpaqueTimeZoneInvalidOffsetErrorFfi Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_UtcOffset_from_seconds_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueTimeZoneInvalidOffsetErrorFfi _icu4x_UtcOffset_from_seconds_mv1(int seconds);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_from_string_mv1')
+@ffi.Native<_ResultOpaqueTimeZoneInvalidOffsetErrorFfi Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_UtcOffset_from_string_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueTimeZoneInvalidOffsetErrorFfi _icu4x_UtcOffset_from_string_mv1(_SliceUtf8 offset);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_seconds_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UtcOffset_seconds_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_UtcOffset_seconds_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_is_non_negative_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UtcOffset_is_non_negative_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_UtcOffset_is_non_negative_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_is_zero_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UtcOffset_is_zero_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_UtcOffset_is_zero_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_hours_part_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UtcOffset_hours_part_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_UtcOffset_hours_part_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_minutes_part_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UtcOffset_minutes_part_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_UtcOffset_minutes_part_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_UtcOffset_seconds_part_mv1')
+@ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_UtcOffset_seconds_part_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_UtcOffset_seconds_part_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/VariantOffsets.g.dart b/pkgs/intl4x/lib/src/bindings/VariantOffsets.g.dart
new file mode 100644
index 0000000..25517d4
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/VariantOffsets.g.dart
@@ -0,0 +1,48 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _VariantOffsetsFfi extends ffi.Struct {
+ external ffi.Pointer<ffi.Opaque> standard;
+ external ffi.Pointer<ffi.Opaque> daylight;
+}
+
+/// See the [Rust documentation for `VariantOffsets`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.VariantOffsets.html) for more information.
+final class VariantOffsets {
+ final UtcOffset standard;
+ final UtcOffset? daylight;
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ VariantOffsets._fromFfi(_VariantOffsetsFfi ffi) :
+ standard = UtcOffset._fromFfi(ffi.standard, []),
+ daylight = ffi.daylight.address == 0 ? null : UtcOffset._fromFfi(ffi.daylight, []);
+
+ // ignore: unused_element
+ _VariantOffsetsFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_VariantOffsetsFfi>();
+ struct.standard = standard._ffi;
+ struct.daylight = daylight?._ffi ?? ffi.Pointer.fromAddress(0);
+ return struct;
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is VariantOffsets &&
+ other.standard == standard &&
+ other.daylight == daylight;
+
+ @override
+ int get hashCode => Object.hashAll([
+ standard,
+ daylight,
+ ]);
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/VariantOffsetsCalculator.g.dart b/pkgs/intl4x/lib/src/bindings/VariantOffsetsCalculator.g.dart
new file mode 100644
index 0000000..f22bc58
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/VariantOffsetsCalculator.g.dart
@@ -0,0 +1,79 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `VariantOffsetsCalculator`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.VariantOffsetsCalculator.html) for more information.
+final class VariantOffsetsCalculator implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ VariantOffsetsCalculator._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_VariantOffsetsCalculator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_VariantOffsetsCalculator_destroy_mv1));
+
+ /// Construct a new [VariantOffsetsCalculator] instance using compiled data.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.VariantOffsetsCalculator.html#method.new) for more information.
+ factory VariantOffsetsCalculator() {
+ final result = _icu4x_VariantOffsetsCalculator_create_mv1();
+ return VariantOffsetsCalculator._fromFfi(result, []);
+ }
+
+ /// Construct a new [VariantOffsetsCalculator] instance using a particular data source.
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.VariantOffsetsCalculator.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory VariantOffsetsCalculator.withProvider(DataProvider provider) {
+ final result = _icu4x_VariantOffsetsCalculator_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return VariantOffsetsCalculator._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `compute_offsets_from_time_zone_and_name_timestamp`](https://docs.rs/icu/2.0.0/icu/time/zone/struct.VariantOffsetsCalculatorBorrowed.html#method.compute_offsets_from_time_zone_and_name_timestamp) for more information.
+ VariantOffsets? computeOffsetsFromTimeZoneAndDateTime(TimeZone timeZone, IsoDate localDate, Time localTime) {
+ final result = _icu4x_VariantOffsetsCalculator_compute_offsets_from_time_zone_and_date_time_mv1(_ffi, timeZone._ffi, localDate._ffi, localTime._ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return VariantOffsets._fromFfi(result.union.ok);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_VariantOffsetsCalculator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_VariantOffsetsCalculator_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_VariantOffsetsCalculator_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_VariantOffsetsCalculator_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_VariantOffsetsCalculator_create_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_VariantOffsetsCalculator_create_mv1();
+
+@_DiplomatFfiUse('icu4x_VariantOffsetsCalculator_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_VariantOffsetsCalculator_create_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_VariantOffsetsCalculator_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_VariantOffsetsCalculator_compute_offsets_from_time_zone_and_date_time_mv1')
+@ffi.Native<_ResultVariantOffsetsFfiVoid Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_VariantOffsetsCalculator_compute_offsets_from_time_zone_and_date_time_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVariantOffsetsFfiVoid _icu4x_VariantOffsetsCalculator_compute_offsets_from_time_zone_and_date_time_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> timeZone, ffi.Pointer<ffi.Opaque> localDate, ffi.Pointer<ffi.Opaque> localTime);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/VerticalOrientation.g.dart b/pkgs/intl4x/lib/src/bindings/VerticalOrientation.g.dart
new file mode 100644
index 0000000..b70e83a
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/VerticalOrientation.g.dart
@@ -0,0 +1,91 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `VerticalOrientation`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html) for more information.
+enum VerticalOrientation {
+ /// See the [Rust documentation for `Rotated`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html#associatedconstant.Rotated) for more information.
+ rotated,
+ /// See the [Rust documentation for `TransformedRotated`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html#associatedconstant.TransformedRotated) for more information.
+ transformedRotated,
+ /// See the [Rust documentation for `TransformedUpright`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html#associatedconstant.TransformedUpright) for more information.
+ transformedUpright,
+ /// See the [Rust documentation for `Upright`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html#associatedconstant.Upright) for more information.
+ upright;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static VerticalOrientation forChar(Rune ch) {
+ final result = _icu4x_VerticalOrientation_for_char_mv1(ch);
+ return VerticalOrientation.values[result];
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_VerticalOrientation_long_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_VerticalOrientation_short_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_VerticalOrientation_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.VerticalOrientation.html#method.from_icu4c_value) for more information.
+ static VerticalOrientation? fromIntegerValue(int other) {
+ final result = _icu4x_VerticalOrientation_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return VerticalOrientation.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_VerticalOrientation_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_VerticalOrientation_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_VerticalOrientation_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_VerticalOrientation_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_VerticalOrientation_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_VerticalOrientation_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_VerticalOrientation_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_VerticalOrientation_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_VerticalOrientation_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_VerticalOrientation_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_VerticalOrientation_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_VerticalOrientation_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_VerticalOrientation_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_VerticalOrientation_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_VerticalOrientation_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WeekCalculator.g.dart b/pkgs/intl4x/lib/src/bindings/WeekCalculator.g.dart
deleted file mode 100644
index c2556c1..0000000
--- a/pkgs/intl4x/lib/src/bindings/WeekCalculator.g.dart
+++ /dev/null
@@ -1,136 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// A Week calculator, useful to be passed in to `week_of_year()` on Date and DateTime types
-///
-/// See the [Rust documentation for `WeekCalculator`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html) for more information.
-final class WeekCalculator implements ffi.Finalizable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- // These are "used" in the sense that they keep dependencies alive
- // ignore: unused_field
- final core.List<Object> _selfEdge;
-
- // This takes in a list of lifetime edges (including for &self borrows)
- // corresponding to data this may borrow from. These should be flat arrays containing
- // references to objects, and this object will hold on to them to keep them alive and
- // maintain borrow validity.
- WeekCalculator._fromFfi(this._ffi, this._selfEdge) {
- if (_selfEdge.isEmpty) {
- _finalizer.attach(this, _ffi.cast());
- }
- }
-
- @_DiplomatFfiUse('ICU4XWeekCalculator_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XWeekCalculator_destroy),
- );
-
- /// Creates a new [`WeekCalculator`] from locale data.
- ///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#method.try_new) for more information.
- ///
- /// Throws [Error] on failure.
- factory WeekCalculator(DataProvider provider, Locale locale) {
- final result = _ICU4XWeekCalculator_create(provider._ffi, locale._ffi);
- if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
- }
- return WeekCalculator._fromFfi(result.union.ok, []);
- }
-
- /// Additional information: [1](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday), [2](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days)
- factory WeekCalculator.fromFirstDayOfWeekAndMinWeekDays(
- IsoWeekday firstWeekday,
- int minWeekDays,
- ) {
- final result =
- _ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(
- firstWeekday._ffi,
- minWeekDays,
- );
- return WeekCalculator._fromFfi(result, []);
- }
-
- /// Returns the weekday that starts the week for this object's locale
- ///
- /// See the [Rust documentation for `first_weekday`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday) for more information.
- IsoWeekday get firstWeekday {
- final result = _ICU4XWeekCalculator_first_weekday(_ffi);
- return IsoWeekday.values.firstWhere((v) => v._ffi == result);
- }
-
- /// The minimum number of days overlapping a year required for a week to be
- /// considered part of that year
- ///
- /// See the [Rust documentation for `min_week_days`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days) for more information.
- int get minWeekDays {
- final result = _ICU4XWeekCalculator_min_week_days(_ffi);
- return result;
- }
-
- /// See the [Rust documentation for `weekend`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#method.weekend) for more information.
- WeekendContainsDay get weekend {
- final result = _ICU4XWeekCalculator_weekend(_ffi);
- return WeekendContainsDay._fromFfi(result);
- }
-}
-
-@_DiplomatFfiUse('ICU4XWeekCalculator_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XWeekCalculator_destroy',
-)
-// ignore: non_constant_identifier_names
-external void _ICU4XWeekCalculator_destroy(ffi.Pointer<ffi.Void> self);
-
-@_DiplomatFfiUse('ICU4XWeekCalculator_create')
-@ffi.Native<
- _ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)
->(isLeaf: true, symbol: 'ICU4XWeekCalculator_create')
-// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XWeekCalculator_create(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
-);
-
-@_DiplomatFfiUse(
- 'ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days',
-)
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Int32, ffi.Uint8)>(
- isLeaf: true,
- symbol: 'ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days',
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque>
-_ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(
- int firstWeekday,
- int minWeekDays,
-);
-
-@_DiplomatFfiUse('ICU4XWeekCalculator_first_weekday')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWeekCalculator_first_weekday',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XWeekCalculator_first_weekday(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XWeekCalculator_min_week_days')
-@ffi.Native<ffi.Uint8 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWeekCalculator_min_week_days',
-)
-// ignore: non_constant_identifier_names
-external int _ICU4XWeekCalculator_min_week_days(ffi.Pointer<ffi.Opaque> self);
-
-@_DiplomatFfiUse('ICU4XWeekCalculator_weekend')
-@ffi.Native<_WeekendContainsDayFfi Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWeekCalculator_weekend',
-)
-// ignore: non_constant_identifier_names
-external _WeekendContainsDayFfi _ICU4XWeekCalculator_weekend(
- ffi.Pointer<ffi.Opaque> self,
-);
diff --git a/pkgs/intl4x/lib/src/bindings/WeekInformation.g.dart b/pkgs/intl4x/lib/src/bindings/WeekInformation.g.dart
new file mode 100644
index 0000000..9d36763
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/WeekInformation.g.dart
@@ -0,0 +1,109 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// A Week calculator, useful to be passed in to `week_of_year()` on Date and DateTime types
+///
+/// See the [Rust documentation for `WeekInformation`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekInformation.html) for more information.
+final class WeekInformation implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ WeekInformation._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_WeekInformation_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_WeekInformation_destroy_mv1));
+
+ /// Creates a new [WeekInformation] from locale data using compiled data.
+ ///
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekInformation.html#method.try_new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WeekInformation(Locale locale) {
+ final result = _icu4x_WeekInformation_create_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return WeekInformation._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a new [WeekInformation] from locale data using a particular data source.
+ ///
+ /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekInformation.html#method.try_new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WeekInformation.withProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_WeekInformation_create_with_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return WeekInformation._fromFfi(result.union.ok, []);
+ }
+
+ /// Returns the weekday that starts the week for this object's locale
+ ///
+ /// See the [Rust documentation for `first_weekday`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekInformation.html#structfield.first_weekday) for more information.
+ Weekday get firstWeekday {
+ final result = _icu4x_WeekInformation_first_weekday_mv1(_ffi);
+ return Weekday.values.firstWhere((v) => v._ffi == result);
+ }
+
+ /// See the [Rust documentation for `weekend`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekInformation.html#structfield.weekend) for more information.
+ ///
+ /// See the [Rust documentation for `contains`](https://docs.rs/icu/2.0.0/icu/calendar/provider/struct.WeekdaySet.html#method.contains) for more information.
+ bool isWeekend(Weekday day) {
+ final result = _icu4x_WeekInformation_is_weekend_mv1(_ffi, day._ffi);
+ return result;
+ }
+
+ /// See the [Rust documentation for `weekend`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekInformation.html#method.weekend) for more information.
+ WeekdaySetIterator get weekend {
+ final result = _icu4x_WeekInformation_weekend_mv1(_ffi);
+ return WeekdaySetIterator._fromFfi(result, []);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_WeekInformation_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_WeekInformation_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_WeekInformation_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_WeekInformation_create_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WeekInformation_create_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_WeekInformation_create_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_WeekInformation_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WeekInformation_create_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_WeekInformation_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_WeekInformation_first_weekday_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WeekInformation_first_weekday_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_WeekInformation_first_weekday_mv1(ffi.Pointer<ffi.Opaque> self);
+
+@_DiplomatFfiUse('icu4x_WeekInformation_is_weekend_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_WeekInformation_is_weekend_mv1')
+// ignore: non_constant_identifier_names
+external bool _icu4x_WeekInformation_is_weekend_mv1(ffi.Pointer<ffi.Opaque> self, int day);
+
+@_DiplomatFfiUse('icu4x_WeekInformation_weekend_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WeekInformation_weekend_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_WeekInformation_weekend_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WeekOf.g.dart b/pkgs/intl4x/lib/src/bindings/WeekOf.g.dart
deleted file mode 100644
index d5f4fcf..0000000
--- a/pkgs/intl4x/lib/src/bindings/WeekOf.g.dart
+++ /dev/null
@@ -1,41 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-final class _WeekOfFfi extends ffi.Struct {
- @ffi.Uint16()
- external int week;
- @ffi.Int32()
- external int unit;
-}
-
-/// See the [Rust documentation for `WeekOf`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekOf.html) for more information.
-final class WeekOf {
- final int week;
- final WeekRelativeUnit unit;
-
- // This struct contains borrowed fields, so this takes in a list of
- // "edges" corresponding to where each lifetime's data may have been borrowed from
- // and passes it down to individual fields containing the borrow.
- // This method does not attempt to handle any dependencies between lifetimes, the caller
- // should handle this when constructing edge arrays.
- // ignore: unused_element
- WeekOf._fromFfi(_WeekOfFfi ffi)
- : week = ffi.week,
- unit = WeekRelativeUnit.values[ffi.unit];
-
- // ignore: unused_element
- _WeekOfFfi _toFfi(ffi.Allocator temp) {
- final struct = ffi.Struct.create<_WeekOfFfi>();
- struct.week = week;
- struct.unit = unit.index;
- return struct;
- }
-
- @override
- bool operator ==(Object other) =>
- other is WeekOf && other.week == week && other.unit == unit;
-
- @override
- int get hashCode => Object.hashAll([week, unit]);
-}
diff --git a/pkgs/intl4x/lib/src/bindings/WeekRelativeUnit.g.dart b/pkgs/intl4x/lib/src/bindings/WeekRelativeUnit.g.dart
deleted file mode 100644
index 256fa50..0000000
--- a/pkgs/intl4x/lib/src/bindings/WeekRelativeUnit.g.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-/// See the [Rust documentation for `RelativeUnit`](https://docs.rs/icu/latest/icu/calendar/week/enum.RelativeUnit.html) for more information.
-enum WeekRelativeUnit { previous, current, next }
diff --git a/pkgs/intl4x/lib/src/bindings/IsoWeekday.g.dart b/pkgs/intl4x/lib/src/bindings/Weekday.g.dart
similarity index 89%
rename from pkgs/intl4x/lib/src/bindings/IsoWeekday.g.dart
rename to pkgs/intl4x/lib/src/bindings/Weekday.g.dart
index 094bb08..9dc5cb4 100644
--- a/pkgs/intl4x/lib/src/bindings/IsoWeekday.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/Weekday.g.dart
@@ -1,8 +1,10 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-enum IsoWeekday {
+enum Weekday {
+
monday,
tuesday,
@@ -35,4 +37,7 @@
return 7;
}
}
+
}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WeekdaySetIterator.g.dart b/pkgs/intl4x/lib/src/bindings/WeekdaySetIterator.g.dart
new file mode 100644
index 0000000..bd939e5
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/WeekdaySetIterator.g.dart
@@ -0,0 +1,61 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// Documents which days of the week are considered to be a part of the weekend
+///
+/// See the [Rust documentation for `WeekdaySetIterator`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekdaySetIterator.html) for more information.
+final class WeekdaySetIterator implements ffi.Finalizable, core.Iterator<Weekday> {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ WeekdaySetIterator._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_WeekdaySetIterator_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_WeekdaySetIterator_destroy_mv1));
+
+ Weekday? _current;
+
+ @override
+ Weekday get current => _current!;
+
+ @override
+ bool moveNext() {
+ _current = _iteratorNext();
+ return _current != null;
+ }
+
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/calendar/week/struct.WeekdaySetIterator.html#method.next) for more information.
+ Weekday? _iteratorNext() {
+ final result = _icu4x_WeekdaySetIterator_next_mv1(_ffi);
+ if (!result.isOk) {
+ return null;
+ }
+ return Weekday.values.firstWhere((v) => v._ffi == result.union.ok);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_WeekdaySetIterator_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_WeekdaySetIterator_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_WeekdaySetIterator_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_WeekdaySetIterator_next_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WeekdaySetIterator_next_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_WeekdaySetIterator_next_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WeekendContainsDay.g.dart b/pkgs/intl4x/lib/src/bindings/WeekendContainsDay.g.dart
deleted file mode 100644
index 8a26958..0000000
--- a/pkgs/intl4x/lib/src/bindings/WeekendContainsDay.g.dart
+++ /dev/null
@@ -1,93 +0,0 @@
-// generated by diplomat-tool
-
-part of 'lib.g.dart';
-
-final class _WeekendContainsDayFfi extends ffi.Struct {
- @ffi.Bool()
- external bool monday;
- @ffi.Bool()
- external bool tuesday;
- @ffi.Bool()
- external bool wednesday;
- @ffi.Bool()
- external bool thursday;
- @ffi.Bool()
- external bool friday;
- @ffi.Bool()
- external bool saturday;
- @ffi.Bool()
- external bool sunday;
-}
-
-/// Documents which days of the week are considered to be a part of the weekend
-///
-/// See the [Rust documentation for `weekend`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#method.weekend) for more information.
-final class WeekendContainsDay {
- bool monday;
- bool tuesday;
- bool wednesday;
- bool thursday;
- bool friday;
- bool saturday;
- bool sunday;
-
- WeekendContainsDay({
- required this.monday,
- required this.tuesday,
- required this.wednesday,
- required this.thursday,
- required this.friday,
- required this.saturday,
- required this.sunday,
- });
-
- // This struct contains borrowed fields, so this takes in a list of
- // "edges" corresponding to where each lifetime's data may have been borrowed from
- // and passes it down to individual fields containing the borrow.
- // This method does not attempt to handle any dependencies between lifetimes, the caller
- // should handle this when constructing edge arrays.
- // ignore: unused_element
- WeekendContainsDay._fromFfi(_WeekendContainsDayFfi ffi)
- : monday = ffi.monday,
- tuesday = ffi.tuesday,
- wednesday = ffi.wednesday,
- thursday = ffi.thursday,
- friday = ffi.friday,
- saturday = ffi.saturday,
- sunday = ffi.sunday;
-
- // ignore: unused_element
- _WeekendContainsDayFfi _toFfi(ffi.Allocator temp) {
- final struct = ffi.Struct.create<_WeekendContainsDayFfi>();
- struct.monday = monday;
- struct.tuesday = tuesday;
- struct.wednesday = wednesday;
- struct.thursday = thursday;
- struct.friday = friday;
- struct.saturday = saturday;
- struct.sunday = sunday;
- return struct;
- }
-
- @override
- bool operator ==(Object other) =>
- other is WeekendContainsDay &&
- other.monday == monday &&
- other.tuesday == tuesday &&
- other.wednesday == wednesday &&
- other.thursday == thursday &&
- other.friday == friday &&
- other.saturday == saturday &&
- other.sunday == sunday;
-
- @override
- int get hashCode => Object.hashAll([
- monday,
- tuesday,
- wednesday,
- thursday,
- friday,
- saturday,
- sunday,
- ]);
-}
diff --git a/pkgs/intl4x/lib/src/bindings/WindowsParser.g.dart b/pkgs/intl4x/lib/src/bindings/WindowsParser.g.dart
new file mode 100644
index 0000000..cff72b7
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/WindowsParser.g.dart
@@ -0,0 +1,82 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// A mapper between Windows time zone identifiers and BCP-47 time zone identifiers.
+///
+/// This mapper supports two-way mapping, but it is optimized for the case of Windows to BCP-47.
+/// It also supports normalizing and canonicalizing the Windows strings.
+///
+/// See the [Rust documentation for `WindowsParser`](https://docs.rs/icu/2.0.0/icu/time/zone/windows/struct.WindowsParser.html) for more information.
+final class WindowsParser implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ WindowsParser._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_WindowsParser_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_WindowsParser_destroy_mv1));
+
+ /// Create a new [WindowsParser] using compiled data
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/windows/struct.WindowsParser.html#method.new) for more information.
+ factory WindowsParser() {
+ final result = _icu4x_WindowsParser_create_mv1();
+ return WindowsParser._fromFfi(result, []);
+ }
+
+ /// Create a new [WindowsParser] using a particular data source
+ ///
+ /// See the [Rust documentation for `new`](https://docs.rs/icu/2.0.0/icu/time/zone/windows/struct.WindowsParser.html#method.new) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WindowsParser.withProvider(DataProvider provider) {
+ final result = _icu4x_WindowsParser_create_with_provider_mv1(provider._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return WindowsParser._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `parse`](https://docs.rs/icu/2.0.0/icu/time/zone/windows/struct.WindowsParserBorrowed.html#method.parse) for more information.
+ TimeZone? parse(String value, String region) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_WindowsParser_parse_mv1(_ffi, value._utf8AllocIn(temp.arena), region._utf8AllocIn(temp.arena));
+ return result.address == 0 ? null : TimeZone._fromFfi(result, []);
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_WindowsParser_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_WindowsParser_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_WindowsParser_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_WindowsParser_create_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_WindowsParser_create_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_WindowsParser_create_mv1();
+
+@_DiplomatFfiUse('icu4x_WindowsParser_create_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WindowsParser_create_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_WindowsParser_create_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider);
+
+@_DiplomatFfiUse('icu4x_WindowsParser_parse_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf8, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_WindowsParser_parse_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_WindowsParser_parse_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf8 value, _SliceUtf8 region);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WordBreak.g.dart b/pkgs/intl4x/lib/src/bindings/WordBreak.g.dart
new file mode 100644
index 0000000..c80bb30
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/WordBreak.g.dart
@@ -0,0 +1,129 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `WordBreak`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html) for more information.
+enum WordBreak {
+ /// See the [Rust documentation for `Other`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.Other) for more information.
+ other,
+ /// See the [Rust documentation for `ALetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.ALetter) for more information.
+ aLetter,
+ /// See the [Rust documentation for `Format`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.Format) for more information.
+ format,
+ /// See the [Rust documentation for `Katakana`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.Katakana) for more information.
+ katakana,
+ /// See the [Rust documentation for `MidLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.MidLetter) for more information.
+ midLetter,
+ /// See the [Rust documentation for `MidNum`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.MidNum) for more information.
+ midNum,
+ /// See the [Rust documentation for `Numeric`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.Numeric) for more information.
+ numeric,
+ /// See the [Rust documentation for `ExtendNumLet`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.ExtendNumLet) for more information.
+ extendNumLet,
+ /// See the [Rust documentation for `CR`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.CR) for more information.
+ cr,
+ /// See the [Rust documentation for `Extend`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.Extend) for more information.
+ extend,
+ /// See the [Rust documentation for `LF`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.LF) for more information.
+ lf,
+ /// See the [Rust documentation for `MidNumLet`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.MidNumLet) for more information.
+ midNumLet,
+ /// See the [Rust documentation for `Newline`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.Newline) for more information.
+ newline,
+ /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.RegionalIndicator) for more information.
+ regionalIndicator,
+ /// See the [Rust documentation for `HebrewLetter`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.HebrewLetter) for more information.
+ hebrewLetter,
+ /// See the [Rust documentation for `SingleQuote`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.SingleQuote) for more information.
+ singleQuote,
+ /// See the [Rust documentation for `DoubleQuote`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.DoubleQuote) for more information.
+ doubleQuote,
+ /// See the [Rust documentation for `EBase`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.EBase) for more information.
+ eBase,
+ /// See the [Rust documentation for `EBaseGAZ`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.EBaseGAZ) for more information.
+ eBaseGaz,
+ /// See the [Rust documentation for `EModifier`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.EModifier) for more information.
+ eModifier,
+ /// See the [Rust documentation for `GlueAfterZwj`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.GlueAfterZwj) for more information.
+ glueAfterZwj,
+ /// See the [Rust documentation for `ZWJ`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.ZWJ) for more information.
+ zwj,
+ /// See the [Rust documentation for `WSegSpace`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#associatedconstant.WSegSpace) for more information.
+ wSegSpace;
+
+ /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.0.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
+ static WordBreak forChar(Rune ch) {
+ final result = _icu4x_WordBreak_for_char_mv1(ch);
+ return WordBreak.values[result];
+ }
+
+ /// Get the "long" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
+ String? longName() {
+ final result = _icu4x_WordBreak_long_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Get the "short" name of this property value (returns empty if property value is unknown)
+ ///
+ /// See the [Rust documentation for `get`](https://docs.rs/icu/2.0.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
+ String? shortName() {
+ final result = _icu4x_WordBreak_short_name_mv1(index);
+ if (!result.isOk) {
+ return null;
+ }
+ return result.union.ok._toDart([], isStatic: true);
+ }
+
+ /// Convert to an integer value usable with ICU4C and CodePointMapData
+ ///
+ /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#method.to_icu4c_value) for more information.
+ int toIntegerValue() {
+ final result = _icu4x_WordBreak_to_integer_value_mv1(index);
+ return result;
+ }
+
+ /// Convert from an integer value from ICU4C or CodePointMapData
+ ///
+ /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.0.0/icu/properties/props/struct.WordBreak.html#method.from_icu4c_value) for more information.
+ static WordBreak? fromIntegerValue(int other) {
+ final result = _icu4x_WordBreak_from_integer_value_mv1(other);
+ if (!result.isOk) {
+ return null;
+ }
+ return WordBreak.values[result.union.ok];
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_WordBreak_for_char_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_WordBreak_for_char_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_WordBreak_for_char_mv1(Rune ch);
+
+@_DiplomatFfiUse('icu4x_WordBreak_long_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_WordBreak_long_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_WordBreak_long_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_WordBreak_short_name_mv1')
+@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_WordBreak_short_name_mv1')
+// ignore: non_constant_identifier_names
+external _ResultSliceUtf8Void _icu4x_WordBreak_short_name_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_WordBreak_to_integer_value_mv1')
+@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_WordBreak_to_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external int _icu4x_WordBreak_to_integer_value_mv1(int self);
+
+@_DiplomatFfiUse('icu4x_WordBreak_from_integer_value_mv1')
+@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_WordBreak_from_integer_value_mv1')
+// ignore: non_constant_identifier_names
+external _ResultInt32Void _icu4x_WordBreak_from_integer_value_mv1(int other);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WordBreakIteratorLatin1.g.dart b/pkgs/intl4x/lib/src/bindings/WordBreakIteratorLatin1.g.dart
index dd52ebd..bb49ba5 100644
--- a/pkgs/intl4x/lib/src/bindings/WordBreakIteratorLatin1.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/WordBreakIteratorLatin1.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html) for more information.
+/// See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html) for more information.
final class WordBreakIteratorLatin1 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,69 +23,54 @@
}
}
- @_DiplomatFfiUse('ICU4XWordBreakIteratorLatin1_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XWordBreakIteratorLatin1_destroy),
- );
+ @_DiplomatFfiUse('icu4x_WordBreakIteratorLatin1_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_WordBreakIteratorLatin1_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XWordBreakIteratorLatin1_next(_ffi);
+ final result = _icu4x_WordBreakIteratorLatin1_next_mv1(_ffi);
return result;
}
/// Return the status value of break boundary.
///
- /// See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information.
+ /// See the [Rust documentation for `word_type`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.word_type) for more information.
SegmenterWordType get wordType {
- final result = _ICU4XWordBreakIteratorLatin1_word_type(_ffi);
+ final result = _icu4x_WordBreakIteratorLatin1_word_type_mv1(_ffi);
return SegmenterWordType.values[result];
}
/// Return true when break boundary is word-like such as letter/number/CJK
///
- /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information.
+ /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.is_word_like) for more information.
bool get isWordLike {
- final result = _ICU4XWordBreakIteratorLatin1_is_word_like(_ffi);
+ final result = _icu4x_WordBreakIteratorLatin1_is_word_like_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XWordBreakIteratorLatin1_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorLatin1_destroy',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorLatin1_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorLatin1_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XWordBreakIteratorLatin1_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_WordBreakIteratorLatin1_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorLatin1_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorLatin1_next',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorLatin1_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorLatin1_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XWordBreakIteratorLatin1_next(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_WordBreakIteratorLatin1_next_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorLatin1_word_type')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorLatin1_word_type',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorLatin1_word_type_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorLatin1_word_type_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XWordBreakIteratorLatin1_word_type(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_WordBreakIteratorLatin1_word_type_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorLatin1_is_word_like')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorLatin1_is_word_like',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorLatin1_is_word_like_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorLatin1_is_word_like_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XWordBreakIteratorLatin1_is_word_like(
- ffi.Pointer<ffi.Opaque> self,
-);
+external bool _icu4x_WordBreakIteratorLatin1_is_word_like_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf16.g.dart b/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf16.g.dart
index 7417480..de55cd0 100644
--- a/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf16.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf16.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html) for more information.
+/// See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html) for more information.
final class WordBreakIteratorUtf16 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,69 +23,54 @@
}
}
- @_DiplomatFfiUse('ICU4XWordBreakIteratorUtf16_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XWordBreakIteratorUtf16_destroy),
- );
+ @_DiplomatFfiUse('icu4x_WordBreakIteratorUtf16_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_WordBreakIteratorUtf16_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XWordBreakIteratorUtf16_next(_ffi);
+ final result = _icu4x_WordBreakIteratorUtf16_next_mv1(_ffi);
return result;
}
/// Return the status value of break boundary.
///
- /// See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information.
+ /// See the [Rust documentation for `word_type`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.word_type) for more information.
SegmenterWordType get wordType {
- final result = _ICU4XWordBreakIteratorUtf16_word_type(_ffi);
+ final result = _icu4x_WordBreakIteratorUtf16_word_type_mv1(_ffi);
return SegmenterWordType.values[result];
}
/// Return true when break boundary is word-like such as letter/number/CJK
///
- /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information.
+ /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.is_word_like) for more information.
bool get isWordLike {
- final result = _ICU4XWordBreakIteratorUtf16_is_word_like(_ffi);
+ final result = _icu4x_WordBreakIteratorUtf16_is_word_like_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf16_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf16_destroy',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf16_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf16_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XWordBreakIteratorUtf16_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_WordBreakIteratorUtf16_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf16_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf16_next',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf16_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf16_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XWordBreakIteratorUtf16_next(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_WordBreakIteratorUtf16_next_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf16_word_type')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf16_word_type',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf16_word_type_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf16_word_type_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XWordBreakIteratorUtf16_word_type(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_WordBreakIteratorUtf16_word_type_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf16_is_word_like')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf16_is_word_like',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf16_is_word_like_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf16_is_word_like_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XWordBreakIteratorUtf16_is_word_like(
- ffi.Pointer<ffi.Opaque> self,
-);
+external bool _icu4x_WordBreakIteratorUtf16_is_word_like_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf8.g.dart b/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf8.g.dart
index b1aa435..566367e 100644
--- a/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf8.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/WordBreakIteratorUtf8.g.dart
@@ -1,8 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html) for more information.
+/// See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html) for more information.
final class WordBreakIteratorUtf8 implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,69 +23,54 @@
}
}
- @_DiplomatFfiUse('ICU4XWordBreakIteratorUtf8_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XWordBreakIteratorUtf8_destroy),
- );
+ @_DiplomatFfiUse('icu4x_WordBreakIteratorUtf8_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_WordBreakIteratorUtf8_destroy_mv1));
/// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
/// out of range of a 32-bit signed integer.
///
- /// See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next) for more information.
+ /// See the [Rust documentation for `next`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.next) for more information.
int next() {
- final result = _ICU4XWordBreakIteratorUtf8_next(_ffi);
+ final result = _icu4x_WordBreakIteratorUtf8_next_mv1(_ffi);
return result;
}
/// Return the status value of break boundary.
///
- /// See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information.
+ /// See the [Rust documentation for `word_type`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.word_type) for more information.
SegmenterWordType get wordType {
- final result = _ICU4XWordBreakIteratorUtf8_word_type(_ffi);
+ final result = _icu4x_WordBreakIteratorUtf8_word_type_mv1(_ffi);
return SegmenterWordType.values[result];
}
/// Return true when break boundary is word-like such as letter/number/CJK
///
- /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information.
+ /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/2.0.0/icu/segmenter/iterators/struct.WordBreakIterator.html#method.is_word_like) for more information.
bool get isWordLike {
- final result = _ICU4XWordBreakIteratorUtf8_is_word_like(_ffi);
+ final result = _icu4x_WordBreakIteratorUtf8_is_word_like_mv1(_ffi);
return result;
}
+
}
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf8_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf8_destroy',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf8_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf8_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XWordBreakIteratorUtf8_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_WordBreakIteratorUtf8_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf8_next')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf8_next',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf8_next_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf8_next_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XWordBreakIteratorUtf8_next(ffi.Pointer<ffi.Opaque> self);
+external int _icu4x_WordBreakIteratorUtf8_next_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf8_word_type')
-@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf8_word_type',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf8_word_type_mv1')
+@ffi.Native<ffi.Int32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf8_word_type_mv1')
// ignore: non_constant_identifier_names
-external int _ICU4XWordBreakIteratorUtf8_word_type(
- ffi.Pointer<ffi.Opaque> self,
-);
+external int _icu4x_WordBreakIteratorUtf8_word_type_mv1(ffi.Pointer<ffi.Opaque> self);
-@_DiplomatFfiUse('ICU4XWordBreakIteratorUtf8_is_word_like')
-@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordBreakIteratorUtf8_is_word_like',
-)
+@_DiplomatFfiUse('icu4x_WordBreakIteratorUtf8_is_word_like_mv1')
+@ffi.Native<ffi.Bool Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordBreakIteratorUtf8_is_word_like_mv1')
// ignore: non_constant_identifier_names
-external bool _ICU4XWordBreakIteratorUtf8_is_word_like(
- ffi.Pointer<ffi.Opaque> self,
-);
+external bool _icu4x_WordBreakIteratorUtf8_is_word_like_mv1(ffi.Pointer<ffi.Opaque> self);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/WordSegmenter.g.dart b/pkgs/intl4x/lib/src/bindings/WordSegmenter.g.dart
index d0f0395..a7e7033 100644
--- a/pkgs/intl4x/lib/src/bindings/WordSegmenter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/WordSegmenter.g.dart
@@ -1,10 +1,11 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
/// An ICU4X word-break segmenter, capable of finding word breakpoints in strings.
///
-/// See the [Rust documentation for `WordSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html) for more information.
+/// See the [Rust documentation for `WordSegmenter`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html) for more information.
final class WordSegmenter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,55 +23,143 @@
}
}
- @_DiplomatFfiUse('ICU4XWordSegmenter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XWordSegmenter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_WordSegmenter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_WordSegmenter_destroy_mv1));
- /// Construct an [`WordSegmenter`] with automatically selecting the best available LSTM
- /// or dictionary payload data.
+ /// Construct an [WordSegmenter] with automatically selecting the best available LSTM
+ /// or dictionary payload data, using compiled data. This does not assume any content locale.
///
/// Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese,
/// Khmer, Lao, and Thai.
///
- /// See the [Rust documentation for `new_auto`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.new_auto) for more information.
+ /// See the [Rust documentation for `new_auto`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.new_auto) for more information.
+ factory WordSegmenter.auto() {
+ final result = _icu4x_WordSegmenter_create_auto_mv1();
+ return WordSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct an [WordSegmenter] with automatically selecting the best available LSTM
+ /// or dictionary payload data, using compiled data.
///
- /// Throws [Error] on failure.
- factory WordSegmenter.auto(DataProvider provider) {
- final result = _ICU4XWordSegmenter_create_auto(provider._ffi);
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese,
+ /// Khmer, Lao, and Thai.
+ ///
+ /// See the [Rust documentation for `try_new_auto`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.try_new_auto) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WordSegmenter.autoWithContentLocale(Locale locale) {
+ final result = _icu4x_WordSegmenter_create_auto_with_content_locale_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return WordSegmenter._fromFfi(result.union.ok, []);
}
- /// Construct an [`WordSegmenter`] with LSTM payload data for Burmese, Khmer, Lao, and
- /// Thai.
+ /// Construct an [WordSegmenter] with automatically selecting the best available LSTM
+ /// or dictionary payload data, using a particular data source.
///
- /// Warning: [`WordSegmenter`] created by this function doesn't handle Chinese or
- /// Japanese.
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese,
+ /// Khmer, Lao, and Thai.
///
- /// See the [Rust documentation for `new_lstm`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.new_lstm) for more information.
+ /// See the [Rust documentation for `try_new_auto`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.try_new_auto) for more information.
///
- /// Throws [Error] on failure.
- factory WordSegmenter.lstm(DataProvider provider) {
- final result = _ICU4XWordSegmenter_create_lstm(provider._ffi);
+ /// Throws [DataError] on failure.
+ factory WordSegmenter.autoWithContentLocaleAndProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_WordSegmenter_create_auto_with_content_locale_and_provider_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
}
return WordSegmenter._fromFfi(result.union.ok, []);
}
- /// Construct an [`WordSegmenter`] with dictionary payload data for Chinese, Japanese,
- /// Burmese, Khmer, Lao, and Thai.
+ /// Construct an [WordSegmenter] with LSTM payload data for Burmese, Khmer, Lao, and
+ /// Thai, using compiled data. This does not assume any content locale.
///
- /// See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.new_dictionary) for more information.
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese,
+ /// Khmer, Lao, and Thai.
///
- /// Throws [Error] on failure.
- factory WordSegmenter.dictionary(DataProvider provider) {
- final result = _ICU4XWordSegmenter_create_dictionary(provider._ffi);
+ /// See the [Rust documentation for `new_lstm`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.new_lstm) for more information.
+ factory WordSegmenter.lstm() {
+ final result = _icu4x_WordSegmenter_create_lstm_mv1();
+ return WordSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct an [WordSegmenter] with LSTM payload data for Burmese, Khmer, Lao, and
+ /// Thai, using compiled data.
+ ///
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese,
+ /// Khmer, Lao, and Thai.
+ ///
+ /// See the [Rust documentation for `try_new_lstm`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.try_new_lstm) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WordSegmenter.lstmWithContentLocale(Locale locale) {
+ final result = _icu4x_WordSegmenter_create_lstm_with_content_locale_mv1(locale._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DataError.values[result.union.err];
+ }
+ return WordSegmenter._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [WordSegmenter] with LSTM payload data for Burmese, Khmer, Lao, and
+ /// Thai, using a particular data source.
+ ///
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese,
+ /// Khmer, Lao, and Thai.
+ ///
+ /// See the [Rust documentation for `try_new_lstm`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.try_new_lstm) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WordSegmenter.lstmWithContentLocaleAndProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_WordSegmenter_create_lstm_with_content_locale_and_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return WordSegmenter._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [WordSegmenter] with with dictionary payload data for Chinese, Japanese,
+ /// Burmese, Khmer, Lao, and Thai, using compiled data. This does not assume any content locale.
+ ///
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and dictionary for Burmese,
+ /// Khmer, Lao, and Thai.
+ ///
+ /// See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.new_dictionary) for more information.
+ factory WordSegmenter.dictionary() {
+ final result = _icu4x_WordSegmenter_create_dictionary_mv1();
+ return WordSegmenter._fromFfi(result, []);
+ }
+
+ /// Construct an [WordSegmenter] with dictionary payload data for Chinese, Japanese,
+ /// Burmese, Khmer, Lao, and Thai, using compiled data.
+ ///
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and dictionary for Burmese,
+ /// Khmer, Lao, and Thai.
+ ///
+ /// See the [Rust documentation for `try_new_dictionary`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.try_new_dictionary) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WordSegmenter.dictionaryWithContentLocale(Locale locale) {
+ final result = _icu4x_WordSegmenter_create_dictionary_with_content_locale_mv1(locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
+ }
+ return WordSegmenter._fromFfi(result.union.ok, []);
+ }
+
+ /// Construct an [WordSegmenter] with dictionary payload data for Chinese, Japanese,
+ /// Burmese, Khmer, Lao, and Thai, using a particular data source.
+ ///
+ /// Note: currently, it uses dictionary for Chinese and Japanese, and dictionary for Burmese,
+ /// Khmer, Lao, and Thai.
+ ///
+ /// See the [Rust documentation for `try_new_dictionary`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenter.html#method.try_new_dictionary) for more information.
+ ///
+ /// Throws [DataError] on failure.
+ factory WordSegmenter.dictionaryWithContentLocaleAndProvider(DataProvider provider, Locale locale) {
+ final result = _icu4x_WordSegmenter_create_dictionary_with_content_locale_and_provider_mv1(provider._ffi, locale._ffi);
+ if (!result.isOk) {
+ throw DataError.values[result.union.err];
}
return WordSegmenter._fromFfi(result.union.ok, []);
}
@@ -80,70 +169,70 @@
/// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according
/// to the WHATWG Encoding Standard.
///
- /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_utf16) for more information.
+ /// See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/2.0.0/icu/segmenter/struct.WordSegmenterBorrowed.html#method.segment_utf16) for more information.
WordBreakIteratorUtf16 segment(String input) {
- final inputView = input.utf16View;
final inputArena = _FinalizedArena();
// This lifetime edge depends on lifetimes: 'a
core.List<Object> aEdges = [this, inputArena];
- final result = _ICU4XWordSegmenter_segment_utf16(
- _ffi,
- inputView.allocIn(inputArena.arena),
- inputView.length,
- );
+ final result = _icu4x_WordSegmenter_segment_utf16_mv1(_ffi, input._utf16AllocIn(inputArena.arena));
return WordBreakIteratorUtf16._fromFfi(result, [], aEdges);
}
+
}
-@_DiplomatFfiUse('ICU4XWordSegmenter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XWordSegmenter_destroy',
-)
+@_DiplomatFfiUse('icu4x_WordSegmenter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XWordSegmenter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_WordSegmenter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XWordSegmenter_create_auto')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordSegmenter_create_auto',
-)
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_auto_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_auto_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XWordSegmenter_create_auto(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_WordSegmenter_create_auto_mv1();
-@_DiplomatFfiUse('ICU4XWordSegmenter_create_lstm')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordSegmenter_create_lstm',
-)
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_auto_with_content_locale_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_auto_with_content_locale_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XWordSegmenter_create_lstm(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_WordSegmenter_create_auto_with_content_locale_mv1(ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XWordSegmenter_create_dictionary')
-@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(
- isLeaf: true,
- symbol: 'ICU4XWordSegmenter_create_dictionary',
-)
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_auto_with_content_locale_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_auto_with_content_locale_and_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XWordSegmenter_create_dictionary(
- ffi.Pointer<ffi.Opaque> provider,
-);
+external _ResultOpaqueInt32 _icu4x_WordSegmenter_create_auto_with_content_locale_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
-@_DiplomatFfiUse('ICU4XWordSegmenter_segment_utf16')
-@ffi.Native<
- ffi.Pointer<ffi.Opaque> Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Uint16>,
- ffi.Size,
- )
->(isLeaf: true, symbol: 'ICU4XWordSegmenter_segment_utf16')
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_lstm_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_lstm_mv1')
// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _ICU4XWordSegmenter_segment_utf16(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Uint16> inputData,
- int inputLength,
-);
+external ffi.Pointer<ffi.Opaque> _icu4x_WordSegmenter_create_lstm_mv1();
+
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_lstm_with_content_locale_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_lstm_with_content_locale_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_WordSegmenter_create_lstm_with_content_locale_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_lstm_with_content_locale_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_lstm_with_content_locale_and_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_WordSegmenter_create_lstm_with_content_locale_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_dictionary_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function()>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_dictionary_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_WordSegmenter_create_dictionary_mv1();
+
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_dictionary_with_content_locale_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_dictionary_with_content_locale_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_WordSegmenter_create_dictionary_with_content_locale_mv1(ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_WordSegmenter_create_dictionary_with_content_locale_and_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_create_dictionary_with_content_locale_and_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_WordSegmenter_create_dictionary_with_content_locale_and_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale);
+
+@_DiplomatFfiUse('icu4x_WordSegmenter_segment_utf16_mv1')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Pointer<ffi.Opaque>, _SliceUtf16)>(isLeaf: true, symbol: 'icu4x_WordSegmenter_segment_utf16_mv1')
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _icu4x_WordSegmenter_segment_utf16_mv1(ffi.Pointer<ffi.Opaque> self, _SliceUtf16 input);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/YearStyle.g.dart b/pkgs/intl4x/lib/src/bindings/YearStyle.g.dart
new file mode 100644
index 0000000..f8cf165
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/YearStyle.g.dart
@@ -0,0 +1,17 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `YearStyle`](https://docs.rs/icu/2.0.0/icu/datetime/options/enum.YearStyle.html) for more information.
+enum YearStyle {
+
+ auto,
+
+ full,
+
+ withEra;
+
+}
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ZonedDateFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/ZonedDateFormatter.g.dart
new file mode 100644
index 0000000..69ddb66
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/ZonedDateFormatter.g.dart
@@ -0,0 +1,387 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `DateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html) for more information.
+final class ZonedDateFormatter implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ ZonedDateFormatter._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_ZonedDateFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ZonedDateFormatter_destroy_mv1));
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.specificLong(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_specific_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.specificLongWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_specific_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.specificShort(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_specific_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.specificShortWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_specific_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.localizedOffsetLong(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_localized_offset_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.localizedOffsetLongWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_localized_offset_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.localizedOffsetShort(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_localized_offset_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.localizedOffsetShortWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_localized_offset_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.genericLong(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_generic_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.genericLongWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_generic_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.genericShort(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_generic_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.genericShortWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_generic_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.location(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_location_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.locationWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_location_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.exemplarCity(Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_exemplar_city_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatter.exemplarCityWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
+ final result = _icu4x_ZonedDateFormatter_create_exemplar_city_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information.
+ ///
+ /// Throws [DateTimeWriteError] on failure.
+ String formatIso(IsoDate isoDate, TimeZoneInfo zone) {
+ final write = _Write();
+ final result = _icu4x_ZonedDateFormatter_format_iso_mv1(_ffi, isoDate._ffi, zone._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeWriteError.values[result.union.err];
+ }
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_ZonedDateFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_specific_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_specific_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_specific_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_specific_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_specific_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_specific_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_specific_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_specific_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_specific_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_specific_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_specific_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_specific_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_localized_offset_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_localized_offset_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_localized_offset_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_localized_offset_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_localized_offset_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_localized_offset_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_localized_offset_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_localized_offset_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_localized_offset_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_localized_offset_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_localized_offset_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_localized_offset_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_generic_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_generic_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_generic_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_generic_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_generic_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_generic_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_generic_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_generic_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_generic_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_generic_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_generic_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_generic_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_location_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_location_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_location_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_location_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_location_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_location_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_exemplar_city_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_exemplar_city_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_exemplar_city_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_create_exemplar_city_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_create_exemplar_city_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatter_create_exemplar_city_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatter_format_iso_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatter_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidInt32 _icu4x_ZonedDateFormatter_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> zone, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ZonedDateFormatterGregorian.g.dart b/pkgs/intl4x/lib/src/bindings/ZonedDateFormatterGregorian.g.dart
new file mode 100644
index 0000000..bb2afc5
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/ZonedDateFormatterGregorian.g.dart
@@ -0,0 +1,387 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information.
+final class ZonedDateFormatterGregorian implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ ZonedDateFormatterGregorian._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ZonedDateFormatterGregorian_destroy_mv1));
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.specificLong(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_specific_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.specificLongWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_specific_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.specificShort(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_specific_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.specificShortWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_specific_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.localizedOffsetLong(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.localizedOffsetLongWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.localizedOffsetShort(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.localizedOffsetShortWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.genericLong(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_generic_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.genericLongWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_generic_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.genericShort(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_generic_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.genericShortWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_generic_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.location(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_location_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.locationWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_location_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.exemplarCity(Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_exemplar_city_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateFormatterGregorian.exemplarCityWithProvider(DataProvider provider, Locale locale, DateFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateFormatterGregorian_create_exemplar_city_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
+ ///
+ /// Throws [DateTimeWriteError] on failure.
+ String formatIso(IsoDate isoDate, TimeZoneInfo zone) {
+ final write = _Write();
+ final result = _icu4x_ZonedDateFormatterGregorian_format_iso_mv1(_ffi, isoDate._ffi, zone._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeWriteError.values[result.union.err];
+ }
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_ZonedDateFormatterGregorian_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_specific_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_specific_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_specific_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_specific_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_specific_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_specific_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_specific_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_specific_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_specific_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_specific_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_specific_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_specific_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_generic_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_generic_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_generic_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_generic_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_generic_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_generic_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_generic_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_generic_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_generic_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_generic_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_generic_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_generic_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_location_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_location_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_location_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_location_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_location_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_location_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_exemplar_city_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_exemplar_city_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_exemplar_city_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_create_exemplar_city_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_create_exemplar_city_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateFormatterGregorian_create_exemplar_city_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateFormatterGregorian_format_iso_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateFormatterGregorian_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidInt32 _icu4x_ZonedDateFormatterGregorian_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> zone, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ZonedDateTime.g.dart b/pkgs/intl4x/lib/src/bindings/ZonedDateTime.g.dart
new file mode 100644
index 0000000..2a6d388
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/ZonedDateTime.g.dart
@@ -0,0 +1,132 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _ZonedDateTimeFfi extends ffi.Struct {
+ external ffi.Pointer<ffi.Opaque> date;
+ external ffi.Pointer<ffi.Opaque> time;
+ external ffi.Pointer<ffi.Opaque> zone;
+}
+
+/// An ICU4X DateTime object capable of containing a date, time, and zone for any calendar.
+///
+/// See the [Rust documentation for `ZonedDateTime`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html) for more information.
+final class ZonedDateTime {
+ final Date date;
+ final Time time;
+ final TimeZoneInfo zone;
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ ZonedDateTime._fromFfi(_ZonedDateTimeFfi ffi) :
+ date = Date._fromFfi(ffi.date, []),
+ time = Time._fromFfi(ffi.time, []),
+ zone = TimeZoneInfo._fromFfi(ffi.zone, []);
+
+ // ignore: unused_element
+ _ZonedDateTimeFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_ZonedDateTimeFfi>();
+ struct.date = date._ffi;
+ struct.time = time._ffi;
+ struct.zone = zone._ffi;
+ return struct;
+ }
+
+ /// Creates a new [ZonedDateTime] from an IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_full_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html#method.try_full_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory ZonedDateTime.fullFromString(String v, Calendar calendar, IanaParser ianaParser, VariantOffsetsCalculator offsetCalculator) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_ZonedDateTime_full_from_string_mv1(v._utf8AllocIn(temp.arena), calendar._ffi, ianaParser._ffi, offsetCalculator._ffi);
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return ZonedDateTime._fromFfi(result.union.ok);
+ }
+
+ /// Creates a new [ZonedDateTime] from a location-only IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_location_only_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html#method.try_location_only_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory ZonedDateTime.locationOnlyFromString(String v, Calendar calendar, IanaParser ianaParser) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_ZonedDateTime_location_only_from_string_mv1(v._utf8AllocIn(temp.arena), calendar._ffi, ianaParser._ffi);
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return ZonedDateTime._fromFfi(result.union.ok);
+ }
+
+ /// Creates a new [ZonedDateTime] from an offset-only IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_offset_only_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html#method.try_offset_only_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory ZonedDateTime.offsetOnlyFromString(String v, Calendar calendar) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_ZonedDateTime_offset_only_from_string_mv1(v._utf8AllocIn(temp.arena), calendar._ffi);
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return ZonedDateTime._fromFfi(result.union.ok);
+ }
+
+ /// Creates a new [ZonedDateTime] from an IXDTF string, without requiring the offset or calculating the zone variant.
+ ///
+ /// See the [Rust documentation for `try_lenient_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html#method.try_lenient_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory ZonedDateTime.lenientFromString(String v, Calendar calendar, IanaParser ianaParser) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_ZonedDateTime_lenient_from_string_mv1(v._utf8AllocIn(temp.arena), calendar._ffi, ianaParser._ffi);
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return ZonedDateTime._fromFfi(result.union.ok);
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is ZonedDateTime &&
+ other.date == date &&
+ other.time == time &&
+ other.zone == zone;
+
+ @override
+ int get hashCode => Object.hashAll([
+ date,
+ time,
+ zone,
+ ]);
+}
+
+@_DiplomatFfiUse('icu4x_ZonedDateTime_full_from_string_mv1')
+@ffi.Native<_ResultZonedDateTimeFfiInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTime_full_from_string_mv1')
+// ignore: non_constant_identifier_names
+external _ResultZonedDateTimeFfiInt32 _icu4x_ZonedDateTime_full_from_string_mv1(_SliceUtf8 v, ffi.Pointer<ffi.Opaque> calendar, ffi.Pointer<ffi.Opaque> ianaParser, ffi.Pointer<ffi.Opaque> offsetCalculator);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTime_location_only_from_string_mv1')
+@ffi.Native<_ResultZonedDateTimeFfiInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTime_location_only_from_string_mv1')
+// ignore: non_constant_identifier_names
+external _ResultZonedDateTimeFfiInt32 _icu4x_ZonedDateTime_location_only_from_string_mv1(_SliceUtf8 v, ffi.Pointer<ffi.Opaque> calendar, ffi.Pointer<ffi.Opaque> ianaParser);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTime_offset_only_from_string_mv1')
+@ffi.Native<_ResultZonedDateTimeFfiInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTime_offset_only_from_string_mv1')
+// ignore: non_constant_identifier_names
+external _ResultZonedDateTimeFfiInt32 _icu4x_ZonedDateTime_offset_only_from_string_mv1(_SliceUtf8 v, ffi.Pointer<ffi.Opaque> calendar);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTime_lenient_from_string_mv1')
+@ffi.Native<_ResultZonedDateTimeFfiInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTime_lenient_from_string_mv1')
+// ignore: non_constant_identifier_names
+external _ResultZonedDateTimeFfiInt32 _icu4x_ZonedDateTime_lenient_from_string_mv1(_SliceUtf8 v, ffi.Pointer<ffi.Opaque> calendar, ffi.Pointer<ffi.Opaque> ianaParser);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ZonedDateTimeFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/ZonedDateTimeFormatter.g.dart
index d8b9d6a..0964592 100644
--- a/pkgs/intl4x/lib/src/bindings/ZonedDateTimeFormatter.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/ZonedDateTimeFormatter.g.dart
@@ -1,10 +1,9 @@
// generated by diplomat-tool
+// dart format off
part of 'lib.g.dart';
-/// An object capable of formatting a date time with time zone to a string.
-///
-/// See the [Rust documentation for `ZonedDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html) for more information.
+/// See the [Rust documentation for `DateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html) for more information.
final class ZonedDateTimeFormatter implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _ffi;
@@ -22,209 +21,367 @@
}
}
- @_DiplomatFfiUse('ICU4XZonedDateTimeFormatter_destroy')
- static final _finalizer = ffi.NativeFinalizer(
- ffi.Native.addressOf(_ICU4XZonedDateTimeFormatter_destroy),
- );
+ @_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ZonedDateTimeFormatter_destroy_mv1));
- /// Creates a new [`ZonedDateTimeFormatter`] from locale data.
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// This function has `date_length` and `time_length` arguments and uses default options
- /// for the time zone.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new) for more information.
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
///
- /// Throws [Error] on failure.
- factory ZonedDateTimeFormatter.withLengths(
- DataProvider provider,
- Locale locale,
- DateLength dateLength,
- TimeLength timeLength,
- ) {
- final result = _ICU4XZonedDateTimeFormatter_create_with_lengths(
- provider._ffi,
- locale._ffi,
- dateLength.index,
- timeLength.index,
- );
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.specificLong(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_specific_long_mv1(locale._ffi, formatter._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
}
- /// Creates a new [`ZonedDateTimeFormatter`] from locale data.
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// This function has `date_length` and `time_length` arguments and uses an ISO-8601 style
- /// fallback for the time zone with the given configurations.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new) for more information.
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
///
- /// Throws [Error] on failure.
- factory ZonedDateTimeFormatter.withLengthsAndIso8601TimeZoneFallback(
- DataProvider provider,
- Locale locale,
- DateLength dateLength,
- TimeLength timeLength,
- IsoTimeZoneOptions zoneOptions,
- ) {
- final temp = ffi2.Arena();
- final result =
- _ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(
- provider._ffi,
- locale._ffi,
- dateLength.index,
- timeLength.index,
- zoneOptions._toFfi(temp),
- );
- temp.releaseAll();
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.specificLongWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_specific_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`DateTime`] and [`CustomTimeZone`] to a string.
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- String formatDatetimeWithCustomTimeZone(
- DateTime datetime,
- CustomTimeZone timeZone,
- ) {
- final writeable = _Writeable();
- final result =
- _ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(
- _ffi,
- datetime._ffi,
- timeZone._ffi,
- writeable._ffi,
- );
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.specificShort(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_specific_short_mv1(locale._ffi, formatter._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
}
- /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string.
+ /// Creates a zoned formatter based on a non-zoned formatter.
///
- /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information.
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
///
- /// Throws [Error] on failure.
- String formatIsoDatetimeWithCustomTimeZone(
- IsoDateTime datetime,
- CustomTimeZone timeZone,
- ) {
- final writeable = _Writeable();
- final result =
- _ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(
- _ffi,
- datetime._ffi,
- timeZone._ffi,
- writeable._ffi,
- );
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.specificShortWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_specific_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
if (!result.isOk) {
- throw Error.values.firstWhere((v) => v._ffi == result.union.err);
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
- return writeable.finalize();
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
}
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.localizedOffsetLong(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_localized_offset_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.localizedOffsetLongWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_localized_offset_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.localizedOffsetShort(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_localized_offset_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.localizedOffsetShortWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_localized_offset_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.genericLong(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_generic_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.genericLongWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_generic_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.genericShort(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_generic_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.genericShortWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_generic_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.location(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_location_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.locationWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_location_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.exemplarCity(Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_exemplar_city_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatter.exemplarCityWithProvider(DataProvider provider, Locale locale, DateTimeFormatter formatter) {
+ final result = _icu4x_ZonedDateTimeFormatter_create_exemplar_city_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information.
+ ///
+ /// Throws [DateTimeWriteError] on failure.
+ String formatIso(IsoDate isoDate, Time time, TimeZoneInfo zone) {
+ final write = _Write();
+ final result = _icu4x_ZonedDateTimeFormatter_format_iso_mv1(_ffi, isoDate._ffi, time._ffi, zone._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeWriteError.values[result.union.err];
+ }
+ return write.finalize();
+ }
+
}
-@_DiplomatFfiUse('ICU4XZonedDateTimeFormatter_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(
- isLeaf: true,
- symbol: 'ICU4XZonedDateTimeFormatter_destroy',
-)
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_destroy_mv1')
// ignore: non_constant_identifier_names
-external void _ICU4XZonedDateTimeFormatter_destroy(ffi.Pointer<ffi.Void> self);
+external void _icu4x_ZonedDateTimeFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
-@_DiplomatFfiUse('ICU4XZonedDateTimeFormatter_create_with_lengths')
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- ffi.Int32,
- )
->(isLeaf: true, symbol: 'ICU4XZonedDateTimeFormatter_create_with_lengths')
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_specific_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_specific_long_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32 _ICU4XZonedDateTimeFormatter_create_with_lengths(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int dateLength,
- int timeLength,
-);
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_specific_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
-@_DiplomatFfiUse(
- 'ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback',
-)
-@ffi.Native<
- _ResultOpaqueInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Int32,
- ffi.Int32,
- _IsoTimeZoneOptionsFfi,
- )
->(
- isLeaf: true,
- symbol:
- 'ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback',
-)
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_specific_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_specific_long_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultOpaqueInt32
-_ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(
- ffi.Pointer<ffi.Opaque> provider,
- ffi.Pointer<ffi.Opaque> locale,
- int dateLength,
- int timeLength,
- _IsoTimeZoneOptionsFfi zoneOptions,
-);
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_specific_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
-@_DiplomatFfiUse(
- 'ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone',
-)
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(
- isLeaf: true,
- symbol: 'ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone',
-)
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_specific_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_specific_short_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> datetime,
- ffi.Pointer<ffi.Opaque> timeZone,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_specific_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
-@_DiplomatFfiUse(
- 'ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone',
-)
-@ffi.Native<
- _ResultVoidInt32 Function(
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- ffi.Pointer<ffi.Opaque>,
- )
->(
- isLeaf: true,
- symbol:
- 'ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone',
-)
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_specific_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_specific_short_with_provider_mv1')
// ignore: non_constant_identifier_names
-external _ResultVoidInt32
-_ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(
- ffi.Pointer<ffi.Opaque> self,
- ffi.Pointer<ffi.Opaque> datetime,
- ffi.Pointer<ffi.Opaque> timeZone,
- ffi.Pointer<ffi.Opaque> writeable,
-);
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_specific_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_localized_offset_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_localized_offset_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_localized_offset_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_localized_offset_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_localized_offset_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_localized_offset_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_localized_offset_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_localized_offset_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_localized_offset_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_localized_offset_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_localized_offset_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_localized_offset_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_generic_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_generic_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_generic_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_generic_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_generic_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_generic_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_generic_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_generic_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_generic_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_generic_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_generic_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_generic_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_location_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_location_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_location_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_location_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_location_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_location_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_exemplar_city_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_exemplar_city_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_exemplar_city_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_create_exemplar_city_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_create_exemplar_city_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatter_create_exemplar_city_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatter_format_iso_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatter_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidInt32 _icu4x_ZonedDateTimeFormatter_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> time, ffi.Pointer<ffi.Opaque> zone, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ZonedDateTimeFormatterGregorian.g.dart b/pkgs/intl4x/lib/src/bindings/ZonedDateTimeFormatterGregorian.g.dart
new file mode 100644
index 0000000..a6c04a8
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/ZonedDateTimeFormatterGregorian.g.dart
@@ -0,0 +1,387 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information.
+final class ZonedDateTimeFormatterGregorian implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ ZonedDateTimeFormatterGregorian._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ZonedDateTimeFormatterGregorian_destroy_mv1));
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.specificLong(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.specificLongWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.specificShort(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.specificShortWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.localizedOffsetLong(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.localizedOffsetLongWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.localizedOffsetShort(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.localizedOffsetShortWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.genericLong(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.genericLongWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.genericShort(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.genericShortWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.location(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_location_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.locationWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_location_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.exemplarCity(Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_mv1(locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedDateTimeFormatterGregorian.exemplarCityWithProvider(DataProvider provider, Locale locale, DateTimeFormatterGregorian formatter) {
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedDateTimeFormatterGregorian._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
+ ///
+ /// Throws [DateTimeWriteError] on failure.
+ String formatIso(IsoDate isoDate, Time time, TimeZoneInfo zone) {
+ final write = _Write();
+ final result = _icu4x_ZonedDateTimeFormatterGregorian_format_iso_mv1(_ffi, isoDate._ffi, time._ffi, zone._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeWriteError.values[result.union.err];
+ }
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_ZonedDateTimeFormatterGregorian_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_location_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_location_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_location_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_location_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_location_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_location_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_mv1(ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, ffi.Pointer<ffi.Opaque> formatter);
+
+@_DiplomatFfiUse('icu4x_ZonedDateTimeFormatterGregorian_format_iso_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedDateTimeFormatterGregorian_format_iso_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidInt32 _icu4x_ZonedDateTimeFormatterGregorian_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> time, ffi.Pointer<ffi.Opaque> zone, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ZonedIsoDateTime.g.dart b/pkgs/intl4x/lib/src/bindings/ZonedIsoDateTime.g.dart
new file mode 100644
index 0000000..cd7bfe9
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/ZonedIsoDateTime.g.dart
@@ -0,0 +1,90 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+final class _ZonedIsoDateTimeFfi extends ffi.Struct {
+ external ffi.Pointer<ffi.Opaque> date;
+ external ffi.Pointer<ffi.Opaque> time;
+ external ffi.Pointer<ffi.Opaque> zone;
+}
+
+/// An ICU4X ZonedDateTime object capable of containing a ISO-8601 date, time, and zone.
+///
+/// See the [Rust documentation for `ZonedDateTime`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html) for more information.
+final class ZonedIsoDateTime {
+ final IsoDate date;
+ final Time time;
+ final TimeZoneInfo zone;
+
+ // This struct contains borrowed fields, so this takes in a list of
+ // "edges" corresponding to where each lifetime's data may have been borrowed from
+ // and passes it down to individual fields containing the borrow.
+ // This method does not attempt to handle any dependencies between lifetimes, the caller
+ // should handle this when constructing edge arrays.
+ // ignore: unused_element
+ ZonedIsoDateTime._fromFfi(_ZonedIsoDateTimeFfi ffi) :
+ date = IsoDate._fromFfi(ffi.date, []),
+ time = Time._fromFfi(ffi.time, []),
+ zone = TimeZoneInfo._fromFfi(ffi.zone, []);
+
+ // ignore: unused_element
+ _ZonedIsoDateTimeFfi _toFfi(ffi.Allocator temp) {
+ final struct = ffi.Struct.create<_ZonedIsoDateTimeFfi>();
+ struct.date = date._ffi;
+ struct.time = time._ffi;
+ struct.zone = zone._ffi;
+ return struct;
+ }
+
+ /// Creates a new [ZonedIsoDateTime] from an IXDTF string.
+ ///
+ /// See the [Rust documentation for `try_full_from_str`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html#method.try_full_from_str) for more information.
+ ///
+ /// Throws [Rfc9557ParseError] on failure.
+ factory ZonedIsoDateTime.fullFromString(String v, IanaParser ianaParser, VariantOffsetsCalculator offsetCalculator) {
+ final temp = _FinalizedArena();
+ final result = _icu4x_ZonedIsoDateTime_full_from_string_mv1(v._utf8AllocIn(temp.arena), ianaParser._ffi, offsetCalculator._ffi);
+ if (!result.isOk) {
+ throw Rfc9557ParseError.values[result.union.err];
+ }
+ return ZonedIsoDateTime._fromFfi(result.union.ok);
+ }
+
+ /// Creates a new [ZonedIsoDateTime] from milliseconds since epoch (timestamp) and a UTC offset.
+ ///
+ /// Note: [ZonedIsoDateTime]s created with this constructor can only be formatted using localized offset zone styles.
+ ///
+ /// See the [Rust documentation for `from_epoch_milliseconds_and_utc_offset`](https://docs.rs/icu/2.0.0/icu/time/struct.ZonedDateTime.html#method.from_epoch_milliseconds_and_utc_offset) for more information.
+ factory ZonedIsoDateTime.fromEpochMillisecondsAndUtcOffset(int epochMilliseconds, UtcOffset utcOffset) {
+ final result = _icu4x_ZonedIsoDateTime_from_epoch_milliseconds_and_utc_offset_mv1(epochMilliseconds, utcOffset._ffi);
+ return ZonedIsoDateTime._fromFfi(result);
+ }
+
+
+ @override
+ bool operator ==(Object other) =>
+ other is ZonedIsoDateTime &&
+ other.date == date &&
+ other.time == time &&
+ other.zone == zone;
+
+ @override
+ int get hashCode => Object.hashAll([
+ date,
+ time,
+ zone,
+ ]);
+}
+
+@_DiplomatFfiUse('icu4x_ZonedIsoDateTime_full_from_string_mv1')
+@ffi.Native<_ResultZonedIsoDateTimeFfiInt32 Function(_SliceUtf8, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedIsoDateTime_full_from_string_mv1')
+// ignore: non_constant_identifier_names
+external _ResultZonedIsoDateTimeFfiInt32 _icu4x_ZonedIsoDateTime_full_from_string_mv1(_SliceUtf8 v, ffi.Pointer<ffi.Opaque> ianaParser, ffi.Pointer<ffi.Opaque> offsetCalculator);
+
+@_DiplomatFfiUse('icu4x_ZonedIsoDateTime_from_epoch_milliseconds_and_utc_offset_mv1')
+@ffi.Native<_ZonedIsoDateTimeFfi Function(ffi.Int64, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedIsoDateTime_from_epoch_milliseconds_and_utc_offset_mv1')
+// ignore: non_constant_identifier_names
+external _ZonedIsoDateTimeFfi _icu4x_ZonedIsoDateTime_from_epoch_milliseconds_and_utc_offset_mv1(int epochMilliseconds, ffi.Pointer<ffi.Opaque> utcOffset);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/ZonedTimeFormatter.g.dart b/pkgs/intl4x/lib/src/bindings/ZonedTimeFormatter.g.dart
new file mode 100644
index 0000000..f624518
--- /dev/null
+++ b/pkgs/intl4x/lib/src/bindings/ZonedTimeFormatter.g.dart
@@ -0,0 +1,387 @@
+// generated by diplomat-tool
+// dart format off
+
+part of 'lib.g.dart';
+
+/// See the [Rust documentation for `NoCalendarFormatter`](https://docs.rs/icu/2.0.0/icu/datetime/type.NoCalendarFormatter.html) for more information.
+final class ZonedTimeFormatter implements ffi.Finalizable {
+ final ffi.Pointer<ffi.Opaque> _ffi;
+
+ // These are "used" in the sense that they keep dependencies alive
+ // ignore: unused_field
+ final core.List<Object> _selfEdge;
+
+ // This takes in a list of lifetime edges (including for &self borrows)
+ // corresponding to data this may borrow from. These should be flat arrays containing
+ // references to objects, and this object will hold on to them to keep them alive and
+ // maintain borrow validity.
+ ZonedTimeFormatter._fromFfi(this._ffi, this._selfEdge) {
+ if (_selfEdge.isEmpty) {
+ _finalizer.attach(this, _ffi.cast());
+ }
+ }
+
+ @_DiplomatFfiUse('icu4x_ZonedTimeFormatter_destroy_mv1')
+ static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ZonedTimeFormatter_destroy_mv1));
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.specificLong(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_specific_long_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.specificLongWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_specific_long_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.specificShort(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_specific_short_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.specificShortWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_specific_short_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.localizedOffsetLong(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_localized_offset_long_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.localizedOffsetLongWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_localized_offset_long_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.localizedOffsetShort(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_localized_offset_short_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.localizedOffsetShortWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_localized_offset_short_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.genericLong(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_generic_long_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericLong`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.genericLongWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_generic_long_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.genericShort(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_generic_short_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `GenericShort`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.genericShortWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_generic_short_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.location(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_location_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `Location`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.locationWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_location_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.exemplarCity(Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_exemplar_city_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// Creates a zoned formatter based on a non-zoned formatter.
+ ///
+ /// Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
+ /// or else unexpected behavior may occur!
+ ///
+ /// See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/2.0.0/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
+ ///
+ /// Throws [DateTimeFormatterLoadError] on failure.
+ factory ZonedTimeFormatter.exemplarCityWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, TimePrecision? timePrecision, DateTimeAlignment? alignment}) {
+ final result = _icu4x_ZonedTimeFormatter_create_exemplar_city_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), timePrecision != null ? _ResultInt32Void.ok(timePrecision.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
+ if (!result.isOk) {
+ throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
+ }
+ return ZonedTimeFormatter._fromFfi(result.union.ok, []);
+ }
+
+ /// See the [Rust documentation for `format`](https://docs.rs/icu/2.0.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
+ ///
+ /// Throws [DateTimeWriteError] on failure.
+ String format(Time time, TimeZoneInfo zone) {
+ final write = _Write();
+ final result = _icu4x_ZonedTimeFormatter_format_mv1(_ffi, time._ffi, zone._ffi, write._ffi);
+ if (!result.isOk) {
+ throw DateTimeWriteError.values[result.union.err];
+ }
+ return write.finalize();
+ }
+
+}
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_destroy_mv1')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_destroy_mv1')
+// ignore: non_constant_identifier_names
+external void _icu4x_ZonedTimeFormatter_destroy_mv1(ffi.Pointer<ffi.Void> self);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_specific_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_specific_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_specific_long_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_specific_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_specific_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_specific_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_specific_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_specific_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_specific_short_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_specific_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_specific_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_specific_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_localized_offset_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_localized_offset_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_localized_offset_long_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_localized_offset_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_localized_offset_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_localized_offset_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_localized_offset_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_localized_offset_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_localized_offset_short_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_localized_offset_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_localized_offset_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_localized_offset_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_generic_long_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_generic_long_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_generic_long_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_generic_long_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_generic_long_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_generic_long_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_generic_short_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_generic_short_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_generic_short_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_generic_short_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_generic_short_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_generic_short_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_location_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_location_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_location_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_location_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_location_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_location_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_exemplar_city_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_exemplar_city_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_exemplar_city_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_create_exemplar_city_with_provider_mv1')
+@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_create_exemplar_city_with_provider_mv1')
+// ignore: non_constant_identifier_names
+external _ResultOpaqueInt32 _icu4x_ZonedTimeFormatter_create_exemplar_city_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void timePrecision, _ResultInt32Void alignment);
+
+@_DiplomatFfiUse('icu4x_ZonedTimeFormatter_format_mv1')
+@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_ZonedTimeFormatter_format_mv1')
+// ignore: non_constant_identifier_names
+external _ResultVoidInt32 _icu4x_ZonedTimeFormatter_format_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> time, ffi.Pointer<ffi.Opaque> zone, ffi.Pointer<ffi.Opaque> write);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/bindings/lib.g.dart b/pkgs/intl4x/lib/src/bindings/lib.g.dart
index 716d4ab..30ce72b 100644
--- a/pkgs/intl4x/lib/src/bindings/lib.g.dart
+++ b/pkgs/intl4x/lib/src/bindings/lib.g.dart
@@ -1,22 +1,27 @@
// generated by diplomat-tool
+// dart format off
-import 'dart:convert';
+// ignore: unused_import
import 'dart:core' as core;
-import 'dart:core' show Object, String, bool, double, int, override;
-import 'dart:ffi' as ffi;
-import 'dart:math';
+// ignore: unused_import
import 'dart:typed_data';
-
-import 'package:meta/meta.dart' show RecordUse, mustBeConst;
+// ignore: unused_shown_name
+import 'dart:core' show int, double, bool, String, Object, override;
+import 'dart:convert';
+import 'dart:ffi' as ffi;
import 'package:ffi/ffi.dart' as ffi2 show Arena, calloc;
-
-part 'AnyCalendarKind.g.dart';
-part 'Bcp47ToIanaMapper.g.dart';
+import 'package:meta/meta.dart' as meta;
part 'Bidi.g.dart';
+part 'BidiClass.g.dart';
part 'BidiDirection.g.dart';
part 'BidiInfo.g.dart';
+part 'BidiMirroringGlyph.g.dart';
+part 'BidiPairedBracketType.g.dart';
part 'BidiParagraph.g.dart';
part 'Calendar.g.dart';
+part 'CalendarError.g.dart';
+part 'CalendarKind.g.dart';
+part 'CanonicalCombiningClass.g.dart';
part 'CanonicalCombiningClassMap.g.dart';
part 'CanonicalComposition.g.dart';
part 'CanonicalDecomposition.g.dart';
@@ -30,50 +35,63 @@
part 'CodePointSetData.g.dart';
part 'Collator.g.dart';
part 'CollatorAlternateHandling.g.dart';
-part 'CollatorBackwardSecondLevel.g.dart';
part 'CollatorCaseFirst.g.dart';
part 'CollatorCaseLevel.g.dart';
part 'CollatorMaxVariable.g.dart';
-part 'CollatorNumeric.g.dart';
+part 'CollatorNumericOrdering.g.dart';
part 'CollatorOptions.g.dart';
+part 'CollatorResolvedOptions.g.dart';
part 'CollatorStrength.g.dart';
part 'ComposingNormalizer.g.dart';
-part 'CustomTimeZone.g.dart';
+part 'DataError.g.dart';
part 'DataProvider.g.dart';
part 'Date.g.dart';
part 'DateFormatter.g.dart';
-part 'DateLength.g.dart';
+part 'DateFormatterGregorian.g.dart';
part 'DateTime.g.dart';
+part 'DateTimeAlignment.g.dart';
part 'DateTimeFormatter.g.dart';
+part 'DateTimeFormatterGregorian.g.dart';
+part 'DateTimeFormatterLoadError.g.dart';
+part 'DateTimeLength.g.dart';
+part 'DateTimeMismatchedCalendarError.g.dart';
+part 'DateTimeWriteError.g.dart';
+part 'Decimal.g.dart';
+part 'DecimalFormatter.g.dart';
+part 'DecimalGroupingStrategy.g.dart';
+part 'DecimalLimitError.g.dart';
+part 'DecimalParseError.g.dart';
+part 'DecimalRoundingIncrement.g.dart';
+part 'DecimalSign.g.dart';
+part 'DecimalSignDisplay.g.dart';
+part 'DecimalSignedRoundingMode.g.dart';
part 'Decomposed.g.dart';
part 'DecomposingNormalizer.g.dart';
part 'DisplayNamesFallback.g.dart';
part 'DisplayNamesOptions.g.dart';
part 'DisplayNamesStyle.g.dart';
-part 'Error.g.dart';
-part 'FixedDecimal.g.dart';
-part 'FixedDecimalFormatter.g.dart';
-part 'FixedDecimalGroupingStrategy.g.dart';
-part 'FixedDecimalSign.g.dart';
-part 'FixedDecimalSignDisplay.g.dart';
-part 'GeneralCategoryNameToMaskMapper.g.dart';
+part 'EastAsianWidth.g.dart';
+part 'EmojiSetData.g.dart';
+part 'ExemplarCharacters.g.dart';
+part 'GeneralCategory.g.dart';
+part 'GeneralCategoryGroup.g.dart';
+part 'GeneralCategoryNameToGroupMapper.g.dart';
+part 'GraphemeClusterBreak.g.dart';
part 'GraphemeClusterBreakIteratorLatin1.g.dart';
part 'GraphemeClusterBreakIteratorUtf16.g.dart';
part 'GraphemeClusterBreakIteratorUtf8.g.dart';
part 'GraphemeClusterSegmenter.g.dart';
-part 'GregorianDateFormatter.g.dart';
-part 'GregorianDateTimeFormatter.g.dart';
-part 'GregorianZonedDateTimeFormatter.g.dart';
-part 'IanaToBcp47Mapper.g.dart';
+part 'HangulSyllableType.g.dart';
+part 'IanaParser.g.dart';
+part 'IanaParserExtended.g.dart';
+part 'IndicSyllabicCategory.g.dart';
part 'IsoDate.g.dart';
part 'IsoDateTime.g.dart';
-part 'IsoTimeZoneFormat.g.dart';
-part 'IsoTimeZoneMinuteDisplay.g.dart';
-part 'IsoTimeZoneOptions.g.dart';
-part 'IsoTimeZoneSecondDisplay.g.dart';
-part 'IsoWeekday.g.dart';
+part 'IsoWeekOfYear.g.dart';
+part 'JoiningType.g.dart';
part 'LanguageDisplay.g.dart';
part 'LeadingAdjustment.g.dart';
+part 'LineBreak.g.dart';
part 'LineBreakIteratorLatin1.g.dart';
part 'LineBreakIteratorUtf16.g.dart';
part 'LineBreakIteratorUtf8.g.dart';
@@ -92,13 +110,12 @@
part 'LocaleFallbackConfig.g.dart';
part 'LocaleFallbackIterator.g.dart';
part 'LocaleFallbackPriority.g.dart';
-part 'LocaleFallbackSupplement.g.dart';
part 'LocaleFallbacker.g.dart';
part 'LocaleFallbackerWithConfig.g.dart';
+part 'LocaleParseError.g.dart';
part 'Logger.g.dart';
part 'MeasureUnit.g.dart';
part 'MeasureUnitParser.g.dart';
-part 'MetazoneCalculator.g.dart';
part 'PluralCategories.g.dart';
part 'PluralCategory.g.dart';
part 'PluralOperands.g.dart';
@@ -106,52 +123,77 @@
part 'PropertyValueNameToEnumMapper.g.dart';
part 'RegionDisplayNames.g.dart';
part 'ReorderedIndexMap.g.dart';
-part 'ResolvedCollatorOptions.g.dart';
-part 'RoundingIncrement.g.dart';
+part 'Rfc9557ParseError.g.dart';
+part 'Script.g.dart';
part 'ScriptExtensionsSet.g.dart';
part 'ScriptWithExtensions.g.dart';
part 'ScriptWithExtensionsBorrowed.g.dart';
part 'SegmenterWordType.g.dart';
+part 'SentenceBreak.g.dart';
part 'SentenceBreakIteratorLatin1.g.dart';
part 'SentenceBreakIteratorUtf16.g.dart';
part 'SentenceBreakIteratorUtf8.g.dart';
part 'SentenceSegmenter.g.dart';
part 'Time.g.dart';
part 'TimeFormatter.g.dart';
-part 'TimeLength.g.dart';
+part 'TimePrecision.g.dart';
+part 'TimeZone.g.dart';
+part 'TimeZoneAndCanonical.g.dart';
+part 'TimeZoneAndCanonicalAndNormalized.g.dart';
+part 'TimeZoneAndCanonicalAndNormalizedIterator.g.dart';
+part 'TimeZoneAndCanonicalIterator.g.dart';
part 'TimeZoneFormatter.g.dart';
-part 'TimeZoneIdMapper.g.dart';
-part 'TimeZoneIdMapperWithFastCanonicalization.g.dart';
+part 'TimeZoneInfo.g.dart';
+part 'TimeZoneInvalidOffsetError.g.dart';
+part 'TimeZoneIterator.g.dart';
+part 'TimeZoneVariant.g.dart';
part 'TitlecaseMapper.g.dart';
part 'TitlecaseOptions.g.dart';
part 'TrailingCase.g.dart';
part 'TransformResult.g.dart';
-part 'UnicodeSetData.g.dart';
part 'UnitsConverter.g.dart';
part 'UnitsConverterFactory.g.dart';
-part 'WeekCalculator.g.dart';
-part 'WeekOf.g.dart';
-part 'WeekRelativeUnit.g.dart';
-part 'WeekendContainsDay.g.dart';
+part 'UtcOffset.g.dart';
+part 'VariantOffsets.g.dart';
+part 'VariantOffsetsCalculator.g.dart';
+part 'VerticalOrientation.g.dart';
+part 'WeekInformation.g.dart';
+part 'Weekday.g.dart';
+part 'WeekdaySetIterator.g.dart';
+part 'WindowsParser.g.dart';
+part 'WordBreak.g.dart';
part 'WordBreakIteratorLatin1.g.dart';
part 'WordBreakIteratorUtf16.g.dart';
part 'WordBreakIteratorUtf8.g.dart';
part 'WordSegmenter.g.dart';
+part 'YearStyle.g.dart';
+part 'ZonedDateFormatter.g.dart';
+part 'ZonedDateFormatterGregorian.g.dart';
+part 'ZonedDateTime.g.dart';
part 'ZonedDateTimeFormatter.g.dart';
+part 'ZonedDateTimeFormatterGregorian.g.dart';
+part 'ZonedIsoDateTime.g.dart';
+part 'ZonedTimeFormatter.g.dart';
+
+@meta.RecordUse()
+class _DiplomatFfiUse {
+ final String symbol;
+
+ const _DiplomatFfiUse(@meta.mustBeConst this.symbol);
+}
/// A [Rune] is a Unicode code point, such as `a`, or `💡`.
///
/// The recommended way to obtain a [Rune] is to create it from a
-/// [String], which is conceptually a list of [Runes]. For example,
-/// `'a'.runes.first` is equal to the [Rune] `a`.
+/// [String], which is conceptually a sequence of [Rune]s. For
+/// example, `'a'.runes.first` is equal to the [Rune] `a`.
///
-/// Dart does not have a character/rune literal, so integer literals
-/// need to be used. For example the Unicode code point U+1F4A1, `💡`,
-/// can be represented by `0x1F4A1`. Note that only values in the ranges
-/// `0x0..0xD7FF` and `0xE000..0x10FFFF` (both inclusive) are Unicode
-/// code points, and hence valid [Rune]s.
+/// Dart does not have a character/rune literal (https://github.com/dart-lang/language/issues/886),
+/// so integer literals need to be used. For example the Unicode code point
+/// U+1F4A1, `💡`, can be represented by `0x1F4A1`.
///
-/// A [String] can be constructed from a [Rune] using [String.fromCharCode].
+/// A [String] can be constructed from a [Rune] using (the [confusingly named](
+/// https://github.com/dart-lang/sdk/issues/56304)) [String.fromCharCode].
typedef Rune = int;
// ignore: unused_element
@@ -161,19 +203,13 @@
final _nopFree = core.Finalizer((nothing) => {});
// ignore: unused_element
-final _rustFree = core.Finalizer(
- (({ffi.Pointer<ffi.Void> pointer, int bytes, int align}) record) =>
- _diplomat_free(record.pointer, record.bytes, record.align),
-);
+final _rustFree = core.Finalizer((({ffi.Pointer<ffi.Void> pointer, int bytes, int align}) record) => _diplomat_free(record.pointer, record.bytes, record.align));
// ignore: unused_element
final class _RustAlloc implements ffi.Allocator {
@override
- ffi.Pointer<T> allocate<T extends ffi.NativeType>(
- int byteCount, {
- int? alignment,
- }) {
- return _diplomat_alloc(byteCount, alignment ?? 1).cast();
+ ffi.Pointer<T> allocate<T extends ffi.NativeType>(int byteCount, {int? alignment}) {
+ return _diplomat_alloc(byteCount, alignment ?? 1).cast();
}
@override
@@ -183,27 +219,20 @@
}
@_DiplomatFfiUse('diplomat_alloc')
-@ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Size, ffi.Size)>(
- symbol: 'diplomat_alloc',
- isLeaf: true,
-)
+@ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Size, ffi.Size)>(symbol: 'diplomat_alloc', isLeaf: true)
// ignore: non_constant_identifier_names
external ffi.Pointer<ffi.Void> _diplomat_alloc(int len, int align);
@_DiplomatFfiUse('diplomat_free')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Void>, ffi.Size, ffi.Size)>(
- symbol: 'diplomat_free',
- isLeaf: true,
-)
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Void>, ffi.Size, ffi.Size)>(symbol: 'diplomat_free', isLeaf: true)
// ignore: non_constant_identifier_names
external int _diplomat_free(ffi.Pointer<ffi.Void> ptr, int len, int align);
+
// ignore: unused_element
class _FinalizedArena {
final ffi2.Arena arena;
- static final core.Finalizer<ffi2.Arena> _finalizer = core.Finalizer(
- (arena) => arena.releaseAll(),
- );
+ static final core.Finalizer<ffi2.Arena> _finalizer = core.Finalizer((arena) => arena.releaseAll());
// ignore: unused_element
_FinalizedArena() : arena = ffi2.Arena() {
@@ -211,8 +240,7 @@
}
// ignore: unused_element
- _FinalizedArena.withLifetime(core.List<core.List<Object>> lifetimeAppendArray)
- : arena = ffi2.Arena() {
+ _FinalizedArena.withLifetime(core.List<core.List<Object>> lifetimeAppendArray) : arena = ffi2.Arena() {
_finalizer.attach(this, arena);
for (final edge in lifetimeAppendArray) {
edge.add(this);
@@ -220,380 +248,40 @@
}
}
-extension on ByteBuffer {
- // ignore: unused_element
- ffi.Pointer<ffi.Uint8> allocIn(ffi.Allocator alloc) {
- return alloc<ffi.Uint8>(length)
- ..asTypedList(length).setRange(0, length, asUint8List());
- }
- int get length => lengthInBytes;
-}
-
-extension on String {
- // ignore: unused_element
- _Utf8View get utf8View => _Utf8View(this);
- // ignore: unused_element
- _Utf16View get utf16View => _Utf16View(this);
-}
-
-extension on core.List<String> {
- // ignore: unused_element
- _ListUtf8View get utf8View => _ListUtf8View(this);
- // ignore: unused_element
- _ListUtf16View get utf16View => _ListUtf16View(this);
-}
-
-extension on core.List<bool> {
- // ignore: unused_element
- _BoolListView get boolView => _BoolListView(this);
-}
-
-extension on core.List<int> {
- // ignore: unused_element
- _Int8ListView get int8View => _Int8ListView(this);
- // ignore: unused_element
- _Int16ListView get int16View => _Int16ListView(this);
- // ignore: unused_element
- _Int32ListView get int32View => _Int32ListView(this);
- // ignore: unused_element
- _Int64ListView get int64View => _Int64ListView(this);
- // ignore: unused_element
- _IsizeListView get isizeView => _IsizeListView(this);
- // ignore: unused_element
- _Uint8ListView get uint8View => _Uint8ListView(this);
- // ignore: unused_element
- _Uint16ListView get uint16View => _Uint16ListView(this);
- // ignore: unused_element
- _Uint32ListView get uint32View => _Uint32ListView(this);
- // ignore: unused_element
- _Uint64ListView get uint64View => _Uint64ListView(this);
- // ignore: unused_element
- _UsizeListView get usizeView => _UsizeListView(this);
-}
-
-extension on core.List<double> {
- // ignore: unused_element
- _Float32ListView get float32View => _Float32ListView(this);
- // ignore: unused_element
- _Float64ListView get float64View => _Float64ListView(this);
-}
-
-// ignore: unused_element
-class _Utf8View {
- final Uint8List _codeUnits;
-
- // Copies
- _Utf8View(String string) : _codeUnits = Utf8Encoder().convert(string);
-
- ffi.Pointer<ffi.Uint8> allocIn(ffi.Allocator alloc) {
- // Copies
- return alloc<ffi.Uint8>(length)
- ..asTypedList(length).setRange(0, length, _codeUnits);
- }
-
- int get length => _codeUnits.length;
-}
-
-// ignore: unused_element
-class _Utf16View {
- final core.List<int> _codeUnits;
-
- _Utf16View(String string) : _codeUnits = string.codeUnits;
-
- ffi.Pointer<ffi.Uint16> allocIn(ffi.Allocator alloc) {
- // Copies
- return alloc<ffi.Uint16>(length)
- ..asTypedList(length).setRange(0, length, _codeUnits);
- }
-
- int get length => _codeUnits.length;
-}
-
-// ignore: unused_element
-class _ListUtf8View {
- final core.List<String> _strings;
-
- // Copies
- _ListUtf8View(this._strings);
-
- ffi.Pointer<_SliceUtf8> allocIn(ffi.Allocator alloc) {
- final slice = alloc<_SliceUtf8>(length);
- for (var i = 0; i < length; i++) {
- final codeUnits = Utf8Encoder().convert(_strings[i]);
- final str = alloc<ffi.Uint8>(
- codeUnits.length,
- )..asTypedList(codeUnits.length).setRange(0, codeUnits.length, codeUnits);
- slice[i]._data = str;
- slice[i]._length = codeUnits.length;
- }
- return slice;
- }
-
- int get length => _strings.length;
-}
-
-// ignore: unused_element
-class _ListUtf16View {
- final core.List<String> _strings;
-
- _ListUtf16View(this._strings);
-
- ffi.Pointer<_SliceUtf16> allocIn(ffi.Allocator alloc) {
- final slice = alloc<_SliceUtf16>(length);
- for (var i = 0; i < length; i++) {
- final codeUnits = _strings[i].codeUnits;
- final str = alloc<ffi.Uint16>(
- codeUnits.length,
- )..asTypedList(codeUnits.length).setRange(0, codeUnits.length, codeUnits);
- slice[i]._data = str;
- slice[i]._length = codeUnits.length;
- }
- return slice;
- }
-
- int get length => _strings.length;
-}
-
-// ignore: unused_element
-class _BoolListView {
- final core.List<bool> _values;
-
- _BoolListView(this._values);
-
- // Copies
- ffi.Pointer<ffi.Bool> allocIn(ffi.Allocator alloc) {
- final pointer = alloc<ffi.Bool>(_values.length);
- for (var i = 0; i < _values.length; i++) {
- pointer[i] = _values[i];
- }
- return pointer;
- }
-
- int get length => _values.length;
-}
-
-class _Int8ListView {
- final core.List<int> _values;
-
- _Int8ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Int8> allocIn(ffi.Allocator alloc) {
- return alloc<ffi.Int8>(length)
- ..asTypedList(length).setRange(0, length, _values);
- }
-
- int get length => _values.length;
-}
-
-class _Int16ListView {
- final core.List<int> _values;
-
- _Int16ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Int16> allocIn(ffi.Allocator alloc) {
- return alloc<ffi.Int16>(length)
- ..asTypedList(length).setRange(0, length, _values);
- }
-
- int get length => _values.length;
-}
-
-class _Int32ListView {
- final core.List<int> _values;
-
- _Int32ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Int32> allocIn(ffi.Allocator alloc) {
- return alloc<ffi.Int32>(length)
- ..asTypedList(length).setRange(0, length, _values);
- }
-
- int get length => _values.length;
-}
-
-class _Int64ListView {
- final core.List<int> _values;
-
- _Int64ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Int64> allocIn(ffi.Allocator alloc) {
- return alloc<ffi.Int64>(length)
- ..asTypedList(length).setRange(0, length, _values);
- }
-
- int get length => _values.length;
-}
-
-// ignore: unused_element
-class _IsizeListView {
- final core.List<int> _values;
-
- _IsizeListView(this._values);
-
- // Copies
- ffi.Pointer<ffi.IntPtr> allocIn(ffi.Allocator alloc) {
- final pointer = alloc<ffi.IntPtr>(_values.length);
- for (var i = 0; i < _values.length; i++) {
- pointer[i] = _values[i];
- }
- return pointer;
- }
-
- int get length => _values.length;
-}
-
-class _Uint8ListView {
- final core.List<int> _values;
-
- _Uint8ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Uint8> allocIn(ffi.Allocator alloc) {
- final pointer = alloc<ffi.Uint8>(_values.length);
- for (var i = 0; i < _values.length; i++) {
- pointer[i] = min(255, max(0, _values[i]));
- }
- return pointer;
- }
-
- int get length => _values.length;
-}
-
-class _Uint16ListView {
- final core.List<int> _values;
-
- _Uint16ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Uint16> allocIn(ffi.Allocator alloc) {
- final pointer = alloc<ffi.Uint16>(_values.length);
- for (var i = 0; i < _values.length; i++) {
- pointer[i] = min(65535, max(0, _values[i]));
- }
- return pointer;
- }
-
- int get length => _values.length;
-}
-
-class _Uint32ListView {
- final core.List<int> _values;
-
- _Uint32ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Uint32> allocIn(ffi.Allocator alloc) {
- final pointer = alloc<ffi.Uint32>(_values.length);
- for (var i = 0; i < _values.length; i++) {
- pointer[i] = min(4294967295, max(0, _values[i]));
- }
- return pointer;
- }
-
- int get length => _values.length;
-}
-
-class _Uint64ListView {
- final core.List<int> _values;
-
- _Uint64ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Uint64> allocIn(ffi.Allocator alloc) {
- final pointer = alloc<ffi.Uint64>(_values.length);
- for (var i = 0; i < _values.length; i++) {
- pointer[i] = max(0, _values[i]);
- }
- return pointer;
- }
-
- int get length => _values.length;
-}
-
-// ignore: unused_element
-class _UsizeListView {
- final core.List<int> _values;
-
- _UsizeListView(this._values);
-
- // Copies
- ffi.Pointer<ffi.Size> allocIn(ffi.Allocator alloc) {
- final pointer = alloc<ffi.Size>(_values.length);
- for (var i = 0; i < _values.length; i++) {
- pointer[i] = max(0, _values[i]);
- }
- return pointer;
- }
-
- int get length => _values.length;
-}
-
-class _Float32ListView {
- final core.List<double> _values;
-
- _Float32ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Float> allocIn(ffi.Allocator alloc) {
- return alloc<ffi.Float>(length)
- ..asTypedList(length).setRange(0, length, _values);
- }
-
- int get length => _values.length;
-}
-
-class _Float64ListView {
- final core.List<double> _values;
-
- _Float64ListView(this._values);
-
- // ignore: unused_element
- ffi.Pointer<ffi.Double> allocIn(ffi.Allocator alloc) {
- return alloc<ffi.Double>(length)
- ..asTypedList(length).setRange(0, length, _values);
- }
-
- int get length => _values.length;
-}
-
-final class _ResultBoolInt32Union extends ffi.Union {
- @ffi.Bool()
- external bool ok;
+final class _ResultDateTimeFfiInt32Union extends ffi.Union {
+ external _DateTimeFfi ok;
@ffi.Int32()
external int err;
}
-final class _ResultBoolInt32 extends ffi.Struct {
- external _ResultBoolInt32Union union;
+final class _ResultDateTimeFfiInt32 extends ffi.Struct {
+ external _ResultDateTimeFfiInt32Union union;
@ffi.Bool()
external bool isOk;
-}
-final class _ResultInt32Int32Union extends ffi.Union {
- @ffi.Int32()
- external int ok;
-
- @ffi.Int32()
- external int err;
-}
-
-final class _ResultInt32Int32 extends ffi.Struct {
- external _ResultInt32Int32Union union;
-
- @ffi.Bool()
- external bool isOk;
+ // ignore: unused_element
+ factory _ResultDateTimeFfiInt32.ok(_DateTimeFfi val) {
+ final struct = ffi.Struct.create<_ResultDateTimeFfiInt32>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultDateTimeFfiInt32.err(int val) {
+ final struct = ffi.Struct.create<_ResultDateTimeFfiInt32>();
+ struct.isOk = false;
+ struct.union.err = val;
+ return struct;
+ }
}
final class _ResultInt32VoidUnion extends ffi.Union {
@ffi.Int32()
external int ok;
+
}
final class _ResultInt32Void extends ffi.Struct {
@@ -601,6 +289,101 @@
@ffi.Bool()
external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultInt32Void.ok(int val) {
+ final struct = ffi.Struct.create<_ResultInt32Void>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultInt32Void.err() {
+ final struct = ffi.Struct.create<_ResultInt32Void>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultIsoDateTimeFfiInt32Union extends ffi.Union {
+ external _IsoDateTimeFfi ok;
+
+ @ffi.Int32()
+ external int err;
+}
+
+final class _ResultIsoDateTimeFfiInt32 extends ffi.Struct {
+ external _ResultIsoDateTimeFfiInt32Union union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultIsoDateTimeFfiInt32.ok(_IsoDateTimeFfi val) {
+ final struct = ffi.Struct.create<_ResultIsoDateTimeFfiInt32>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultIsoDateTimeFfiInt32.err(int val) {
+ final struct = ffi.Struct.create<_ResultIsoDateTimeFfiInt32>();
+ struct.isOk = false;
+ struct.union.err = val;
+ return struct;
+ }
+}
+
+final class _ResultIsoDateTimeFfiVoidUnion extends ffi.Union {
+ external _IsoDateTimeFfi ok;
+
+}
+
+final class _ResultIsoDateTimeFfiVoid extends ffi.Struct {
+ external _ResultIsoDateTimeFfiVoidUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultIsoDateTimeFfiVoid.ok(_IsoDateTimeFfi val) {
+ final struct = ffi.Struct.create<_ResultIsoDateTimeFfiVoid>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultIsoDateTimeFfiVoid.err() {
+ final struct = ffi.Struct.create<_ResultIsoDateTimeFfiVoid>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultOpaqueDecimalLimitErrorFfiUnion extends ffi.Union {
+ external ffi.Pointer<ffi.Opaque> ok;
+
+}
+
+final class _ResultOpaqueDecimalLimitErrorFfi extends ffi.Struct {
+ external _ResultOpaqueDecimalLimitErrorFfiUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultOpaqueDecimalLimitErrorFfi.ok(ffi.Pointer<ffi.Opaque> val) {
+ final struct = ffi.Struct.create<_ResultOpaqueDecimalLimitErrorFfi>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultOpaqueDecimalLimitErrorFfi.err() {
+ final struct = ffi.Struct.create<_ResultOpaqueDecimalLimitErrorFfi>();
+ struct.isOk = false;
+ return struct;
+ }
}
final class _ResultOpaqueInt32Union extends ffi.Union {
@@ -615,11 +398,131 @@
@ffi.Bool()
external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultOpaqueInt32.ok(ffi.Pointer<ffi.Opaque> val) {
+ final struct = ffi.Struct.create<_ResultOpaqueInt32>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultOpaqueInt32.err(int val) {
+ final struct = ffi.Struct.create<_ResultOpaqueInt32>();
+ struct.isOk = false;
+ struct.union.err = val;
+ return struct;
+ }
+}
+
+final class _ResultOpaqueTimeZoneInvalidOffsetErrorFfiUnion extends ffi.Union {
+ external ffi.Pointer<ffi.Opaque> ok;
+
+}
+
+final class _ResultOpaqueTimeZoneInvalidOffsetErrorFfi extends ffi.Struct {
+ external _ResultOpaqueTimeZoneInvalidOffsetErrorFfiUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultOpaqueTimeZoneInvalidOffsetErrorFfi.ok(ffi.Pointer<ffi.Opaque> val) {
+ final struct = ffi.Struct.create<_ResultOpaqueTimeZoneInvalidOffsetErrorFfi>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultOpaqueTimeZoneInvalidOffsetErrorFfi.err() {
+ final struct = ffi.Struct.create<_ResultOpaqueTimeZoneInvalidOffsetErrorFfi>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultSliceUtf8VoidUnion extends ffi.Union {
+ external _SliceUtf8 ok;
+
+}
+
+final class _ResultSliceUtf8Void extends ffi.Struct {
+ external _ResultSliceUtf8VoidUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultSliceUtf8Void.ok(_SliceUtf8 val) {
+ final struct = ffi.Struct.create<_ResultSliceUtf8Void>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultSliceUtf8Void.err() {
+ final struct = ffi.Struct.create<_ResultSliceUtf8Void>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultTimeZoneAndCanonicalAndNormalizedFfiVoidUnion extends ffi.Union {
+ external _TimeZoneAndCanonicalAndNormalizedFfi ok;
+
+}
+
+final class _ResultTimeZoneAndCanonicalAndNormalizedFfiVoid extends ffi.Struct {
+ external _ResultTimeZoneAndCanonicalAndNormalizedFfiVoidUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultTimeZoneAndCanonicalAndNormalizedFfiVoid.ok(_TimeZoneAndCanonicalAndNormalizedFfi val) {
+ final struct = ffi.Struct.create<_ResultTimeZoneAndCanonicalAndNormalizedFfiVoid>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultTimeZoneAndCanonicalAndNormalizedFfiVoid.err() {
+ final struct = ffi.Struct.create<_ResultTimeZoneAndCanonicalAndNormalizedFfiVoid>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultTimeZoneAndCanonicalFfiVoidUnion extends ffi.Union {
+ external _TimeZoneAndCanonicalFfi ok;
+
+}
+
+final class _ResultTimeZoneAndCanonicalFfiVoid extends ffi.Struct {
+ external _ResultTimeZoneAndCanonicalFfiVoidUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultTimeZoneAndCanonicalFfiVoid.ok(_TimeZoneAndCanonicalFfi val) {
+ final struct = ffi.Struct.create<_ResultTimeZoneAndCanonicalFfiVoid>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultTimeZoneAndCanonicalFfiVoid.err() {
+ final struct = ffi.Struct.create<_ResultTimeZoneAndCanonicalFfiVoid>();
+ struct.isOk = false;
+ return struct;
+ }
}
final class _ResultUint16VoidUnion extends ffi.Union {
@ffi.Uint16()
external int ok;
+
}
final class _ResultUint16Void extends ffi.Struct {
@@ -627,9 +530,130 @@
@ffi.Bool()
external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultUint16Void.ok(int val) {
+ final struct = ffi.Struct.create<_ResultUint16Void>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultUint16Void.err() {
+ final struct = ffi.Struct.create<_ResultUint16Void>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultUint32VoidUnion extends ffi.Union {
+ @ffi.Uint32()
+ external Rune ok;
+
+}
+
+final class _ResultUint32Void extends ffi.Struct {
+ external _ResultUint32VoidUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultUint32Void.ok(Rune val) {
+ final struct = ffi.Struct.create<_ResultUint32Void>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultUint32Void.err() {
+ final struct = ffi.Struct.create<_ResultUint32Void>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultUint8VoidUnion extends ffi.Union {
+ @ffi.Uint8()
+ external int ok;
+
+}
+
+final class _ResultUint8Void extends ffi.Struct {
+ external _ResultUint8VoidUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultUint8Void.ok(int val) {
+ final struct = ffi.Struct.create<_ResultUint8Void>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultUint8Void.err() {
+ final struct = ffi.Struct.create<_ResultUint8Void>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultVariantOffsetsFfiVoidUnion extends ffi.Union {
+ external _VariantOffsetsFfi ok;
+
+}
+
+final class _ResultVariantOffsetsFfiVoid extends ffi.Struct {
+ external _ResultVariantOffsetsFfiVoidUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultVariantOffsetsFfiVoid.ok(_VariantOffsetsFfi val) {
+ final struct = ffi.Struct.create<_ResultVariantOffsetsFfiVoid>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultVariantOffsetsFfiVoid.err() {
+ final struct = ffi.Struct.create<_ResultVariantOffsetsFfiVoid>();
+ struct.isOk = false;
+ return struct;
+ }
+}
+
+final class _ResultVoidDateTimeMismatchedCalendarErrorFfiUnion extends ffi.Union {
+
+ external _DateTimeMismatchedCalendarErrorFfi err;
+}
+
+final class _ResultVoidDateTimeMismatchedCalendarErrorFfi extends ffi.Struct {
+ external _ResultVoidDateTimeMismatchedCalendarErrorFfiUnion union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultVoidDateTimeMismatchedCalendarErrorFfi.ok() {
+ final struct = ffi.Struct.create<_ResultVoidDateTimeMismatchedCalendarErrorFfi>();
+ struct.isOk = true;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultVoidDateTimeMismatchedCalendarErrorFfi.err(_DateTimeMismatchedCalendarErrorFfi val) {
+ final struct = ffi.Struct.create<_ResultVoidDateTimeMismatchedCalendarErrorFfi>();
+ struct.isOk = false;
+ struct.union.err = val;
+ return struct;
+ }
}
final class _ResultVoidInt32Union extends ffi.Union {
+
@ffi.Int32()
external int err;
}
@@ -639,25 +663,244 @@
@ffi.Bool()
external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultVoidInt32.ok() {
+ final struct = ffi.Struct.create<_ResultVoidInt32>();
+ struct.isOk = true;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultVoidInt32.err(int val) {
+ final struct = ffi.Struct.create<_ResultVoidInt32>();
+ struct.isOk = false;
+ struct.union.err = val;
+ return struct;
+ }
}
final class _ResultVoidVoid extends ffi.Struct {
+
@ffi.Bool()
external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultVoidVoid.ok() {
+ final struct = ffi.Struct.create<_ResultVoidVoid>();
+ struct.isOk = true;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultVoidVoid.err() {
+ final struct = ffi.Struct.create<_ResultVoidVoid>();
+ struct.isOk = false;
+ return struct;
+ }
}
-final class _ResultWeekOfFfiInt32Union extends ffi.Union {
- external _WeekOfFfi ok;
+final class _ResultZonedDateTimeFfiInt32Union extends ffi.Union {
+ external _ZonedDateTimeFfi ok;
@ffi.Int32()
external int err;
}
-final class _ResultWeekOfFfiInt32 extends ffi.Struct {
- external _ResultWeekOfFfiInt32Union union;
+final class _ResultZonedDateTimeFfiInt32 extends ffi.Struct {
+ external _ResultZonedDateTimeFfiInt32Union union;
@ffi.Bool()
external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultZonedDateTimeFfiInt32.ok(_ZonedDateTimeFfi val) {
+ final struct = ffi.Struct.create<_ResultZonedDateTimeFfiInt32>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultZonedDateTimeFfiInt32.err(int val) {
+ final struct = ffi.Struct.create<_ResultZonedDateTimeFfiInt32>();
+ struct.isOk = false;
+ struct.union.err = val;
+ return struct;
+ }
+}
+
+final class _ResultZonedIsoDateTimeFfiInt32Union extends ffi.Union {
+ external _ZonedIsoDateTimeFfi ok;
+
+ @ffi.Int32()
+ external int err;
+}
+
+final class _ResultZonedIsoDateTimeFfiInt32 extends ffi.Struct {
+ external _ResultZonedIsoDateTimeFfiInt32Union union;
+
+ @ffi.Bool()
+ external bool isOk;
+
+ // ignore: unused_element
+ factory _ResultZonedIsoDateTimeFfiInt32.ok(_ZonedIsoDateTimeFfi val) {
+ final struct = ffi.Struct.create<_ResultZonedIsoDateTimeFfiInt32>();
+ struct.isOk = true;
+ struct.union.ok = val;
+ return struct;
+ }
+ // ignore: unused_element
+ factory _ResultZonedIsoDateTimeFfiInt32.err(int val) {
+ final struct = ffi.Struct.create<_ResultZonedIsoDateTimeFfiInt32>();
+ struct.isOk = false;
+ struct.union.err = val;
+ return struct;
+ }
+}
+
+final class _SliceRune extends ffi.Struct {
+ external ffi.Pointer<ffi.Uint32> _data;
+
+ @ffi.Size()
+ external int _length;
+
+ // This is expensive
+ @override
+ bool operator ==(Object other) {
+ if (other is! _SliceRune || other._length != _length) {
+ return false;
+ }
+
+ for (var i = 0; i < _length; i++) {
+ if (other._data[i] != _data[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // This is cheap
+ @override
+ int get hashCode => _length.hashCode;
+
+ // ignore: unused_element
+ core.List<Rune> _toDart(core.List<Object> lifetimeEdges, {bool isStatic = false}) {
+ final r = _data.asTypedList(_length);
+ if (lifetimeEdges.isEmpty && !isStatic) {
+ _rustFree.attach(r, (pointer: _data.cast(), bytes: _length, align: 1));
+ } else {
+ _nopFree.attach(r, lifetimeEdges); // Keep lifetime edges alive
+ }
+ return r;
+ }
+}
+
+extension on core.List<Rune> {
+ // ignore: unused_element
+ _SliceRune _uint32AllocIn(ffi.Allocator alloc) {
+ final slice = ffi.Struct.create<_SliceRune>();
+ slice._data = alloc(length)..asTypedList(length).setRange(0, length, this);
+ slice._length = length;
+ return slice;
+ }
+}
+
+final class _SliceSliceUtf16 extends ffi.Struct {
+ external ffi.Pointer<_SliceUtf16> _data;
+
+ @ffi.Size()
+ external int _length;
+
+ // This is expensive
+ @override
+ bool operator ==(Object other) {
+ if (other is! _SliceSliceUtf16 || other._length != _length) {
+ return false;
+ }
+
+ for (var i = 0; i < _length; i++) {
+ if (other._data[i] != _data[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // This is cheap
+ @override
+ int get hashCode => _length.hashCode;
+
+ // ignore: unused_element
+ core.List<core.String> _toDart(core.List<Object> lifetimeEdges, {bool isStatic = false}) {
+ final r = core.Iterable.generate(_length).map((i) => _data[i]._toDart(lifetimeEdges)).toList(growable: false);
+ if (lifetimeEdges.isEmpty && !isStatic) {
+ // unsupported
+ } else {
+ // Lifetime edges will be cleaned up
+ }
+ return r;
+ }
+}
+
+extension on core.List<core.String> {
+ // ignore: unused_element
+ _SliceSliceUtf16 _utf16SliceAllocIn(ffi.Allocator alloc) {
+ final slice = ffi.Struct.create<_SliceSliceUtf16>();
+ slice._data = alloc(length);
+ for (var i = 0; i < length; i++) {
+ slice._data[i] = this[i]._utf16AllocIn(alloc);
+ }
+ slice._length = length;
+ return slice;
+ }
+}
+
+final class _SliceUint8 extends ffi.Struct {
+ external ffi.Pointer<ffi.Uint8> _data;
+
+ @ffi.Size()
+ external int _length;
+
+ // This is expensive
+ @override
+ bool operator ==(Object other) {
+ if (other is! _SliceUint8 || other._length != _length) {
+ return false;
+ }
+
+ for (var i = 0; i < _length; i++) {
+ if (other._data[i] != _data[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // This is cheap
+ @override
+ int get hashCode => _length.hashCode;
+
+ // ignore: unused_element
+ core.List<int> _toDart(core.List<Object> lifetimeEdges, {bool isStatic = false}) {
+ final r = _data.asTypedList(_length);
+ if (lifetimeEdges.isEmpty && !isStatic) {
+ _rustFree.attach(r, (pointer: _data.cast(), bytes: _length, align: 1));
+ } else {
+ _nopFree.attach(r, lifetimeEdges); // Keep lifetime edges alive
+ }
+ return r;
+ }
+}
+
+extension on core.List<int> {
+ // ignore: unused_element
+ _SliceUint8 _uint8AllocIn(ffi.Allocator alloc) {
+ final slice = ffi.Struct.create<_SliceUint8>();
+ slice._data = alloc(length);
+ for (var i = 0; i < length; i++) {
+ slice._data[i] = this[i].clamp(0, 255);
+ }
+ slice._length = length;
+ return slice;
+ }
}
final class _SliceUsize extends ffi.Struct {
@@ -685,21 +928,31 @@
@override
int get hashCode => _length.hashCode;
- core.List<int> _toDart(core.List<Object> lifetimeEdges) {
- final r = core.Iterable.generate(
- _length,
- ).map((i) => _data[i]).toList(growable: false);
- if (lifetimeEdges.isEmpty) {
- _diplomat_free(
- _data.cast(),
- _length * ffi.sizeOf<ffi.Size>(),
- ffi.sizeOf<ffi.Size>(),
- );
+ // ignore: unused_element
+ core.List<int> _toDart(core.List<Object> lifetimeEdges, {bool isStatic = false}) {
+ final r = core.Iterable.generate(_length).map((i) => _data[i]).toList(growable: false);
+ if (lifetimeEdges.isEmpty && !isStatic) {
+ _diplomat_free(_data.cast(), _length * ffi.sizeOf<ffi.Size>(), ffi.sizeOf<ffi.Size>());
+ } else {
+ // Lifetime edges will be cleaned up
}
return r;
}
}
+extension on core.List<int> {
+ // ignore: unused_element
+ _SliceUsize _usizeAllocIn(ffi.Allocator alloc) {
+ final slice = ffi.Struct.create<_SliceUsize>();
+ slice._data = alloc(length);
+ for (var i = 0; i < length; i++) {
+ slice._data[i] = this[i] < 0 ? 0 : this[i];
+ }
+ slice._length = length;
+ return slice;
+ }
+}
+
final class _SliceUtf16 extends ffi.Struct {
external ffi.Pointer<ffi.Uint16> _data;
@@ -726,15 +979,27 @@
int get hashCode => _length.hashCode;
// ignore: unused_element
- String _toDart(core.List<Object> lifetimeEdges) {
+ String _toDart(core.List<Object> lifetimeEdges, {bool isStatic = false}) {
final r = core.String.fromCharCodes(_data.asTypedList(_length));
- if (lifetimeEdges.isEmpty) {
+ if (lifetimeEdges.isEmpty && !isStatic) {
_diplomat_free(_data.cast(), _length * 2, 2);
+ } else {
+ // Lifetime edges will be cleaned up
}
return r;
}
}
+extension on String {
+ // ignore: unused_element
+ _SliceUtf16 _utf16AllocIn(ffi.Allocator alloc) {
+ final slice = ffi.Struct.create<_SliceUtf16>();
+ slice._data = alloc(codeUnits.length)..asTypedList(codeUnits.length).setRange(0, codeUnits.length, codeUnits);
+ slice._length = length;
+ return slice;
+ }
+}
+
final class _SliceUtf8 extends ffi.Struct {
external ffi.Pointer<ffi.Uint8> _data;
@@ -760,68 +1025,65 @@
@override
int get hashCode => _length.hashCode;
- String _toDart(core.List<Object> lifetimeEdges) {
+ // ignore: unused_element
+ String _toDart(core.List<Object> lifetimeEdges, {bool isStatic = false}) {
final r = Utf8Decoder().convert(_data.asTypedList(_length));
- if (lifetimeEdges.isEmpty) {
+ if (lifetimeEdges.isEmpty && !isStatic) {
_diplomat_free(_data.cast(), _length, 1);
+ } else {
+ // Lifetime edges will be cleaned up
}
return r;
}
}
-final class _Writeable {
- final ffi.Pointer<ffi.Opaque> _ffi;
-
- _Writeable() : _ffi = _diplomat_buffer_writeable_create(0);
-
- String finalize() {
- final string = Utf8Decoder().convert(
- _diplomat_buffer_writeable_get_bytes(
- _ffi,
- ).asTypedList(_diplomat_buffer_writeable_len(_ffi)),
- );
- _diplomat_buffer_writeable_destroy(_ffi);
- return string;
+extension on String {
+ // ignore: unused_element
+ _SliceUtf8 _utf8AllocIn(ffi.Allocator alloc) {
+ final slice = ffi.Struct.create<_SliceUtf8>();
+ final encoded = Utf8Encoder().convert(this);
+ slice._data = alloc(encoded.length)..asTypedList(encoded.length).setRange(0, encoded.length, encoded);
+ slice._length = encoded.length;
+ return slice;
}
}
-@_DiplomatFfiUse('diplomat_buffer_writeable_create')
-@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Size)>(
- symbol: 'diplomat_buffer_writeable_create',
- isLeaf: true,
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Opaque> _diplomat_buffer_writeable_create(int len);
+final class _Write {
+ final ffi.Pointer<ffi.Opaque> _ffi;
-@_DiplomatFfiUse('diplomat_buffer_writeable_len')
-@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(
- symbol: 'diplomat_buffer_writeable_len',
- isLeaf: true,
-)
-// ignore: non_constant_identifier_names
-external int _diplomat_buffer_writeable_len(ffi.Pointer<ffi.Opaque> ptr);
+ _Write() : _ffi = _diplomat_buffer_write_create(0);
-@_DiplomatFfiUse('diplomat_buffer_writeable_get_bytes')
-@ffi.Native<ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<ffi.Opaque>)>(
- symbol: 'diplomat_buffer_writeable_get_bytes',
- isLeaf: true,
-)
-// ignore: non_constant_identifier_names
-external ffi.Pointer<ffi.Uint8> _diplomat_buffer_writeable_get_bytes(
- ffi.Pointer<ffi.Opaque> ptr,
-);
-
-@_DiplomatFfiUse('diplomat_buffer_writeable_destroy')
-@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(
- symbol: 'diplomat_buffer_writeable_destroy',
- isLeaf: true,
-)
-// ignore: non_constant_identifier_names
-external void _diplomat_buffer_writeable_destroy(ffi.Pointer<ffi.Opaque> ptr);
-
-@RecordUse()
-class _DiplomatFfiUse extends RecordUse {
- final String symbol;
-
- const _DiplomatFfiUse(@mustBeConst this.symbol);
+ String finalize() {
+ try {
+ final buf = _diplomat_buffer_write_get_bytes(_ffi);
+ if (buf == ffi.Pointer.fromAddress(0)) {
+ throw core.OutOfMemoryError();
+ }
+ return Utf8Decoder().convert(buf.asTypedList(_diplomat_buffer_write_len(_ffi)));
+ } finally {
+ _diplomat_buffer_write_destroy(_ffi);
+ }
+ }
}
+
+@_DiplomatFfiUse('diplomat_buffer_write_create')
+@ffi.Native<ffi.Pointer<ffi.Opaque> Function(ffi.Size)>(symbol: 'diplomat_buffer_write_create', isLeaf: true)
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Opaque> _diplomat_buffer_write_create(int len);
+
+@_DiplomatFfiUse('diplomat_buffer_write_len')
+@ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Opaque>)>(symbol: 'diplomat_buffer_write_len', isLeaf: true)
+// ignore: non_constant_identifier_names
+external int _diplomat_buffer_write_len(ffi.Pointer<ffi.Opaque> ptr);
+
+@_DiplomatFfiUse('diplomat_buffer_write_get_bytes')
+@ffi.Native<ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<ffi.Opaque>)>(symbol: 'diplomat_buffer_write_get_bytes', isLeaf: true)
+// ignore: non_constant_identifier_names
+external ffi.Pointer<ffi.Uint8> _diplomat_buffer_write_get_bytes(ffi.Pointer<ffi.Opaque> ptr);
+
+@_DiplomatFfiUse('diplomat_buffer_write_destroy')
+@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>)>(symbol: 'diplomat_buffer_write_destroy', isLeaf: true)
+// ignore: non_constant_identifier_names
+external void _diplomat_buffer_write_destroy(ffi.Pointer<ffi.Opaque> ptr);
+
+// dart format on
diff --git a/pkgs/intl4x/lib/src/collation/collation.dart b/pkgs/intl4x/lib/src/collation/collation.dart
index ae9ad40..f46803c 100644
--- a/pkgs/intl4x/lib/src/collation/collation.dart
+++ b/pkgs/intl4x/lib/src/collation/collation.dart
@@ -9,7 +9,7 @@
class Collation {
final CollationImpl _collationImpl;
- const Collation(this._collationImpl);
+ const Collation._(this._collationImpl);
/// Compare two strings in a locale-dependant manner.
///
@@ -28,3 +28,6 @@
}
}
}
+
+Collation buildCollation(CollationImpl collationImpl) =>
+ Collation._(collationImpl);
diff --git a/pkgs/intl4x/lib/src/collation/collation_4x.dart b/pkgs/intl4x/lib/src/collation/collation_4x.dart
index ad1a237..e41ef02 100644
--- a/pkgs/intl4x/lib/src/collation/collation_4x.dart
+++ b/pkgs/intl4x/lib/src/collation/collation_4x.dart
@@ -3,44 +3,56 @@
// BSD-style license that can be found in the LICENSE file.
import '../bindings/lib.g.dart' as icu;
-import '../data.dart';
-import '../data_4x.dart';
import '../locale/locale.dart';
import '../locale/locale_4x.dart';
+import '../utils.dart';
import 'collation_impl.dart';
import 'collation_options.dart';
-CollationImpl getCollator4X(
- Locale locale,
- Data data,
- CollationOptions options,
-) => Collation4X(locale, data, options);
+CollationImpl getCollator4X(Locale locale, CollationOptions options) =>
+ Collation4X(locale as Locale4x, options);
class Collation4X extends CollationImpl {
final icu.Collator _collator;
- Collation4X(super.locale, Data data, super.options)
+ Collation4X(Locale4x super.locale, super.options)
: _collator = icu.Collator(
- data.to4X(),
- locale.to4X(),
- options.to4xOptions(),
+ locale.get4X.clone()..setOptions(options),
+ options.toX,
);
@override
int compareImpl(String a, String b) => _collator.compare(a, b);
}
-extension on CollationOptions {
- icu.CollatorOptions to4xOptions() {
- final icuNumeric =
- numeric ? icu.CollatorNumeric.on : icu.CollatorNumeric.off;
+const _numericExtensionKey = 'kn';
+final _caseFirstExtensionKey = 'kf';
- final icuCaseFirst = switch (caseFirst) {
- CaseFirst.upper => icu.CollatorCaseFirst.upperFirst,
- CaseFirst.lower => icu.CollatorCaseFirst.lowerFirst,
- CaseFirst.localeDependent => icu.CollatorCaseFirst.off,
+extension on icu.Locale {
+ void setOptions(CollationOptions options) {
+ final icuNumeric = switch (options.numeric) {
+ true => icu.CollatorNumericOrdering.on,
+ false => icu.CollatorNumericOrdering.off,
+ null => null,
};
+ if (icuNumeric != null &&
+ getUnicodeExtension(_numericExtensionKey) != null) {
+ setUnicodeExtension(_numericExtensionKey, icuNumeric.name);
+ }
+ options.caseFirst?.map(
+ (caseFirst) =>
+ setUnicodeExtension(_caseFirstExtensionKey, switch (caseFirst) {
+ CaseFirst.upper => caseFirst.name,
+ CaseFirst.lower => caseFirst.name,
+ CaseFirst.localeDependent => 'false',
+ }),
+ );
+ }
+}
+
+extension on CollationOptions {
+ icu.CollatorOptions get toX {
final icuStrength = switch (sensitivity) {
Sensitivity.base => icu.CollatorStrength.primary,
Sensitivity.accent => icu.CollatorStrength.secondary,
@@ -56,12 +68,12 @@
return icu.CollatorOptions(
strength: icuStrength,
- numeric: icuNumeric,
- caseFirst: icuCaseFirst,
caseLevel: icuCaseLevel,
- alternateHandling: icu.CollatorAlternateHandling.nonIgnorable,
- backwardSecondLevel: icu.CollatorBackwardSecondLevel.off,
- maxVariable: icu.CollatorMaxVariable.auto,
+ alternateHandling:
+ ignorePunctuation
+ ? icu.CollatorAlternateHandling.shifted
+ : icu.CollatorAlternateHandling.nonIgnorable,
+ //TODO(mosum): maxVariable: Not supported in ECMA402
);
}
}
diff --git a/pkgs/intl4x/lib/src/collation/collation_ecma.dart b/pkgs/intl4x/lib/src/collation/collation_ecma.dart
index c7b4bd6..243838a 100644
--- a/pkgs/intl4x/lib/src/collation/collation_ecma.dart
+++ b/pkgs/intl4x/lib/src/collation/collation_ecma.dart
@@ -71,7 +71,7 @@
if (sensitivity != null) 'sensitivity': sensitivity!.jsName,
'ignorePunctuation': ignorePunctuation,
'numeric': numeric,
- 'caseFirst': caseFirst.jsName,
+ if (caseFirst != null) 'caseFirst': caseFirst!.jsName,
if (collation != null) 'collation': collation,
}.jsify()!;
}
diff --git a/pkgs/intl4x/lib/src/collation/collation_impl.dart b/pkgs/intl4x/lib/src/collation/collation_impl.dart
index c17eff0..8060773 100644
--- a/pkgs/intl4x/lib/src/collation/collation_impl.dart
+++ b/pkgs/intl4x/lib/src/collation/collation_impl.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import '../data.dart';
import '../ecma/ecma_policy.dart';
import '../locale/locale.dart';
import '../options.dart';
@@ -25,13 +24,11 @@
/// in-built browser implementation.
static CollationImpl build(
Locale locale,
- Data data,
CollationOptions options,
LocaleMatcher localeMatcher,
EcmaPolicy ecmaPolicy,
) => buildFormatter(
locale,
- data,
options,
localeMatcher,
ecmaPolicy,
diff --git a/pkgs/intl4x/lib/src/collation/collation_options.dart b/pkgs/intl4x/lib/src/collation/collation_options.dart
index f6e1534..33220a2 100644
--- a/pkgs/intl4x/lib/src/collation/collation_options.dart
+++ b/pkgs/intl4x/lib/src/collation/collation_options.dart
@@ -8,8 +8,8 @@
final Usage usage;
final Sensitivity? sensitivity;
final bool ignorePunctuation;
- final bool numeric;
- final CaseFirst caseFirst;
+ final bool? numeric;
+ final CaseFirst? caseFirst;
final String? collation;
final LocaleMatcher localeMatcher;
@@ -18,8 +18,8 @@
this.usage = Usage.sort,
this.sensitivity,
this.ignorePunctuation = false,
- this.numeric = false,
- this.caseFirst = CaseFirst.localeDependent,
+ this.numeric,
+ this.caseFirst,
this.collation,
});
diff --git a/pkgs/intl4x/lib/src/collation/collation_stub_4x.dart b/pkgs/intl4x/lib/src/collation/collation_stub_4x.dart
index 454731c..8333ddf 100644
--- a/pkgs/intl4x/lib/src/collation/collation_stub_4x.dart
+++ b/pkgs/intl4x/lib/src/collation/collation_stub_4x.dart
@@ -3,13 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
import '../../collation.dart';
-import '../data.dart';
+
import '../locale/locale.dart';
import 'collation_impl.dart';
/// Stub for the conditional import
-CollationImpl getCollator4X(
- Locale locale,
- Data data,
- CollationOptions options,
-) => throw UnimplementedError('Cannot use ICU4X in web environments.');
+CollationImpl getCollator4X(Locale locale, CollationOptions options) =>
+ throw UnimplementedError('Cannot use ICU4X in web environments.');
diff --git a/pkgs/intl4x/lib/src/data.dart b/pkgs/intl4x/lib/src/data.dart
deleted file mode 100644
index dc81231..0000000
--- a/pkgs/intl4x/lib/src/data.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-sealed class Data {
- const Data();
-}
-
-final class AssetData extends Data {
- final String key;
-
- const AssetData(this.key);
-}
-
-final class BundleData extends Data {
- const BundleData();
-}
-
-final class NoData extends Data {
- const NoData();
-}
diff --git a/pkgs/intl4x/lib/src/data_4x.dart b/pkgs/intl4x/lib/src/data_4x.dart
deleted file mode 100644
index 1656db0..0000000
--- a/pkgs/intl4x/lib/src/data_4x.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:io';
-import 'bindings/lib.g.dart' as icu;
-import 'data.dart';
-
-extension DataProvider on Data {
- icu.DataProvider to4X() => switch (this) {
- AssetData() => icu.DataProvider.fromByteSlice(
- File((this as AssetData).key).readAsBytesSync().buffer,
- ),
- BundleData() => icu.DataProvider.compiled(),
- NoData() => icu.DataProvider.empty(),
- };
-}
diff --git a/pkgs/intl4x/lib/src/datetime_format/datetime_format.dart b/pkgs/intl4x/lib/src/datetime_format/datetime_format.dart
index 0504858..2cc5ae6 100644
--- a/pkgs/intl4x/lib/src/datetime_format/datetime_format.dart
+++ b/pkgs/intl4x/lib/src/datetime_format/datetime_format.dart
@@ -2,6 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:meta/meta.dart';
+
+import '../../datetime_format.dart';
import '../test_checker.dart';
import 'datetime_format_impl.dart';
@@ -9,7 +12,7 @@
///
/// ```dart
/// final date = DateTime.utc(2021, 12, 17, 4, 0, 42);
-/// Intl(locale: const Locale(language: 'fr'))
+/// Intl(locale: Locale.parse('fr'))
/// .datetimeFormat(const DateTimeFormatOptions(
/// hour: TimeRepresentation.numeric,
/// hourCycle: HourCycle.h12,
@@ -21,13 +24,55 @@
class DateTimeFormat {
final DateTimeFormatImpl _impl;
- DateTimeFormat(this._impl);
+ DateTimeFormat._(this._impl);
- String format(DateTime datetime) {
+ String d(DateTime datetime) => _format(_impl.d, datetime, _impl);
+ String m(DateTime datetime) => _format(_impl.m, datetime, _impl);
+ String y(DateTime datetime) => _format(_impl.y, datetime, _impl);
+ String md(DateTime datetime) => _format(_impl.md, datetime, _impl);
+
+ String ymde(DateTime datetime) => _format(_impl.ymde, datetime, _impl);
+
+ String ymdet(DateTime datetime) => _format(_impl.ymdet, datetime, _impl);
+
+ static String _format(
+ String Function(DateTime datetime) format,
+ DateTime datetime,
+ DateTimeFormatImpl impl,
+ ) {
if (isInTest) {
- return '$datetime//${_impl.locale}';
+ return '$datetime//${impl.locale}';
} else {
- return _impl.formatImpl(datetime);
+ return format(datetime);
}
}
}
+
+extension DatetimeFormatExt on DateTimeFormat {
+ @RecordUse()
+ String ymdt(DateTime datetime, {@mustBeConst TimeZone? timeZone}) =>
+ DateTimeFormat._format(
+ (datetime) => _impl.ymdt(datetime, timeZone: timeZone),
+ datetime,
+ _impl,
+ );
+
+ @RecordUse()
+ String ymd(DateTime datetime, {@mustBeConst TimeZone? timeZone}) =>
+ DateTimeFormat._format(
+ (datetime) => _impl.ymd(datetime, timeZone: timeZone),
+ datetime,
+ _impl,
+ );
+
+ @RecordUse()
+ String time(DateTime datetime, {@mustBeConst TimeZone? timeZone}) =>
+ DateTimeFormat._format(
+ (datetime) => _impl.time(datetime, timeZone: timeZone),
+ datetime,
+ _impl,
+ );
+}
+
+DateTimeFormat buildDateTimeFormat(DateTimeFormatImpl impl) =>
+ DateTimeFormat._(impl);
diff --git a/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart b/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart
index c5bec9b..1d41c26 100644
--- a/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart
+++ b/pkgs/intl4x/lib/src/datetime_format/datetime_format_4x.dart
@@ -4,160 +4,351 @@
import '../../datetime_format.dart';
import '../bindings/lib.g.dart' as icu;
-import '../data.dart';
-import '../data_4x.dart';
import '../locale/locale.dart';
import '../locale/locale_4x.dart';
+import '../utils.dart';
import 'datetime_format_impl.dart';
DateTimeFormatImpl getDateTimeFormatter4X(
Locale locale,
- Data data,
DateTimeFormatOptions options,
-) => DateTimeFormat4X(locale, data, options);
+) => DateTimeFormat4X(locale as Locale4x, options);
class DateTimeFormat4X extends DateTimeFormatImpl {
- final icu.DateTimeFormatter? _dateTimeFormatter;
- final icu.DateFormatter? _dateFormatter;
- final icu.TimeFormatter? _timeFormatter;
- final icu.ZonedDateTimeFormatter? _zonedDateTimeFormatter;
- final icu.DataProvider _data;
+ DateTimeFormat4X(Locale4x super.locale, super.options);
- DateTimeFormat4X(super.locale, Data data, super.options)
- : _data = data.to4X(),
- _dateTimeFormatter = _setDateTimeFormatter(options, data, locale),
- _timeFormatter =
- options.timeFormatStyle != null
- ? icu.TimeFormatter.withLength(
- data.to4X(),
- locale.to4X(),
- options.dateFormatStyle?.timeTo4xOptions() ??
- icu.TimeLength.short,
- )
- : null,
- _dateFormatter = _setDateFormatter(options, data, locale),
- _zonedDateTimeFormatter =
- options.timeZone != null
- ? icu.ZonedDateTimeFormatter.withLengths(
- data.to4X(),
- locale.to4X(),
- options.dateFormatStyle?.dateTo4xOptions() ??
- icu.DateLength.short, //TODO: Check defaults
- options.timeFormatStyle?.timeTo4xOptions() ??
- icu.TimeLength.short, //TODO: Check defaults
- )
- : null;
+ icu.Locale get localeX => (super.locale as Locale4x).get4X;
- static icu.DateTimeFormatter? _setDateTimeFormatter(
+ static icu.Locale setLocaleExtensions(
+ icu.Locale locale,
DateTimeFormatOptions options,
- Data data,
- Locale locale,
) {
- final dateFormatStyle = options.dateFormatStyle;
- final timeFormatStyle = options.timeFormatStyle;
-
- if (dateFormatStyle == null || timeFormatStyle == null) {
- return null;
+ final l = locale.clone();
+ final calendar = options.calendar;
+ if (calendar != null) {
+ l.setUnicodeExtension('ca', calendar.jsName);
}
-
- return icu.DateTimeFormatter.withLengths(
- data.to4X(),
- locale.to4X(),
- dateFormatStyle.dateTo4xOptions(),
- timeFormatStyle.timeTo4xOptions(),
- );
+ final clockStyle = options.clockstyle;
+ if (clockStyle != null) {
+ l.setUnicodeExtension('hc', clockStyle.hourStyleExtensionString);
+ }
+ final numberingSystem = options.numberingSystem;
+ if (numberingSystem != null) {
+ l.setUnicodeExtension('nu', numberingSystem.name);
+ }
+ return l;
}
- static icu.DateFormatter? _setDateFormatter(
- DateTimeFormatOptions options,
- Data data,
- Locale locale,
+ String _dateFormatter(
+ icu.DateFormatter Function(
+ icu.Locale locale, {
+ icu.DateTimeAlignment? alignment,
+ icu.DateTimeLength? length,
+ icu.YearStyle? yearStyle,
+ })
+ f,
+ icu.DateTimeLength length,
+ DateTime datetime,
+ TimeZone? timeZone,
) {
- final dateFormatStyle = options.dateFormatStyle;
- final timeFormatStyle = options.timeFormatStyle;
-
- if (dateFormatStyle == null && timeFormatStyle != null) {
- return null;
- }
-
- return icu.DateFormatter.withLength(
- data.to4X(),
- locale.to4X(),
- dateFormatStyle?.dateTo4xOptions() ?? icu.DateLength.short,
+ final (alignment, yearStyle, _, optionLength) = options.toX();
+ final localeXwithExtensions = setLocaleExtensions(localeX, options);
+ final dateFormatter = f(
+ localeXwithExtensions,
+ alignment: alignment,
+ length: optionLength ?? length,
+ yearStyle: yearStyle,
);
+ final (isoDate, time) = datetime.toX;
+ if (timeZone != null) {
+ final utcOffset = icu.UtcOffset.fromSeconds(timeZone.offset.inSeconds);
+ final timeZoneX = icu.IanaParser()
+ .parse(timeZone.name)
+ .withOffset(utcOffset)
+ .atDateTimeIso(isoDate, time);
+
+ timeZoneX.setVariant(timeZone);
+
+ final zonedDateFormatter = timeZone
+ .map(
+ (timeZone) => switch (timeZone.type) {
+ TimeZoneType.long => icu.ZonedDateFormatter.specificLong,
+ TimeZoneType.short => icu.ZonedDateFormatter.specificShort,
+ TimeZoneType.shortOffset =>
+ icu.ZonedDateFormatter.localizedOffsetShort,
+ TimeZoneType.longOffset =>
+ icu.ZonedDateFormatter.localizedOffsetLong,
+ TimeZoneType.shortGeneric => icu.ZonedDateFormatter.genericShort,
+ TimeZoneType.longGeneric => icu.ZonedDateFormatter.genericLong,
+ },
+ )
+ .map((constr) => constr(localeXwithExtensions, dateFormatter));
+ return zonedDateFormatter.formatIso(isoDate, timeZoneX);
+ } else {
+ return dateFormatter.formatIso(isoDate);
+ }
+ }
+
+ String _dateTimeFormatter(
+ icu.DateTimeFormatter Function(
+ icu.Locale locale, {
+ icu.DateTimeAlignment? alignment,
+ icu.TimePrecision? timePrecision,
+ icu.DateTimeLength? length,
+ icu.YearStyle? yearStyle,
+ })
+ f,
+ icu.DateTimeLength length,
+ DateTime datetime,
+ TimeZone? timeZone,
+ ) {
+ final (alignment, yearStyle, timePrecision, optionLength) = options.toX();
+ final dateTimeFormatter = f(
+ setLocaleExtensions(localeX, options),
+ alignment: alignment,
+ length: optionLength ?? length,
+ timePrecision: timePrecision,
+ yearStyle: yearStyle,
+ );
+ final (isoDate, time) = datetime.toX;
+ if (timeZone != null) {
+ final utcOffset = icu.UtcOffset.fromSeconds(timeZone.offset.inSeconds);
+ final timeZoneX = icu.IanaParser()
+ .parse(timeZone.name)
+ .withOffset(utcOffset)
+ .atDateTimeIso(isoDate, time);
+
+ timeZoneX.setVariant(timeZone);
+
+ final zonedDateFormatter = switch (timeZone.type) {
+ TimeZoneType.long => icu.ZonedDateTimeFormatter.specificLong,
+ TimeZoneType.short => icu.ZonedDateTimeFormatter.specificShort,
+ TimeZoneType.shortOffset =>
+ icu.ZonedDateTimeFormatter.localizedOffsetShort,
+ TimeZoneType.longOffset =>
+ icu.ZonedDateTimeFormatter.localizedOffsetLong,
+ TimeZoneType.shortGeneric => icu.ZonedDateTimeFormatter.genericShort,
+ TimeZoneType.longGeneric => icu.ZonedDateTimeFormatter.genericLong,
+ }(localeX, dateTimeFormatter);
+ return zonedDateFormatter.formatIso(isoDate, time, timeZoneX);
+ } else {
+ return dateTimeFormatter.formatIso(isoDate, time);
+ }
}
@override
- String formatImpl(DateTime datetime) {
- final calendarKind = options.calendar?.to4x() ?? icu.AnyCalendarKind.iso;
- final isoDateTime = icu.DateTime.fromIsoInCalendar(
- datetime.year,
- datetime.month,
- datetime.day,
- datetime.hour,
- datetime.minute,
- datetime.second,
- datetime.microsecond * 1000,
- icu.Calendar.forKind(_data, calendarKind),
+ String d(DateTime datetime) {
+ final (alignment, _, _, optionLength) = options.toX();
+ return icu.DateFormatter.d(
+ setLocaleExtensions(localeX, options),
+ alignment: alignment,
+ length: optionLength ?? icu.DateTimeLength.short,
+ ).formatIso(datetime.toX.$1);
+ }
+
+ @override
+ String m(DateTime datetime) {
+ final (alignment, _, _, optionLength) = options.toX();
+ return icu.DateFormatter.m(
+ setLocaleExtensions(localeX, options),
+ alignment: alignment,
+ length: optionLength ?? icu.DateTimeLength.short,
+ ).formatIso(datetime.toX.$1);
+ }
+
+ @override
+ String md(DateTime datetime) {
+ final (alignment, _, _, optionLength) = options.toX();
+ return icu.DateFormatter.md(
+ setLocaleExtensions(localeX, options),
+ alignment: alignment,
+ length: optionLength ?? icu.DateTimeLength.short,
+ ).formatIso(datetime.toX.$1);
+ }
+
+ @override
+ String y(DateTime datetime, {TimeZone? timeZone}) => _dateFormatter(
+ icu.DateFormatter.y,
+ icu.DateTimeLength.long,
+ datetime,
+ timeZone,
+ );
+
+ @override
+ String ymd(DateTime datetime, {TimeZone? timeZone}) => _dateFormatter(
+ icu.DateFormatter.ymd,
+ icu.DateTimeLength.short,
+ datetime,
+ timeZone,
+ );
+
+ @override
+ String ymde(DateTime datetime, {TimeZone? timeZone}) => _dateFormatter(
+ icu.DateFormatter.ymde,
+ icu.DateTimeLength.short,
+ datetime,
+ timeZone,
+ );
+
+ @override
+ String ymdt(DateTime datetime, {TimeZone? timeZone}) => _dateTimeFormatter(
+ icu.DateTimeFormatter.ymdt,
+ icu.DateTimeLength.short,
+ datetime,
+ timeZone,
+ );
+
+ @override
+ String time(DateTime datetime, {TimeZone? timeZone}) {
+ final (alignment, yearStyle, timePrecision, length) = options.toX(
+ timePrecisionDefault:
+ options.timestyle == TimeStyle.twodigit
+ ? icu.TimePrecision.minute
+ : null,
);
- if (_zonedDateTimeFormatter != null) {
- final ianaToBcp47Mapper = icu.IanaToBcp47Mapper(_data);
- final timeZone =
- icu.CustomTimeZone.empty()
- ..trySetIanaTimeZoneId(ianaToBcp47Mapper, options.timeZone!);
- return _zonedDateTimeFormatter.formatDatetimeWithCustomTimeZone(
- isoDateTime,
- timeZone,
+ final localeXwithExtensions = setLocaleExtensions(localeX, options);
+ final (_, time) = datetime.toX;
+ if (timeZone != null) {
+ final utcOffset = icu.UtcOffset.fromSeconds(timeZone.offset.inSeconds);
+ final correctedDateTime = datetime.add(
+ Duration(seconds: utcOffset.seconds),
);
- } else if (_dateTimeFormatter != null) {
- return _dateTimeFormatter.formatDatetime(isoDateTime);
- } else if (_dateFormatter != null) {
- return _dateFormatter.formatDatetime(isoDateTime);
- } else if (_timeFormatter != null) {
- return _timeFormatter.formatDatetime(isoDateTime);
+ final (isoDate, time) = correctedDateTime.toX;
+ final timeZoneX = icu.IanaParser()
+ .parse(timeZone.name)
+ .withOffset(utcOffset)
+ .atDateTimeIso(isoDate, time);
+
+ timeZoneX.setVariant(timeZone);
+
+ final zonedTimeFormatter = switch (timeZone.type) {
+ TimeZoneType.long => icu.ZonedTimeFormatter.specificLong,
+ TimeZoneType.short => icu.ZonedTimeFormatter.specificShort,
+ TimeZoneType.shortOffset => icu.ZonedTimeFormatter.localizedOffsetShort,
+ TimeZoneType.longOffset => icu.ZonedTimeFormatter.localizedOffsetLong,
+ TimeZoneType.shortGeneric => icu.ZonedTimeFormatter.genericShort,
+ TimeZoneType.longGeneric => icu.ZonedTimeFormatter.genericLong,
+ }(localeXwithExtensions);
+ return zonedTimeFormatter.format(time, timeZoneX);
} else {
- throw UnimplementedError(
- 'Custom skeletons are not yet supported in ICU4X. '
- 'Either date or time formatting has to be enabled.',
+ return icu.TimeFormatter(
+ localeXwithExtensions,
+ alignment: alignment,
+ length: length ?? icu.DateTimeLength.short,
+ timePrecision: timePrecision,
+ ).format(time);
+ }
+ }
+
+ @override
+ String ymdet(DateTime datetime, {TimeZone? timeZone}) {
+ final (alignment, yearStyle, timePrecision, length) = options.toX();
+ final localeXwithExtensions = setLocaleExtensions(localeX, options);
+ final (isoDate, time) = datetime.toX;
+ final dateTimeFormatter = icu.DateTimeFormatter.ymdet(
+ localeXwithExtensions,
+ alignment: alignment,
+ timePrecision: timePrecision,
+ yearStyle: yearStyle,
+ length: length ?? icu.DateTimeLength.short,
+ );
+ if (timeZone != null) {
+ final utcOffset = icu.UtcOffset.fromSeconds(timeZone.offset.inSeconds);
+ final correctedDateTime = datetime.add(
+ Duration(seconds: utcOffset.seconds),
+ );
+ final (isoDate, time) = correctedDateTime.toX;
+ final timeZoneX = icu.IanaParser()
+ .parse(timeZone.name)
+ .withOffset(utcOffset)
+ .atDateTimeIso(isoDate, time);
+
+ timeZoneX.setVariant(timeZone);
+
+ final zonedDateTimeFormatter = switch (timeZone.type) {
+ TimeZoneType.long => icu.ZonedDateTimeFormatter.specificLong,
+ TimeZoneType.short => icu.ZonedDateTimeFormatter.specificShort,
+ TimeZoneType.shortOffset =>
+ icu.ZonedDateTimeFormatter.localizedOffsetShort,
+ TimeZoneType.longOffset =>
+ icu.ZonedDateTimeFormatter.localizedOffsetLong,
+ TimeZoneType.shortGeneric => icu.ZonedDateTimeFormatter.genericShort,
+ TimeZoneType.longGeneric => icu.ZonedDateTimeFormatter.genericLong,
+ }(localeXwithExtensions, dateTimeFormatter);
+ return zonedDateTimeFormatter.formatIso(isoDate, time, timeZoneX);
+ } else {
+ return dateTimeFormatter.formatIso(isoDate, time);
+ }
+ }
+}
+
+extension on icu.TimeZoneInfo {
+ void setVariant(TimeZone timeZone) {
+ final success = inferVariant(icu.VariantOffsetsCalculator());
+ if (!success) {
+ throw ArgumentError(
+ '''
+The variant of ${timeZone.name} with offset ${timeZone.offset} could not be inferred''',
);
}
}
}
-extension on TimeFormatStyle {
- icu.TimeLength timeTo4xOptions() => switch (this) {
- TimeFormatStyle.full => icu.TimeLength.full,
- TimeFormatStyle.long => icu.TimeLength.long,
- TimeFormatStyle.medium => icu.TimeLength.medium,
- TimeFormatStyle.short => icu.TimeLength.short,
- };
- icu.DateLength dateTo4xOptions() => switch (this) {
- TimeFormatStyle.full => icu.DateLength.full,
- TimeFormatStyle.long => icu.DateLength.long,
- TimeFormatStyle.medium => icu.DateLength.medium,
- TimeFormatStyle.short => icu.DateLength.short,
- };
+extension on DateTime {
+ (icu.IsoDate, icu.Time) get toX {
+ final isoDate = icu.IsoDate(year, month, day);
+ final time = icu.Time(
+ hour,
+ minute,
+ second,
+ millisecond * 1_000_000 + microsecond * 1_000,
+ );
+ return (isoDate, time);
+ }
}
-extension on Calendar {
- icu.AnyCalendarKind to4x() => switch (this) {
- Calendar.buddhist => icu.AnyCalendarKind.buddhist,
- Calendar.chinese => icu.AnyCalendarKind.chinese,
- Calendar.coptic => icu.AnyCalendarKind.coptic,
- Calendar.dangi => icu.AnyCalendarKind.dangi,
- Calendar.ethioaa => icu.AnyCalendarKind.ethiopianAmeteAlem,
- Calendar.ethiopic => icu.AnyCalendarKind.ethiopian,
- Calendar.gregory => icu.AnyCalendarKind.gregorian,
- Calendar.hebrew => icu.AnyCalendarKind.hebrew,
- Calendar.indian => icu.AnyCalendarKind.indian,
- Calendar.islamic => icu.AnyCalendarKind.islamicObservational,
- Calendar.islamicUmalqura => icu.AnyCalendarKind.islamicUmmAlQura,
- Calendar.islamicTbla => icu.AnyCalendarKind.islamicTabular,
- Calendar.islamicCivil => icu.AnyCalendarKind.islamicCivil,
- Calendar.islamicRgsa => icu.AnyCalendarKind.islamicObservational,
- Calendar.iso8601 => icu.AnyCalendarKind.iso,
- Calendar.japanese => icu.AnyCalendarKind.japanese,
- Calendar.persian => icu.AnyCalendarKind.persian,
- Calendar.roc => icu.AnyCalendarKind.roc,
- };
+extension on DateTimeFormatOptions {
+ (
+ icu.DateTimeAlignment?,
+ icu.YearStyle?,
+ icu.TimePrecision?,
+ icu.DateTimeLength?,
+ )
+ toX({icu.TimePrecision? timePrecisionDefault}) {
+ icu.TimePrecision? timePrecision;
+ if (fractionalSecondDigits != null) {
+ timePrecision = icu.TimePrecision.fromSubsecondDigits(
+ fractionalSecondDigits!,
+ );
+ } else {
+ timePrecision = switch (timeFormatStyle) {
+ null => timePrecisionDefault ?? icu.TimePrecision.hour,
+ TimeFormatStyle.full => icu.TimePrecision.second,
+ TimeFormatStyle.medium => icu.TimePrecision.second,
+ TimeFormatStyle.short => icu.TimePrecision.minute,
+ };
+ }
+ final dateTimeAlignment =
+ timestyle == TimeStyle.twodigit
+ ? icu.DateTimeAlignment.column
+ : icu.DateTimeAlignment.auto;
+ return (
+ dateTimeAlignment,
+ switch (dateFormatStyle) {
+ null => icu.YearStyle.full,
+ DateFormatStyle.full => icu.YearStyle.auto,
+ DateFormatStyle.long => icu.YearStyle.auto,
+ DateFormatStyle.medium => icu.YearStyle.auto,
+ DateFormatStyle.short => icu.YearStyle.auto,
+ },
+ timePrecision,
+ switch (dateFormatStyle) {
+ DateFormatStyle.full => icu.DateTimeLength.long,
+ DateFormatStyle.long => icu.DateTimeLength.long,
+ DateFormatStyle.medium => icu.DateTimeLength.medium,
+ DateFormatStyle.short => icu.DateTimeLength.short,
+ null => null,
+ },
+ );
+ }
}
diff --git a/pkgs/intl4x/lib/src/datetime_format/datetime_format_ecma.dart b/pkgs/intl4x/lib/src/datetime_format/datetime_format_ecma.dart
index bd9a913..e5a780b 100644
--- a/pkgs/intl4x/lib/src/datetime_format/datetime_format_ecma.dart
+++ b/pkgs/intl4x/lib/src/datetime_format/datetime_format_ecma.dart
@@ -77,23 +77,131 @@
}
@override
- String formatImpl(DateTime datetime) => DateTimeFormat(
- [locale.toLanguageTag().toJS].toJS,
- options.toJsOptions(),
- ).format(datetime.toJs());
+ String d(DateTime datetime) =>
+ _format(datetime: datetime, year: null, day: _timeStyle, month: null);
+
+ @override
+ String m(DateTime datetime) =>
+ _format(datetime: datetime, year: null, day: null, month: _timeStyle);
+
+ @override
+ String md(DateTime datetime) => _format(
+ datetime: datetime,
+ year: null,
+ day: _timeStyle,
+ month: _timeStyle,
+ );
+
+ @override
+ String y(DateTime datetime) => _format(datetime: datetime, year: _timeStyle);
+
+ @override
+ String ymd(DateTime datetime, {TimeZone? timeZone}) => _format(
+ datetime: datetime,
+ year: _timeStyle,
+ month: _timeStyle,
+ day: _timeStyle,
+ timeZone: timeZone,
+ );
+
+ @override
+ String ymde(DateTime datetime) => _format(datetime: datetime);
+
+ @override
+ String ymdt(DateTime datetime, {TimeZone? timeZone}) => _format(
+ datetime: datetime,
+ hour: _timeStyle,
+ minute: _timeStyleOrNull,
+ second: null,
+ year: _timeStyle,
+ month: _timeStyle,
+ day: _timeStyle,
+ timeZone: timeZone,
+ );
+
+ @override
+ String time(DateTime datetime, {TimeZone? timeZone}) => _format(
+ datetime: datetime,
+ year: null,
+ hour: _timeStyle,
+ minute: _timeStyleOrNull,
+ second: null,
+ timeZone: timeZone,
+ );
+
+ TimeStyle? get _timeStyle =>
+ options.dateFormatStyle != null || options.timeFormatStyle != null
+ ? null
+ : (options.timestyle ?? TimeStyle.numeric);
+
+ TimeStyle? get _timeStyleOrNull =>
+ options.dateFormatStyle != null || options.timeFormatStyle != null
+ ? null
+ : options.timestyle;
+
+ @override
+ String ymdet(DateTime datetime) => _format(
+ datetime: datetime,
+ hour: _timeStyle,
+ minute: _timeStyleOrNull,
+ second: null,
+ year: _timeStyle,
+ month: _timeStyle,
+ day: _timeStyle,
+ weekday: Style.short,
+ );
+
+ String _format({
+ TimeStyle? year,
+ TimeStyle? month,
+ TimeStyle? day,
+ TimeStyle? hour,
+ TimeStyle? minute,
+ TimeStyle? second,
+ TimeZone? timeZone,
+ Style? weekday,
+ required DateTime datetime,
+ }) {
+ final correctedDatetime =
+ timeZone == null
+ ? datetime.toJs()
+ : datetime.subtract(timeZone.offset).toJsUtc();
+
+ return DateTimeFormat(
+ [locale.toLanguageTag().toJS].toJS,
+ options.toJsOptions(
+ year: year,
+ month: month,
+ day: day,
+ hour: hour,
+ minute: minute,
+ second: second,
+ timeZone: timeZone,
+ weekday: weekday,
+ ),
+ ).format(correctedDatetime);
+ }
}
extension on DateTime {
- Date toJs() =>
- isUtc
- ? Date.fromTimeStamp(
- Date.UTC(year, month - 1, day, hour, minute, second, millisecond),
- )
- : Date(year, month - 1, day, hour, minute, second, millisecond);
+ Date toJs() => Date(year, month - 1, day, hour, minute, second, millisecond);
+
+ Date toJsUtc() => Date.fromTimeStamp(
+ Date.UTC(year, month - 1, day, hour, minute, second, millisecond),
+ );
}
extension on DateTimeFormatOptions {
- JSAny toJsOptions() =>
+ JSAny toJsOptions({
+ TimeStyle? year,
+ TimeStyle? month,
+ TimeStyle? day,
+ TimeStyle? hour,
+ TimeStyle? minute,
+ TimeStyle? second,
+ TimeZone? timeZone,
+ Style? weekday,
+ }) =>
{
'localeMatcher': localeMatcher.jsName,
if (dateFormatStyle != null) 'dateStyle': dateFormatStyle!.name,
@@ -101,38 +209,29 @@
if (calendar != null) 'calendar': calendar!.jsName,
if (dayPeriod != null) 'dayPeriod': dayPeriod!.name,
if (numberingSystem != null) 'numberingSystem': numberingSystem!.name,
- if (timeZone != null) 'timeZone': timeZone!,
- if (clockstyle != null) 'hour12': clockstyle!.is12Hour,
- if (clockstyle != null && clockstyle!.startAtZero != null)
- 'hourCycle': clockstyle!.hourStyleJsString(),
- if (weekday != null) 'weekday': weekday!.name,
- if (era != null) 'era': era!.name,
- if (year != null) 'year': year!.jsName,
- if (month != null) 'month': month!.jsName,
- if (day != null) 'day': day!.jsName,
- if (hour != null) 'hour': hour!.jsName,
- if (minute != null) 'minute': minute!.jsName,
- if (second != null) 'second': second!.jsName,
+ if (timeZone != null) ...{
+ 'timeZone': timeZone.name,
+ 'timeZoneName': timeZone.type.name,
+ },
+ if (clockstyle != null) ...{
+ 'hour12': clockstyle!.is12Hour,
+ 'hourCycle': clockstyle!.hourStyleExtensionString,
+ },
+ if (weekday != null && dateFormatStyle == null) 'weekday': weekday.name,
+ if (era != null && dateFormatStyle == null) 'era': era!.name,
+ if (year != null && dateFormatStyle == null) 'year': year.jsName,
+ if (month != null && dateFormatStyle == null) 'month': month.jsName,
+ if (day != null && dateFormatStyle == null) 'day': day.jsName,
+ if (hour != null && timeFormatStyle == null) 'hour': hour.jsName,
+ if (minute != null && timeFormatStyle == null) 'minute': minute.jsName,
+ if (second != null && timeFormatStyle == null) 'second': second.jsName,
if (fractionalSecondDigits != null)
'fractionalSecondDigits': fractionalSecondDigits!,
- if (timeZoneName != null) 'timeZoneName': timeZoneName!.name,
'formatMatcher': formatMatcher.jsName,
}.jsify()!;
}
extension on ClockStyle {
- String hourStyleJsString() {
- // The four possible values are h11, h12, h23, h24.
- final firstDigit = is12Hour ? 1 : 2;
-
- final subtrahend = startAtZero! ? 1 : 0;
- final secondDigit = firstDigit * 2 - subtrahend;
-
- /// The cases are
- /// * firstDigit == 1 && subtrahend == 1 --> h11
- /// * firstDigit == 1 && subtrahend == 0 --> h12
- /// * firstDigit == 2 && subtrahend == 1 --> h23
- /// * firstDigit == 2 && subtrahend == 0 --> h24
- return 'h$firstDigit$secondDigit';
- }
+ bool get is12Hour =>
+ this == ClockStyle.zeroToEleven || this == ClockStyle.oneToTwelve;
}
diff --git a/pkgs/intl4x/lib/src/datetime_format/datetime_format_impl.dart b/pkgs/intl4x/lib/src/datetime_format/datetime_format_impl.dart
index 4c3e8c6..e89dcb2 100644
--- a/pkgs/intl4x/lib/src/datetime_format/datetime_format_impl.dart
+++ b/pkgs/intl4x/lib/src/datetime_format/datetime_format_impl.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import '../data.dart';
import '../ecma/ecma_policy.dart';
import '../locale/locale.dart';
import '../options.dart';
@@ -21,21 +20,27 @@
DateTimeFormatImpl(this.locale, this.options);
- String formatImpl(DateTime datetime);
-
static DateTimeFormatImpl build(
Locale locale,
- Data data,
DateTimeFormatOptions options,
LocaleMatcher localeMatcher,
EcmaPolicy ecmaPolicy,
) => buildFormatter(
locale,
- data,
options,
localeMatcher,
ecmaPolicy,
getDateTimeFormatterECMA,
getDateTimeFormatter4X,
);
+
+ String d(DateTime datetime);
+ String m(DateTime datetime);
+ String y(DateTime datetime);
+ String md(DateTime datetime);
+ String ymd(DateTime datetime, {TimeZone? timeZone});
+ String ymde(DateTime datetime);
+ String ymdt(DateTime datetime, {TimeZone? timeZone});
+ String ymdet(DateTime datetime);
+ String time(DateTime datetime, {TimeZone? timeZone});
}
diff --git a/pkgs/intl4x/lib/src/datetime_format/datetime_format_options.dart b/pkgs/intl4x/lib/src/datetime_format/datetime_format_options.dart
index 275dafc..caa8cbf 100644
--- a/pkgs/intl4x/lib/src/datetime_format/datetime_format_options.dart
+++ b/pkgs/intl4x/lib/src/datetime_format/datetime_format_options.dart
@@ -7,7 +7,6 @@
typedef WeekDayStyle = Style;
typedef DayPeriod = Style;
typedef EraStyle = Style;
-typedef DateFormatStyle = TimeFormatStyle;
/// DateTime formatting functionality of the browser.
class DateTimeFormatOptions {
@@ -23,24 +22,16 @@
/// [clockstyle] parameter is true.
final DayPeriod? dayPeriod;
final NumberingSystem? numberingSystem;
- final String? timeZone;
/// Whether to use a 12- or 24-hour style clock.
final ClockStyle? clockstyle;
- final WeekDayStyle? weekday;
final EraStyle? era;
- final TimeStyle? year;
- final MonthStyle? month;
- final TimeStyle? day;
- final TimeStyle? hour;
- final TimeStyle? minute;
- final TimeStyle? second;
+ final TimeStyle? timestyle;
/// The number of digits used to represent fractions of a second.
final int? fractionalSecondDigits;
/// The localized representation of the time zone name.
- final TimeZoneName? timeZoneName;
final FormatMatcher formatMatcher;
final LocaleMatcher localeMatcher;
@@ -50,18 +41,10 @@
this.calendar,
this.dayPeriod,
this.numberingSystem,
- this.timeZone,
this.clockstyle,
- this.weekday,
this.era,
- this.year,
- this.month,
- this.day,
- this.hour,
- this.minute,
- this.second,
+ this.timestyle,
this.fractionalSecondDigits,
- this.timeZoneName,
this.formatMatcher = FormatMatcher.bestfit,
this.localeMatcher = LocaleMatcher.bestfit,
});
@@ -72,18 +55,11 @@
Calendar? calendar,
DayPeriod? dayPeriod,
NumberingSystem? numberingSystem,
- String? timeZone,
ClockStyle? clockstyle,
WeekDayStyle? weekday,
EraStyle? era,
- TimeStyle? year,
- MonthStyle? month,
- TimeStyle? day,
- TimeStyle? hour,
- TimeStyle? minute,
- TimeStyle? second,
+ TimeStyle? timestyle,
int? fractionalSecondDigits,
- TimeZoneName? timeZoneName,
FormatMatcher? formatMatcher,
LocaleMatcher? localeMatcher,
}) {
@@ -93,33 +69,35 @@
calendar: calendar ?? this.calendar,
dayPeriod: dayPeriod ?? this.dayPeriod,
numberingSystem: numberingSystem ?? this.numberingSystem,
- timeZone: timeZone ?? this.timeZone,
clockstyle: clockstyle ?? this.clockstyle,
- weekday: weekday ?? this.weekday,
era: era ?? this.era,
- year: year ?? this.year,
- month: month ?? this.month,
- day: day ?? this.day,
- hour: hour ?? this.hour,
- minute: minute ?? this.minute,
- second: second ?? this.second,
+ timestyle: timestyle ?? this.timestyle,
fractionalSecondDigits:
fractionalSecondDigits ?? this.fractionalSecondDigits,
- timeZoneName: timeZoneName ?? this.timeZoneName,
formatMatcher: formatMatcher ?? this.formatMatcher,
localeMatcher: localeMatcher ?? this.localeMatcher,
);
}
}
-class ClockStyle {
- final bool is12Hour;
- final bool? startAtZero;
+enum ClockStyle {
+ zeroToEleven,
+ oneToTwelve,
+ zeroToTwentyThree;
- const ClockStyle({required this.is12Hour, this.startAtZero});
+ String get hourStyleExtensionString {
+ // The three possible values are h11, h12, and h23.
+ return switch (this) {
+ ClockStyle.zeroToEleven => 'h11',
+ ClockStyle.oneToTwelve => 'h12',
+ ClockStyle.zeroToTwentyThree => 'h23',
+ };
+ }
}
-enum TimeFormatStyle { full, long, medium, short }
+enum TimeFormatStyle { full, medium, short }
+
+enum DateFormatStyle { full, long, medium, short }
enum NumberingSystem {
arab,
@@ -146,8 +124,6 @@
tibt,
}
-enum HourCycle { h11, h12, h23, h24 }
-
enum FormatMatcher {
basic,
bestfit('best fit');
@@ -159,20 +135,6 @@
const FormatMatcher([this._jsName]);
}
-enum MonthStyle {
- numeric,
- twodigit('2-digit'),
- long,
- short,
- narrow;
-
- String get jsName => _jsName ?? name;
-
- final String? _jsName;
-
- const MonthStyle([this._jsName]);
-}
-
enum TimeStyle {
numeric,
twodigit('2-digit');
@@ -184,7 +146,39 @@
const TimeStyle([this._jsName]);
}
-enum TimeZoneName {
+final class TimeZone {
+ final String name;
+ final TimeZoneType type;
+ final Duration offset;
+
+ final bool inferVariant;
+
+ const TimeZone.short({required this.name, required this.offset})
+ : type = TimeZoneType.short,
+ inferVariant = true;
+
+ const TimeZone.long({required this.name, required this.offset})
+ : type = TimeZoneType.long,
+ inferVariant = true;
+
+ const TimeZone.shortOffset({required this.name, required this.offset})
+ : type = TimeZoneType.shortOffset,
+ inferVariant = true;
+
+ const TimeZone.longOffset({required this.name, required this.offset})
+ : type = TimeZoneType.longOffset,
+ inferVariant = true;
+
+ const TimeZone.shortGeneric({required this.name, required this.offset})
+ : type = TimeZoneType.shortGeneric,
+ inferVariant = false;
+
+ const TimeZone.longGeneric({required this.name, required this.offset})
+ : type = TimeZoneType.longGeneric,
+ inferVariant = false;
+}
+
+enum TimeZoneType {
/// Example: `Pacific Standard Time`
long,
diff --git a/pkgs/intl4x/lib/src/datetime_format/datetime_format_stub_4x.dart b/pkgs/intl4x/lib/src/datetime_format/datetime_format_stub_4x.dart
index d2f0079..97d06e7 100644
--- a/pkgs/intl4x/lib/src/datetime_format/datetime_format_stub_4x.dart
+++ b/pkgs/intl4x/lib/src/datetime_format/datetime_format_stub_4x.dart
@@ -2,13 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import '../data.dart';
import '../locale/locale.dart';
import 'datetime_format_impl.dart';
import 'datetime_format_options.dart';
DateTimeFormatImpl getDateTimeFormatter4X(
Locale locale,
- Data data,
DateTimeFormatOptions options,
) => throw UnimplementedError('Cannot use ICU4X in web environments.');
diff --git a/pkgs/intl4x/lib/src/display_names/display_names.dart b/pkgs/intl4x/lib/src/display_names/display_names.dart
index 2c113ed..5c57e6e 100644
--- a/pkgs/intl4x/lib/src/display_names/display_names.dart
+++ b/pkgs/intl4x/lib/src/display_names/display_names.dart
@@ -10,7 +10,7 @@
class DisplayNames {
final DisplayNamesImpl _impl;
- DisplayNames(this._impl);
+ DisplayNames._(this._impl);
String ofDateTime(DateTimeField field) => _of(field, _impl.ofDateTime);
@@ -32,3 +32,5 @@
}
}
}
+
+DisplayNames buildDisplayNames(DisplayNamesImpl impl) => DisplayNames._(impl);
diff --git a/pkgs/intl4x/lib/src/display_names/display_names_4x.dart b/pkgs/intl4x/lib/src/display_names/display_names_4x.dart
index 804388a..555ac3f 100644
--- a/pkgs/intl4x/lib/src/display_names/display_names_4x.dart
+++ b/pkgs/intl4x/lib/src/display_names/display_names_4x.dart
@@ -4,29 +4,23 @@
import '../../display_names.dart';
import '../bindings/lib.g.dart' as icu;
-import '../data.dart';
-import '../data_4x.dart';
+
import '../locale/locale.dart';
import '../locale/locale_4x.dart';
import 'display_names_impl.dart';
DisplayNamesImpl getDisplayNames4X(
Locale locale,
- Data data,
DisplayNamesOptions options,
-) => DisplayNames4X(locale, data, options);
+) => DisplayNames4X(locale as Locale4x, options);
class DisplayNames4X extends DisplayNamesImpl {
final icu.LocaleDisplayNamesFormatter _formatter;
final icu.RegionDisplayNames _regionFormatter;
- DisplayNames4X(super.locale, Data data, super.options)
- : _formatter = icu.LocaleDisplayNamesFormatter(
- data.to4X(),
- locale.to4X(),
- options.to4X(),
- ),
- _regionFormatter = icu.RegionDisplayNames(data.to4X(), locale.to4X());
+ DisplayNames4X(Locale4x super.locale, super.options)
+ : _formatter = icu.LocaleDisplayNamesFormatter(locale.get4X, options.toX),
+ _regionFormatter = icu.RegionDisplayNames(locale.get4X, options.toX);
@override
String ofCalendar(Calendar calendar) {
@@ -44,7 +38,7 @@
}
@override
- String ofLanguage(Locale locale) => _formatter.of(locale.to4X());
+ String ofLanguage(Locale locale) => _formatter.of((locale as Locale4x).get4X);
@override
String ofRegion(String regionCode) => _regionFormatter.of(regionCode);
@@ -56,7 +50,7 @@
}
extension on DisplayNamesOptions {
- icu.DisplayNamesOptions to4X() {
+ icu.DisplayNamesOptions get toX {
final icuStyle = switch (style) {
Style.narrow => icu.DisplayNamesStyle.narrow,
Style.short => icu.DisplayNamesStyle.short,
diff --git a/pkgs/intl4x/lib/src/display_names/display_names_impl.dart b/pkgs/intl4x/lib/src/display_names/display_names_impl.dart
index 07775d5..86e6519 100644
--- a/pkgs/intl4x/lib/src/display_names/display_names_impl.dart
+++ b/pkgs/intl4x/lib/src/display_names/display_names_impl.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import '../data.dart';
import '../ecma/ecma_policy.dart';
import '../locale/locale.dart';
import '../options.dart';
@@ -34,13 +33,11 @@
static DisplayNamesImpl build(
Locale locale,
- Data data,
DisplayNamesOptions options,
LocaleMatcher localeMatcher,
EcmaPolicy ecmaPolicy,
) => buildFormatter(
locale,
- data,
options,
localeMatcher,
ecmaPolicy,
diff --git a/pkgs/intl4x/lib/src/display_names/display_names_stub_4x.dart b/pkgs/intl4x/lib/src/display_names/display_names_stub_4x.dart
index 9a761c0..ae7f6fe 100644
--- a/pkgs/intl4x/lib/src/display_names/display_names_stub_4x.dart
+++ b/pkgs/intl4x/lib/src/display_names/display_names_stub_4x.dart
@@ -3,12 +3,11 @@
// BSD-style license that can be found in the LICENSE file.
import '../../display_names.dart';
-import '../data.dart';
+
import '../locale/locale.dart';
import 'display_names_impl.dart';
DisplayNamesImpl getDisplayNames4X(
Locale locale,
- Data data,
DisplayNamesOptions options,
) => throw UnimplementedError('Cannot use ICU4X in web environments.');
diff --git a/pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart b/pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart
index 2692bf6..35364b7 100644
--- a/pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart
+++ b/pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart
@@ -4,8 +4,8 @@
import 'dart:io';
-import 'package:code_assets/code_assets.dart';
import 'package:args/args.dart';
+import 'package:code_assets/code_assets.dart';
import 'package:path/path.dart' as path;
const crateName = 'icu_capi';
@@ -17,6 +17,7 @@
const simulatorKey = 'simulator';
const compileTypeKey = 'compile_type';
const cargoFeaturesKey = 'cargo_features';
+ const workingDirectoryKey = 'working_directory';
final argParser =
ArgParser()
..addOption(fileKey, mandatory: true)
@@ -28,6 +29,7 @@
..addFlag(simulatorKey, defaultsTo: false)
..addOption(osKey, mandatory: true)
..addOption(architectureKey, mandatory: true)
+ ..addOption(workingDirectoryKey)
..addMultiOption(
cargoFeaturesKey,
defaultsTo: ['default_components', 'compiled_data'],
@@ -49,12 +51,20 @@
),
parsed.option(compileTypeKey)! == 'static',
parsed.flag(simulatorKey),
- File.fromUri(Platform.script).parent,
+ (parsed.option(workingDirectoryKey) != null
+ ? Directory(parsed.option(workingDirectoryKey)!)
+ : null) ??
+ File.fromUri(Platform.script).parent,
parsed.multiOption(cargoFeaturesKey),
);
- await lib.copy(
- Uri.file(parsed.option(fileKey)!).toFilePath(windows: Platform.isWindows),
- );
+ if (!lib.existsSync()) {
+ throw FileSystemException('Building the dylib failed', lib.path);
+ }
+ final file = Uri.file(
+ parsed.option(fileKey)!,
+ ).toFilePath(windows: Platform.isWindows);
+ File(file).parent.createSync(recursive: true);
+ await lib.copy(file);
}
// Copied from Dart's package:intl4x build.dart, see
@@ -98,7 +108,7 @@
'--no-default-features',
'--features=${{
...cargoFeatures,
- ...(isNoStd ? ['libc_alloc', 'panic_handler'] : ['logging', 'simple_logger']),
+ ...(isNoStd ? ['libc_alloc', 'looping_panic_handler'] : ['logging', 'simple_logger']),
}.join(',')}',
if (isNoStd) '-Zbuild-std=core,alloc',
if (buildStatic || isNoStd) ...[
diff --git a/pkgs/intl4x/lib/src/intl_standalone.dart b/pkgs/intl4x/lib/src/intl_standalone.dart
index 72e3c1f..52ce1e6 100644
--- a/pkgs/intl4x/lib/src/intl_standalone.dart
+++ b/pkgs/intl4x/lib/src/intl_standalone.dart
@@ -10,6 +10,6 @@
try {
return Locale.parse(Platform.localeName);
} catch (e) {
- return const Locale(language: 'en', region: 'US');
+ return Locale.parse('und');
}
}
diff --git a/pkgs/intl4x/lib/src/list_format/list_format.dart b/pkgs/intl4x/lib/src/list_format/list_format.dart
index 1f68177..b311b67 100644
--- a/pkgs/intl4x/lib/src/list_format/list_format.dart
+++ b/pkgs/intl4x/lib/src/list_format/list_format.dart
@@ -8,7 +8,7 @@
class ListFormat {
final ListFormatImpl _listFormatImpl;
- const ListFormat(this._listFormatImpl);
+ const ListFormat._(this._listFormatImpl);
/// Locale-dependant concatenation of lists, for example in `en-US` locale:
/// ```dart
@@ -22,3 +22,5 @@
}
}
}
+
+ListFormat buildListFormat(ListFormatImpl impl) => ListFormat._(impl);
diff --git a/pkgs/intl4x/lib/src/list_format/list_format_4x.dart b/pkgs/intl4x/lib/src/list_format/list_format_4x.dart
index 94235a5..a31c43b 100644
--- a/pkgs/intl4x/lib/src/list_format/list_format_4x.dart
+++ b/pkgs/intl4x/lib/src/list_format/list_format_4x.dart
@@ -3,23 +3,18 @@
// BSD-style license that can be found in the LICENSE file.
import '../bindings/lib.g.dart' as icu;
-import '../data.dart';
-import '../data_4x.dart';
import '../locale/locale.dart';
import '../locale/locale_4x.dart';
import 'list_format_impl.dart';
import 'list_format_options.dart';
-ListFormatImpl getListFormatter4X(
- Locale locale,
- Data data,
- ListFormatOptions options,
-) => ListFormat4X(locale, data, options);
+ListFormatImpl getListFormatter4X(Locale locale, ListFormatOptions options) =>
+ ListFormat4X(locale as Locale4x, options);
class ListFormat4X extends ListFormatImpl {
final icu.ListFormatter _formatter;
- ListFormat4X(super.locale, Data data, super.options)
- : _formatter = _getFormatter(locale, data, options);
+ ListFormat4X(Locale4x super.locale, super.options)
+ : _formatter = _getFormatter(locale, options);
@override
String formatImpl(List<String> list) {
@@ -27,8 +22,7 @@
}
static icu.ListFormatter _getFormatter(
- Locale locale,
- Data data,
+ Locale4x locale,
ListFormatOptions options,
) {
final constructor = switch (options.type) {
@@ -36,12 +30,12 @@
Type.or => icu.ListFormatter.orWithLength,
Type.unit => icu.ListFormatter.unitWithLength,
};
- return constructor(data.to4X(), locale.to4X(), options.style.to4X());
+ return constructor(locale.get4X, options.style.toX);
}
}
extension on ListStyle {
- icu.ListLength to4X() => switch (this) {
+ icu.ListLength get toX => switch (this) {
ListStyle.narrow => icu.ListLength.narrow,
ListStyle.short => icu.ListLength.short,
ListStyle.long => icu.ListLength.wide,
diff --git a/pkgs/intl4x/lib/src/list_format/list_format_impl.dart b/pkgs/intl4x/lib/src/list_format/list_format_impl.dart
index ee5ec8b..cfc4b79 100644
--- a/pkgs/intl4x/lib/src/list_format/list_format_impl.dart
+++ b/pkgs/intl4x/lib/src/list_format/list_format_impl.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import '../../ecma_policy.dart';
-import '../data.dart';
import '../ecma/ecma_policy.dart';
import '../locale/locale.dart';
import '../options.dart';
@@ -22,13 +21,11 @@
static ListFormatImpl build(
Locale locales,
- Data data,
ListFormatOptions options,
LocaleMatcher localeMatcher,
EcmaPolicy ecmaPolicy,
) => buildFormatter(
locales,
- data,
options,
localeMatcher,
ecmaPolicy,
diff --git a/pkgs/intl4x/lib/src/list_format/list_format_stub_4x.dart b/pkgs/intl4x/lib/src/list_format/list_format_stub_4x.dart
index 4eef281..a5065f1 100644
--- a/pkgs/intl4x/lib/src/list_format/list_format_stub_4x.dart
+++ b/pkgs/intl4x/lib/src/list_format/list_format_stub_4x.dart
@@ -3,12 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
import '../../list_format.dart';
-import '../data.dart';
import '../locale/locale.dart';
import 'list_format_impl.dart';
-ListFormatImpl getListFormatter4X(
- Locale locale,
- Data data,
- ListFormatOptions options,
-) => throw UnimplementedError('Cannot use ICU4X in web environments.');
+ListFormatImpl getListFormatter4X(Locale locale, ListFormatOptions options) =>
+ throw UnimplementedError('Cannot use ICU4X in web environments.');
diff --git a/pkgs/intl4x/lib/src/locale/locale.dart b/pkgs/intl4x/lib/src/locale/locale.dart
index 267c872..5384ef2 100644
--- a/pkgs/intl4x/lib/src/locale/locale.dart
+++ b/pkgs/intl4x/lib/src/locale/locale.dart
@@ -2,63 +2,21 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'locale_native.dart' if (dart.library.js) 'locale_ecma.dart';
+import 'locale_4x.dart' if (dart.library.js) 'locale_ecma.dart';
/// Representing a Unicode locale identifier. It is composed of the primary
/// `language` subtag for the locale, the `region` (also referred to as
/// 'country') subtag, and the script subtag.
///
/// Examples are `de-DE`, `es-419`, or `zh-Hant-TW`.
-class Locale {
- /// The language subtag, such as `en` for English.
- final String language;
-
- /// The script subtag, such as `Hant` for traditional chinese.
- final String? script;
-
- /// The region subtag, such as `US` for the United Status of America or `419`
- /// for Latin America.
- final String? region;
-
- //TODO(mosum): Add RecordUse here, as soon as it is supported on
- //const constructors
- const Locale({required this.language, this.region, this.script});
-
+//TODO(mosum): Add RecordUse here somehow to record which locales are used.
+abstract class Locale {
/// Generate a language tag by joining the subtags with the [separator].
- String toLanguageTag([String separator = '-']) =>
- toLanguageTagImpl(this, separator);
-
- /// Try to remove tags which would be added by [maximize].
- Locale minimize() => minimizeImpl(this);
-
- /// Try to add the most likely language, script, and region tags.
- Locale maximize() => maximizeImpl(this);
+ String toLanguageTag([String separator = '-']);
/// Parse a language tag by calling to web/ICU4X functionalities.
static Locale parse(String s) => parseLocale(s);
@override
- bool operator ==(Object other) {
- if (identical(this, other)) return true;
-
- return other is Locale &&
- other.language == language &&
- other.script == script &&
- other.region == region;
- }
-
- @override
- int get hashCode {
- return language.hashCode ^ script.hashCode ^ region.hashCode;
- }
-
- @override
String toString() => toLanguageTag();
}
-
-// TODO: add all locales which are supported by ICU4X / Browsers
-const List<Locale> allLocales = [
- Locale(language: 'de', region: 'DE'),
- Locale(language: 'en', region: 'US'),
- Locale(language: 'zh', script: 'Hant'),
-];
diff --git a/pkgs/intl4x/lib/src/locale/locale_4x.dart b/pkgs/intl4x/lib/src/locale/locale_4x.dart
index f496b2a..be2e235 100644
--- a/pkgs/intl4x/lib/src/locale/locale_4x.dart
+++ b/pkgs/intl4x/lib/src/locale/locale_4x.dart
@@ -6,11 +6,15 @@
import 'locale.dart';
-extension Locale4X on Locale {
- icu.Locale to4X() {
- final icu4xLocale = icu.Locale.und()..language = language;
- if (region != null) icu4xLocale.region = region!;
- if (script != null) icu4xLocale.script = script!;
- return icu4xLocale;
- }
+class Locale4x implements Locale {
+ final icu.Locale _locale;
+
+ const Locale4x(this._locale);
+
+ icu.Locale get get4X => _locale;
+
+ @override
+ String toLanguageTag([String separator = '-']) => _locale.toString();
}
+
+Locale parseLocale(String s) => Locale4x(icu.Locale.fromString(s));
diff --git a/pkgs/intl4x/lib/src/locale/locale_ecma.dart b/pkgs/intl4x/lib/src/locale/locale_ecma.dart
index c54589d..e56b6c8 100644
--- a/pkgs/intl4x/lib/src/locale/locale_ecma.dart
+++ b/pkgs/intl4x/lib/src/locale/locale_ecma.dart
@@ -17,24 +17,13 @@
external String? get region;
}
-Locale parseLocale(String s) => toLocale(LocaleJS(s));
+Locale parseLocale(String s) => LocaleEcma(LocaleJS(s));
-Locale toLocale(LocaleJS parsed) => Locale(
- language: parsed.language,
- region: parsed.region,
- script: parsed.script,
-);
+class LocaleEcma implements Locale {
+ final LocaleJS _locale;
-String toLanguageTagImpl(Locale l, [String separator = '-']) =>
- fromLocale(l).toString();
+ LocaleEcma(this._locale);
-LocaleJS fromLocale(Locale l) {
- final options = {
- if (l.region != null) 'region': l.region,
- if (l.script != null) 'script': l.script,
- };
- return LocaleJS.constructor(l.language, options.jsify()!);
+ @override
+ String toLanguageTag([String separator = '-']) => _locale.toString();
}
-
-Locale minimizeImpl(Locale l) => toLocale(fromLocale(l).minimize());
-Locale maximizeImpl(Locale l) => toLocale(fromLocale(l).maximize());
diff --git a/pkgs/intl4x/lib/src/locale/locale_native.dart b/pkgs/intl4x/lib/src/locale/locale_native.dart
deleted file mode 100644
index c87f6f1..0000000
--- a/pkgs/intl4x/lib/src/locale/locale_native.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'locale.dart';
-
-/// This file should be replaced by references to ICU4X when ready.
-
-Locale parseLocaleWithSeparatorPlaceholder(String s, [String separator = '-']) {
- final parsed = s.split('.').first.split(separator);
- // ignore: unused_local_variable
- final subtags = parsed.skipWhile((value) => value != 'u').toList();
- final tags = parsed.takeWhile((value) => value != 'u').toList();
- final language = tags.first;
- final String? script;
- final String? region;
- if (tags.length == 2) {
- if (tags[1].length == 2 && tags[1] == tags[1].toUpperCase()) {
- region = tags[1];
- script = null;
- } else {
- region = null;
- script = tags[1];
- }
- } else if (tags.length == 3) {
- script = tags[1];
- region = tags[2];
- } else {
- script = null;
- region = null;
- }
-
- return Locale(language: language, region: region, script: script);
-}
-
-//TODO: Switch to ICU4X!
-Locale parseLocale(String s, [String separator = '-']) {
- if (s.contains('_')) {
- return parseLocaleWithSeparatorPlaceholder(s, '_');
- } else {
- return parseLocaleWithSeparatorPlaceholder(s);
- }
-}
-
-String toLanguageTagImpl(Locale l, [String separator = '-']) {
- return <String>[
- l.language,
- if (l.script != null) l.script!,
- if (l.region != null) l.region!,
- ].join(separator);
-}
-
-Locale minimizeImpl(Locale l) => throw UnimplementedError();
-Locale maximizeImpl(Locale l) => throw UnimplementedError();
diff --git a/pkgs/intl4x/lib/src/number_format/number_format.dart b/pkgs/intl4x/lib/src/number_format/number_format.dart
index b54f5ae..167726e 100644
--- a/pkgs/intl4x/lib/src/number_format/number_format.dart
+++ b/pkgs/intl4x/lib/src/number_format/number_format.dart
@@ -8,7 +8,7 @@
class NumberFormat {
final NumberFormatImpl _impl;
- NumberFormat(this._impl);
+ NumberFormat._(this._impl);
String format(Object number) {
if (isInTest) {
@@ -18,3 +18,5 @@
}
}
}
+
+NumberFormat buildNumberFormat(NumberFormatImpl impl) => NumberFormat._(impl);
diff --git a/pkgs/intl4x/lib/src/number_format/number_format_4x.dart b/pkgs/intl4x/lib/src/number_format/number_format_4x.dart
index ba66de6..98c4b5c 100644
--- a/pkgs/intl4x/lib/src/number_format/number_format_4x.dart
+++ b/pkgs/intl4x/lib/src/number_format/number_format_4x.dart
@@ -5,8 +5,6 @@
import 'dart:math';
import '../bindings/lib.g.dart' as icu;
-import '../data.dart';
-import '../data_4x.dart';
import '../locale/locale.dart';
import '../locale/locale_4x.dart';
import 'number_format_impl.dart';
@@ -14,38 +12,36 @@
NumberFormatImpl getNumberFormatter4X(
Locale locale,
- Data data,
NumberFormatOptions options,
-) => NumberFormat4X(locale, data, options);
+) => NumberFormat4X(locale as Locale4x, options);
class NumberFormat4X extends NumberFormatImpl {
- final icu.FixedDecimalFormatter _formatter;
- NumberFormat4X(super.locale, Data data, super.options)
- : _formatter = icu.FixedDecimalFormatter.withGroupingStrategy(
- data.to4X(),
- locale.to4X(),
- options.groupingStrategy4X(),
+ final icu.DecimalFormatter _formatter;
+ NumberFormat4X(Locale4x super.locale, super.options)
+ : _formatter = icu.DecimalFormatter.withGroupingStrategy(
+ locale.get4X,
+ options.toX,
);
@override
String formatImpl(Object number) {
- final fixedDecimal = _toFixedDecimal(number);
+ final fixedDecimal = _toDecimal(number);
final format = _formatter.format(fixedDecimal);
return format;
}
- icu.FixedDecimal _toFixedDecimal(Object number) {
- final icu.FixedDecimal fixedDecimal;
+ icu.Decimal _toDecimal(Object number) {
+ final icu.Decimal fixedDecimal;
fixedDecimal = switch (number) {
- final int i => icu.FixedDecimal.fromInt(i),
- final double d => icu.FixedDecimal.fromDoubleWithDoublePrecision(d),
- final String s => icu.FixedDecimal.fromString(s),
- Object() => icu.FixedDecimal.fromString(number.toString()),
+ final int i => icu.Decimal.fromInt(i),
+ final double d => icu.Decimal.fromDoubleWithRoundTripPrecision(d),
+ final String s => icu.Decimal.fromString(s),
+ Object() => icu.Decimal.fromString(number.toString()),
};
return _constructDouble(fixedDecimal);
}
- icu.FixedDecimal _constructDouble(icu.FixedDecimal fixedDecimal) {
+ icu.Decimal _constructDouble(icu.Decimal fixedDecimal) {
fixedDecimal.padStart(options.minimumIntegerDigits);
final minFractionDigits = options.digits?.fractionDigits.$1;
final maxFractionDigits = options.digits?.fractionDigits.$2;
@@ -100,36 +96,32 @@
return fixedDecimal;
}
- void _roundDecimal(
- icu.FixedDecimal fixedDecimal,
- int maxSignificantPosition,
- ) {
- final roundingFunction = switch (options.roundingMode) {
- RoundingMode.ceil => fixedDecimal.ceil,
- RoundingMode.floor => fixedDecimal.floor,
- RoundingMode.expand => fixedDecimal.expand,
- RoundingMode.trunc => fixedDecimal.trunc,
- RoundingMode.halfCeil => fixedDecimal.halfCeil,
- RoundingMode.halfFloor => fixedDecimal.halfFloor,
- RoundingMode.halfExpand => fixedDecimal.halfExpand,
- RoundingMode.halfTrunc => fixedDecimal.halfTrunc,
- RoundingMode.halfEven => fixedDecimal.halfEven,
+ void _roundDecimal(icu.Decimal fixedDecimal, int maxSignificantPosition) {
+ final mode = switch (options.roundingMode) {
+ RoundingMode.ceil => icu.DecimalSignedRoundingMode.ceil,
+ RoundingMode.floor => icu.DecimalSignedRoundingMode.floor,
+ RoundingMode.expand => icu.DecimalSignedRoundingMode.expand,
+ RoundingMode.trunc => icu.DecimalSignedRoundingMode.trunc,
+ RoundingMode.halfCeil => icu.DecimalSignedRoundingMode.halfCeil,
+ RoundingMode.halfFloor => icu.DecimalSignedRoundingMode.halfFloor,
+ RoundingMode.halfExpand => icu.DecimalSignedRoundingMode.halfExpand,
+ RoundingMode.halfTrunc => icu.DecimalSignedRoundingMode.halfTrunc,
+ RoundingMode.halfEven => icu.DecimalSignedRoundingMode.halfEven,
};
- roundingFunction(maxSignificantPosition);
+ fixedDecimal.roundWithMode(maxSignificantPosition, mode);
}
}
extension on NumberFormatOptions {
- icu.FixedDecimalGroupingStrategy groupingStrategy4X() =>
- switch (useGrouping) {
- Grouping.always => icu.FixedDecimalGroupingStrategy.always,
- Grouping.auto => icu.FixedDecimalGroupingStrategy.auto,
- Grouping.never => icu.FixedDecimalGroupingStrategy.never,
- Grouping.min2 => icu.FixedDecimalGroupingStrategy.min2,
- };
+ icu.DecimalGroupingStrategy get toX => switch (useGrouping) {
+ Grouping.always => icu.DecimalGroupingStrategy.always,
+ Grouping.auto => icu.DecimalGroupingStrategy.auto,
+ Grouping.never => icu.DecimalGroupingStrategy.never,
+ Grouping.min2 => icu.DecimalGroupingStrategy.min2,
+ };
}
-extension on icu.FixedDecimal {
+extension on icu.Decimal {
int get length => fractionLength + integerLength;
int get fractionLength => max(0, -magnitudeStart);
int get integerLength => max(0, magnitudeEnd + 1);
diff --git a/pkgs/intl4x/lib/src/number_format/number_format_ecma.dart b/pkgs/intl4x/lib/src/number_format/number_format_ecma.dart
index eeba0e8..d7edf8c 100644
--- a/pkgs/intl4x/lib/src/number_format/number_format_ecma.dart
+++ b/pkgs/intl4x/lib/src/number_format/number_format_ecma.dart
@@ -37,7 +37,7 @@
final supportedLocales = supportedLocalesOf(localeMatcher, locale);
return supportedLocales.isNotEmpty
? _NumberFormatECMA(supportedLocales.first, options)
- : _NumberFormatECMA(const Locale(language: 'en'), options);
+ : _NumberFormatECMA(Locale.parse('en'), options);
}
static List<Locale> supportedLocalesOf(
diff --git a/pkgs/intl4x/lib/src/number_format/number_format_impl.dart b/pkgs/intl4x/lib/src/number_format/number_format_impl.dart
index ac2e6c8..22e5a03 100644
--- a/pkgs/intl4x/lib/src/number_format/number_format_impl.dart
+++ b/pkgs/intl4x/lib/src/number_format/number_format_impl.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import '../data.dart';
import '../ecma/ecma_policy.dart';
import '../locale/locale.dart';
import '../options.dart';
@@ -24,13 +23,11 @@
static NumberFormatImpl build(
Locale locale,
- Data data,
NumberFormatOptions options,
LocaleMatcher localeMatcher,
EcmaPolicy ecmaPolicy,
) => buildFormatter(
locale,
- data,
options,
localeMatcher,
ecmaPolicy,
diff --git a/pkgs/intl4x/lib/src/number_format/number_format_stub_4x.dart b/pkgs/intl4x/lib/src/number_format/number_format_stub_4x.dart
index d177ea4..f01dc0b 100644
--- a/pkgs/intl4x/lib/src/number_format/number_format_stub_4x.dart
+++ b/pkgs/intl4x/lib/src/number_format/number_format_stub_4x.dart
@@ -2,13 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import '../data.dart';
import '../locale/locale.dart';
import 'number_format_impl.dart';
import 'number_format_options.dart';
NumberFormatImpl getNumberFormatter4X(
Locale locale,
- Data data,
NumberFormatOptions options,
) => throw UnimplementedError('Cannot use ICU4X in web environments.');
diff --git a/pkgs/intl4x/lib/src/options.dart b/pkgs/intl4x/lib/src/options.dart
index cbae472..89b7856 100644
--- a/pkgs/intl4x/lib/src/options.dart
+++ b/pkgs/intl4x/lib/src/options.dart
@@ -32,12 +32,11 @@
chinese,
coptic,
dangi,
- ethioaa,
- ethiopic,
- gregory,
+ ethiopianAmeteAlem('ethioaa'),
+ ethiopian('ethiopic'),
+ gregorian('gregory'),
hebrew,
indian,
- islamic,
islamicUmalqura('islamic-umalqura'),
islamicTbla('islamic-tbla'),
islamicCivil('islamic-civil'),
diff --git a/pkgs/intl4x/lib/src/plural_rules/plural_rules.dart b/pkgs/intl4x/lib/src/plural_rules/plural_rules.dart
index 10820b4..25c3f42 100644
--- a/pkgs/intl4x/lib/src/plural_rules/plural_rules.dart
+++ b/pkgs/intl4x/lib/src/plural_rules/plural_rules.dart
@@ -8,7 +8,7 @@
class PluralRules {
final PluralRulesImpl _pluralRulesImpl;
- const PluralRules(this._pluralRulesImpl);
+ const PluralRules._(this._pluralRulesImpl);
/// Locale-dependant pluralization, for example in English:
///
@@ -23,3 +23,5 @@
}
enum PluralCategory { zero, one, two, few, many, other }
+
+PluralRules buildPluralRules(PluralRulesImpl impl) => PluralRules._(impl);
diff --git a/pkgs/intl4x/lib/src/plural_rules/plural_rules_4x.dart b/pkgs/intl4x/lib/src/plural_rules/plural_rules_4x.dart
index 6633748..b027339 100644
--- a/pkgs/intl4x/lib/src/plural_rules/plural_rules_4x.dart
+++ b/pkgs/intl4x/lib/src/plural_rules/plural_rules_4x.dart
@@ -3,38 +3,33 @@
// BSD-style license that can be found in the LICENSE file.
import '../bindings/lib.g.dart' as icu;
-import '../data.dart';
-import '../data_4x.dart';
import '../locale/locale.dart';
import '../locale/locale_4x.dart';
import 'plural_rules.dart';
import 'plural_rules_impl.dart';
import 'plural_rules_options.dart';
-PluralRulesImpl getPluralSelect4X(
- Locale locale,
- Data data,
- PluralRulesOptions options,
-) => PluralRules4X(locale, data, options);
+PluralRulesImpl getPluralSelect4X(Locale locale, PluralRulesOptions options) =>
+ PluralRules4X(locale as Locale4x, options);
class PluralRules4X extends PluralRulesImpl {
final icu.PluralRules _pluralRules;
- PluralRules4X(super.locale, Data data, super.options)
+ PluralRules4X(Locale4x super.locale, super.options)
: _pluralRules = switch (options.type) {
- Type.cardinal => icu.PluralRules.cardinal(data.to4X(), locale.to4X()),
- Type.ordinal => icu.PluralRules.ordinal(data.to4X(), locale.to4X()),
+ Type.cardinal => icu.PluralRules.cardinal(locale.get4X),
+ Type.ordinal => icu.PluralRules.ordinal(locale.get4X),
};
@override
PluralCategory selectImpl(num number) {
final operand = icu.PluralOperands.fromString(number.toString());
- return _pluralRules.categoryFor(operand).toDart();
+ return _pluralRules.categoryFor(operand).toDart;
}
}
extension on icu.PluralCategory {
- PluralCategory toDart() => switch (this) {
+ PluralCategory get toDart => switch (this) {
icu.PluralCategory.zero => PluralCategory.zero,
icu.PluralCategory.one => PluralCategory.one,
icu.PluralCategory.two => PluralCategory.two,
diff --git a/pkgs/intl4x/lib/src/plural_rules/plural_rules_impl.dart b/pkgs/intl4x/lib/src/plural_rules/plural_rules_impl.dart
index 3432ae3..a0676c7 100644
--- a/pkgs/intl4x/lib/src/plural_rules/plural_rules_impl.dart
+++ b/pkgs/intl4x/lib/src/plural_rules/plural_rules_impl.dart
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import '../../ecma_policy.dart';
-import '../data.dart';
+
import '../ecma/ecma_policy.dart';
import '../locale/locale.dart';
import '../options.dart';
@@ -23,13 +23,11 @@
static PluralRulesImpl build(
Locale locales,
- Data data,
PluralRulesOptions options,
LocaleMatcher localeMatcher,
EcmaPolicy ecmaPolicy,
) => buildFormatter(
locales,
- data,
options,
localeMatcher,
ecmaPolicy,
diff --git a/pkgs/intl4x/lib/src/plural_rules/plural_rules_stub_4x.dart b/pkgs/intl4x/lib/src/plural_rules/plural_rules_stub_4x.dart
index 2585c93..0d38b41 100644
--- a/pkgs/intl4x/lib/src/plural_rules/plural_rules_stub_4x.dart
+++ b/pkgs/intl4x/lib/src/plural_rules/plural_rules_stub_4x.dart
@@ -3,12 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
import '../../plural_rules.dart';
-import '../data.dart';
+
import '../locale/locale.dart';
import 'plural_rules_impl.dart';
-PluralRulesImpl getPluralSelect4X(
- Locale locale,
- Data data,
- PluralRulesOptions options,
-) => throw UnimplementedError('Cannot use ICU4X in web environments.');
+PluralRulesImpl getPluralSelect4X(Locale locale, PluralRulesOptions options) =>
+ throw UnimplementedError('Cannot use ICU4X in web environments.');
diff --git a/pkgs/intl4x/lib/src/utils.dart b/pkgs/intl4x/lib/src/utils.dart
index 68dd2ff..028a048 100644
--- a/pkgs/intl4x/lib/src/utils.dart
+++ b/pkgs/intl4x/lib/src/utils.dart
@@ -2,25 +2,27 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'data.dart';
import 'ecma/ecma_policy.dart';
import 'locale/locale.dart';
import 'options.dart';
T buildFormatter<T, Options>(
Locale locale,
- Data data,
Options options,
LocaleMatcher localeMatcher,
EcmaPolicy ecmaPolicy,
T? Function(Locale locales, Options options, LocaleMatcher localeMatcher)
builderECMA,
- T Function(Locale locales, Data data, Options options) builder4X,
+ T Function(Locale locales, Options options) builder4X,
) {
if (ecmaPolicy.useBrowser(locale)) {
return builderECMA(locale, options, localeMatcher) ??
- builder4X(locale, data, options);
+ builder4X(locale, options);
} else {
- return builder4X(locale, data, options);
+ return builder4X(locale, options);
}
}
+
+extension Mapper<T extends Object> on T {
+ R map<R>(R Function(T value) f) => f(this);
+}
diff --git a/pkgs/intl4x/pubspec.yaml b/pkgs/intl4x/pubspec.yaml
index 656eea9..1da81a2 100644
--- a/pkgs/intl4x/pubspec.yaml
+++ b/pkgs/intl4x/pubspec.yaml
@@ -1,7 +1,7 @@
name: intl4x
description: >-
A lightweight modular library for internationalization (i18n) functionality.
-version: 0.11.4
+version: 0.12.0
repository: https://github.com/dart-lang/i18n/tree/main/pkgs/intl4x
issue_tracker: https://github.com/dart-lang/i18n/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aintl4x
@@ -21,22 +21,25 @@
dependencies:
args: ^2.7.0
- code_assets: ^0.19.3
+ code_assets: ^0.19.4
collection: ^1.19.1
crypto: ^3.0.6
ffi: ^2.1.4
- hooks: ^0.19.3
+ hooks: ^0.19.5
logging: ^1.3.0
meta: ^1.17.0
- native_toolchain_c: ^0.16.2
+ native_toolchain_c: ^0.16.6
path: ^1.9.1
- record_use: ^0.4.0
+ record_use: ^0.4.1
dev_dependencies:
- dart_flutter_team_lints: ^3.5.1
+ dart_flutter_team_lints: ^3.5.2
test: ^1.26.2
yaml_edit: ^2.2.2
-hook:
- intl4x:
- buildMode: fetch
+hooks:
+ user_defines:
+ intl4x:
+ buildMode: checkout
+ checkoutPath: ../../submodules/icu4x/
+
diff --git a/pkgs/intl4x/test/collation_test.dart b/pkgs/intl4x/test/collation_test.dart
index 197e7f5..94826c3 100644
--- a/pkgs/intl4x/test/collation_test.dart
+++ b/pkgs/intl4x/test/collation_test.dart
@@ -11,14 +11,13 @@
void main() {
test('Does not compare in tests', () {
final unsorted = ['Z', 'a', 'z', 'ä'];
- final collationGerman =
- Intl(locale: const Locale(language: 'de', region: 'DE')).collation();
+ final collationGerman = Intl(locale: Locale.parse('de-DE')).collation();
expect(unsorted..sort(collationGerman.compare), orderedEquals(unsorted));
});
testWithFormatting('Simple EN', () {
final list = ['A', 'B', 'C'];
- final intl = Intl(locale: const Locale(language: 'en', region: 'US'));
+ final intl = Intl(locale: Locale.parse('en-US'));
final collation = intl.collation();
expect(list..sort(collation.compare), orderedEquals(list));
});
@@ -26,13 +25,12 @@
testWithFormatting('Simple DE', () {
final list = ['Z', 'a', 'z', 'ä'];
final expected = ['a', 'ä', 'z', 'Z'];
- final collationGerman =
- Intl(locale: const Locale(language: 'de', region: 'DE')).collation();
+ final collationGerman = Intl(locale: Locale.parse('de-DE')).collation();
expect(list..sort(collationGerman.compare), orderedEquals(expected));
});
testWithFormatting('Search vs. Sort', () {
- final intl = Intl(locale: const Locale(language: 'de'));
+ final intl = Intl(locale: Locale.parse('de'));
final list = ['AE', 'Ä'];
final searchCollation = intl.collation(
diff --git a/pkgs/intl4x/test/datetime_format_test.dart b/pkgs/intl4x/test/datetime_format_test.dart
index 8dd2c87..a9f29d2 100644
--- a/pkgs/intl4x/test/datetime_format_test.dart
+++ b/pkgs/intl4x/test/datetime_format_test.dart
@@ -9,167 +9,725 @@
import 'utils.dart';
void main() {
- testWithFormatting('Basic', () {
- expect(
- Intl(
- locale: const Locale(language: 'en', region: 'US'),
- ).datetimeFormat().format(DateTime.utc(2012, 12, 20, 3, 0, 0)),
- '12/20/2012',
+ group('Basic', () {
+ final intl = Intl(locale: Locale.parse('en-US'));
+ final dateTime = DateTime(2012, 12, 20, 3, 0, 0);
+ testWithFormatting(
+ 'd',
+ () => expect(intl.dateTimeFormat().d(dateTime), '20'),
+ );
+ testWithFormatting(
+ 'm',
+ () => expect(intl.dateTimeFormat().m(dateTime), '12'),
+ );
+ testWithFormatting(
+ 'y',
+ () => expect(intl.dateTimeFormat().y(dateTime), '2012'),
+ );
+ testWithFormatting(
+ 'md',
+ () => expect(intl.dateTimeFormat().md(dateTime), '12/20'),
+ );
+ testWithFormatting(
+ 'ymd',
+ () => expect(intl.dateTimeFormat().ymd(dateTime), '12/20/2012'),
+ );
+ testWithFormatting(
+ 'ymdt',
+ () => expect(
+ intl.dateTimeFormat().ymdt(dateTime),
+ matches(r'12/20/2012[,]? 3\sAM'),
+ ),
+ );
+ testWithFormatting(
+ 'ymdet',
+ () => expect(
+ intl.dateTimeFormat().ymdet(dateTime),
+ matches(r'Thu, 12/20/2012[,]? 3\sAM'),
+ ),
+ );
+ testWithFormatting(
+ 'time',
+ () => expect(intl.dateTimeFormat().time(dateTime), matches(r'3\sAM')),
+ );
+ });
+
+ group('timezone', () {
+ final date = DateTime(2021, 12, 17, 3, 0, 42);
+ final intl = Intl(locale: Locale.parse('en-US'));
+ const timeZone = 'America/Los_Angeles';
+ const offset = Duration(hours: -8);
+ testWithFormatting(
+ 'short',
+ () => expect(
+ intl.dateTimeFormat().ymd(
+ date,
+ timeZone: const TimeZone.short(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? PST'),
+ ),
+ );
+ testWithFormatting(
+ 'long',
+ () => expect(
+ intl.dateTimeFormat().ymd(
+ date,
+ timeZone: const TimeZone.long(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? Pacific Standard Time'),
+ ),
+ );
+ testWithFormatting(
+ 'shortOffset',
+ () => expect(
+ intl
+ .dateTimeFormat(const DateTimeFormatOptions())
+ .ymd(
+ date,
+ timeZone: const TimeZone.shortOffset(
+ name: timeZone,
+ offset: offset,
+ ),
+ ),
+ matches(r'12/17/2021[,]? GMT-8'),
+ ),
+ );
+ testWithFormatting(
+ 'longOffset',
+ () => expect(
+ intl.dateTimeFormat().ymd(
+ date,
+ timeZone: const TimeZone.longOffset(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? GMT-08:00'),
+ ),
+ );
+ testWithFormatting(
+ 'shortGeneric',
+ () => expect(
+ intl.dateTimeFormat().ymd(
+ date,
+ timeZone: const TimeZone.shortGeneric(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? PT'),
+ ),
+ );
+ testWithFormatting(
+ 'longGeneric',
+ () => expect(
+ intl.dateTimeFormat().ymd(
+ date,
+ timeZone: const TimeZone.longGeneric(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? Pacific Time'),
+ ),
+ );
+ });
+
+ group('timezone', () {
+ final date = DateTime(2021, 12, 17, 3, 0, 42);
+ final intl = Intl(locale: Locale.parse('en-US'));
+ const timeZone = 'America/Los_Angeles';
+ const offset = Duration(hours: -8);
+ testWithFormatting(
+ 'short',
+ () => expect(
+ intl.dateTimeFormat().ymdt(
+ date,
+ timeZone: const TimeZone.short(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? 3\sAM PST'),
+ ),
+ );
+ testWithFormatting(
+ 'long',
+ () => expect(
+ intl.dateTimeFormat().ymdt(
+ date,
+ timeZone: const TimeZone.long(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? 3\sAM Pacific Standard Time'),
+ ),
+ );
+ testWithFormatting(
+ 'shortOffset',
+ () => expect(
+ intl
+ .dateTimeFormat(const DateTimeFormatOptions())
+ .ymdt(
+ date,
+ timeZone: const TimeZone.shortOffset(
+ name: timeZone,
+ offset: offset,
+ ),
+ ),
+ matches(r'12/17/2021[,]? 3\sAM GMT-8'),
+ ),
+ );
+ testWithFormatting(
+ 'longOffset',
+ () => expect(
+ intl.dateTimeFormat().ymdt(
+ date,
+ timeZone: const TimeZone.longOffset(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? 3\sAM GMT-08:00'),
+ ),
+ );
+ testWithFormatting(
+ 'shortGeneric',
+ () => expect(
+ intl.dateTimeFormat().ymdt(
+ date,
+ timeZone: const TimeZone.shortGeneric(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? 3\sAM PT'),
+ ),
+ );
+ testWithFormatting(
+ 'longGeneric',
+ () => expect(
+ intl.dateTimeFormat().ymdt(
+ date,
+ timeZone: const TimeZone.longGeneric(name: timeZone, offset: offset),
+ ),
+ matches(r'12/17/2021[,]? 3\sAM Pacific Time'),
+ ),
+ );
+ });
+
+ group('day period', () {
+ final date = DateTime(2021, 12, 17, 4, 0, 42);
+ testWithFormatting(
+ 'short',
+ () => expect(
+ Intl(locale: Locale.parse('en-GB'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ clockstyle: ClockStyle.oneToTwelve,
+ dayPeriod: DayPeriod.short,
+ ),
+ )
+ .time(date),
+ '4 at night',
+ ),
+ );
+
+ testWithFormatting(
+ 'narrow',
+ () => expect(
+ Intl(locale: Locale.parse('fr'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ clockstyle: ClockStyle.oneToTwelve,
+ dayPeriod: DayPeriod.narrow,
+ ),
+ )
+ .time(date),
+ '4 mat.',
+ ),
+ );
+
+ testWithFormatting(
+ 'long',
+ () => expect(
+ Intl(locale: Locale.parse('fr'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ clockstyle: ClockStyle.oneToTwelve,
+ dayPeriod: DayPeriod.long,
+ ),
+ )
+ .time(date),
+ '4 du matin',
+ ),
);
}, tags: ['icu4xUnimplemented']);
- testWithFormatting('timezone', () {
- final date = DateTime.utc(2021, 12, 17, 3, 0, 42);
- final intl = Intl(locale: const Locale(language: 'en', region: 'US'));
- final timeZone = 'America/Los_Angeles';
- expect(
- intl
- .datetimeFormat(
- DateTimeFormatOptions(
- timeZone: timeZone,
- timeZoneName: TimeZoneName.short,
- ),
- )
- .format(date),
- '12/16/2021, PST',
+ group('date style', () {
+ final date = DateTime(2021, 12, 17, 4, 0, 42);
+ testWithFormatting(
+ 'short',
+ () => expect(
+ Intl(locale: Locale.parse('en'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(date),
+ '12/17/21',
+ ),
);
- expect(
- intl
- .datetimeFormat(
- DateTimeFormatOptions(
- timeZone: timeZone,
- timeZoneName: TimeZoneName.long,
- ),
- )
- .format(date),
- '12/16/2021, Pacific Standard Time',
+ testWithFormatting(
+ 'medium',
+ () => expect(
+ Intl(locale: Locale.parse('en'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ dateFormatStyle: DateFormatStyle.medium,
+ ),
+ )
+ .ymd(date),
+ 'Dec 17, 2021',
+ ),
);
- expect(
- intl
- .datetimeFormat(
- DateTimeFormatOptions(
- timeZone: timeZone,
- timeZoneName: TimeZoneName.shortOffset,
- ),
- )
- .format(date),
- '12/16/2021, GMT-8',
+ testWithFormatting(
+ 'long',
+ () => expect(
+ Intl(locale: Locale.parse('en'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ dateFormatStyle: DateFormatStyle.long,
+ ),
+ )
+ .ymd(date),
+ 'December 17, 2021',
+ ),
);
- expect(
- intl
- .datetimeFormat(
- DateTimeFormatOptions(
- timeZone: timeZone,
- timeZoneName: TimeZoneName.longOffset,
- ),
- )
- .format(date),
- '12/16/2021, GMT-08:00',
- );
- expect(
- intl
- .datetimeFormat(
- DateTimeFormatOptions(
- timeZone: timeZone,
- timeZoneName: TimeZoneName.shortGeneric,
- ),
- )
- .format(date),
- '12/16/2021, PT',
- );
- expect(
- intl
- .datetimeFormat(
- DateTimeFormatOptions(
- timeZone: timeZone,
- timeZoneName: TimeZoneName.longGeneric,
- ),
- )
- .format(date),
- '12/16/2021, Pacific Time',
- );
- }, tags: ['icu4xUnimplemented']);
+ });
- testWithFormatting('day period', () {
- final date = DateTime.utc(2021, 12, 17, 4, 0, 42);
- expect(
- Intl(locale: const Locale(language: 'en', region: 'GB'))
- .datetimeFormat(
- const DateTimeFormatOptions(
- hour: TimeStyle.numeric,
- clockstyle: ClockStyle(is12Hour: true, startAtZero: false),
- dayPeriod: DayPeriod.short,
- timeZone: 'UTC',
- ),
- )
- .format(date),
- '4 at night',
- );
+ group('time style', () {
+ final date = DateTime(2021, 12, 17, 4, 0, 0);
+ final intl = Intl(locale: Locale.parse('en'));
- expect(
- Intl(locale: const Locale(language: 'fr'))
- .datetimeFormat(
- const DateTimeFormatOptions(
- hour: TimeStyle.numeric,
- clockstyle: ClockStyle(is12Hour: true, startAtZero: false),
- dayPeriod: DayPeriod.narrow,
- timeZone: 'UTC',
- ),
- )
- .format(date),
- '4 mat.',
+ testWithFormatting(
+ 'short',
+ () => expect(
+ intl
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timeFormatStyle: TimeFormatStyle.short,
+ ),
+ )
+ .time(date),
+ matches(r'^4:00\sAM$'),
+ ),
);
+ testWithFormatting(
+ 'medium',
+ () => expect(
+ intl
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timeFormatStyle: TimeFormatStyle.medium,
+ ),
+ )
+ .time(date),
+ matches(r'^4:00:00\sAM$'),
+ ),
+ );
+ });
- expect(
- Intl(locale: const Locale(language: 'fr'))
- .datetimeFormat(
- const DateTimeFormatOptions(
- hour: TimeStyle.numeric,
- clockstyle: ClockStyle(is12Hour: true, startAtZero: false),
- dayPeriod: DayPeriod.long,
- timeZone: 'UTC',
- ),
- )
- .format(date),
- '4 du matin',
+ group('datetime style', () {
+ final date = DateTime(2021, 12, 17, 4, 0, 42);
+ final intl = Intl(locale: Locale.parse('en'));
+ testWithFormatting(
+ 'medium short',
+ () => expect(
+ intl
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timeFormatStyle: TimeFormatStyle.medium,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymdt(date),
+ matches(r'^12/17/21, 4:00:42\sAM$'),
+ ),
);
- }, tags: ['icu4xUnimplemented']);
+ });
- testWithFormatting('style', () {
- final date = DateTime.utc(2021, 12, 17, 4, 0, 42);
- expect(
- Intl(locale: const Locale(language: 'en'))
- .datetimeFormat(
- const DateTimeFormatOptions(
- timeFormatStyle: TimeFormatStyle.short,
- timeZone: 'UTC',
- ),
- )
- .format(date),
- '4:00 AM',
- );
- expect(
- Intl(locale: const Locale(language: 'en'))
- .datetimeFormat(
- const DateTimeFormatOptions(
- dateFormatStyle: DateFormatStyle.short,
- timeZone: 'UTC',
- ),
- )
- .format(date),
- '12/17/21',
- );
- expect(
- Intl(locale: const Locale(language: 'en'))
- .datetimeFormat(
- const DateTimeFormatOptions(
- timeFormatStyle: TimeFormatStyle.medium,
- dateFormatStyle: DateFormatStyle.short,
- timeZone: 'UTC',
- ),
- )
- .format(date),
- '12/17/21, 4:00:42 AM',
- );
- }, tags: ['icu4xUnimplemented']);
+ group('individual options', () {
+ final date = DateTime(2025, 6, 18, 10, 30, 45, 123);
+
+ group('calendar', () {
+ testWithFormatting(
+ 'calendar - chinese',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ calendar: Calendar.chinese,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(date),
+ '5/23/2025',
+ ),
+ );
+
+ testWithFormatting(
+ 'calendar - japanese',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ calendar: Calendar.japanese,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(date),
+ '6/18/7 R',
+ ),
+ );
+
+ testWithFormatting(
+ 'calendar - islamic',
+ () => expect(
+ Intl(locale: Locale.parse('ar'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ calendar: Calendar.islamicCivil,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(date),
+ // Dhu al-Hijjah 12, 1446 AH
+ '21/12/1446 هـ', // 12/11/1446 AH
+ ),
+ );
+ });
+
+ group('numberingSystem', () {
+ testWithFormatting(
+ 'numberingSystem - arab',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ numberingSystem: NumberingSystem.arab,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(DateTime(2025, 6, 18)),
+ '٦/١٨/٢٥', // 18/6/25 in Arabic numerals
+ ),
+ );
+
+ testWithFormatting(
+ 'numberingSystem - devanagari',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ numberingSystem: NumberingSystem.deva,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(DateTime(2025, 6, 18)),
+ '६/१८/२५', // 18/6/25 in Devanagari numerals
+ ),
+ );
+
+ testWithFormatting(
+ 'numberingSystem - devanagari in locale',
+ () => expect(
+ Intl(locale: Locale.parse('en-US-u-nu-deva'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(DateTime(2025, 6, 18)),
+ '६/१८/२५', // 18/6/25 in Devanagari numerals
+ ),
+ );
+
+ testWithFormatting(
+ 'numberingSystem - thai',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ numberingSystem: NumberingSystem.thai,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(DateTime(2025, 6, 18)),
+ '๖/๑๘/๒๕', // 18/6/25 in Thai numerals
+ ),
+ );
+ });
+
+ group('clockstyle', () {
+ testWithFormatting(
+ 'clockstyle - 24-hour',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timestyle: TimeStyle.twodigit,
+ clockstyle: ClockStyle.zeroToTwentyThree,
+ ),
+ )
+ .time(DateTime(2025, 6, 18, 15, 30, 0)),
+ '15:30',
+ ),
+ );
+
+ testWithFormatting(
+ 'clockstyle - 12-hour',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timestyle: TimeStyle.twodigit,
+ clockstyle: ClockStyle.zeroToEleven,
+ ),
+ )
+ .time(DateTime(2025, 6, 18, 15, 30, 0)),
+ matches(r'03:30\sPM'),
+ ),
+ );
+
+ testWithFormatting(
+ 'clockstyle - 12-hour, startAtZero true (0 AM)',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timestyle: TimeStyle.twodigit,
+ clockstyle: ClockStyle.oneToTwelve,
+ dayPeriod: DayPeriod.short,
+ ),
+ )
+ .time(DateTime(2025, 6, 18, 0, 30, 0)),
+ '12:30 at night',
+ ),
+ tags: ['icu4xUnimplemented'],
+ );
+
+ testWithFormatting(
+ 'clockstyle - 12-hour, startAtZero false (12 AM)',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timestyle: TimeStyle.twodigit,
+ clockstyle: ClockStyle.oneToTwelve,
+ dayPeriod: DayPeriod.short,
+ ),
+ )
+ .time(DateTime(2025, 6, 18, 0, 30, 0)),
+ '12:30 at night',
+ ),
+ tags: ['icu4xUnimplemented'],
+ );
+ });
+
+ group('year, month, day, hour, minute, second', () {
+ testWithFormatting(
+ 'year - numeric',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(timestyle: TimeStyle.numeric),
+ )
+ .y(date),
+ '2025',
+ ),
+ );
+
+ testWithFormatting(
+ 'month - twodigit',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(const DateTimeFormatOptions())
+ .md(DateTime(2025, 6, 18)),
+ '6/18',
+ ),
+ );
+
+ testWithFormatting(
+ 'month - narrow',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(timestyle: TimeStyle.numeric),
+ )
+ .md(DateTime(2025, 1, 18)), // January
+ '1/18',
+ ),
+ );
+
+ testWithFormatting(
+ 'day - twodigit',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(timestyle: TimeStyle.twodigit),
+ )
+ .md(DateTime(2025, 6, 8)),
+ '06/08',
+ ),
+ );
+
+ testWithFormatting(
+ 'hour - twodigit',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(timestyle: TimeStyle.twodigit),
+ )
+ .time(DateTime(2025, 6, 18, 7, 30, 0)),
+ matches(r'7:30\sAM'),
+ ),
+ );
+
+ testWithFormatting(
+ 'minute - twodigit',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(timestyle: TimeStyle.twodigit),
+ )
+ .time(DateTime(2025, 6, 18, 7, 5, 0)),
+ matches(r'7:05\sAM'),
+ ),
+ );
+ });
+
+ group('fractionalSecondDigits', () {
+ testWithFormatting(
+ 'fractionalSecondDigits - 1 digit',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timestyle: TimeStyle.numeric,
+ fractionalSecondDigits: 1,
+ ),
+ )
+ .time(DateTime(2025, 6, 18, 10, 30, 45, 123)),
+ matches(r'10:30:45.1\sAM'),
+ ),
+ );
+
+ testWithFormatting(
+ 'fractionalSecondDigits - 3 digits',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ timestyle: TimeStyle.numeric,
+ fractionalSecondDigits: 3,
+ ),
+ )
+ .time(DateTime(2025, 6, 18, 10, 30, 45, 123)),
+ matches(r'10:30:45.123\sAM'),
+ ),
+ );
+ });
+
+ group('formatMatcher and localeMatcher', () {
+ testWithFormatting(
+ 'formatMatcher - basic',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ formatMatcher: FormatMatcher.basic,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(DateTime(2025, 6, 18)),
+ '6/18/25',
+ ),
+ );
+
+ testWithFormatting(
+ 'localeMatcher - lookup',
+ () => expect(
+ Intl(locale: Locale.parse('en-US'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ localeMatcher: LocaleMatcher.lookup,
+ dateFormatStyle: DateFormatStyle.short,
+ ),
+ )
+ .ymd(DateTime(2025, 6, 18)),
+ '6/18/25',
+ ),
+ );
+ });
+ });
+
+ group('combinations of options', () {
+ final date = DateTime(2025, 6, 18, 10, 30, 45, 123);
+ final intlEnUS = Intl(locale: Locale.parse('en-US'));
+
+ group('Time Zone + Date/Time Components', () {
+ testWithFormatting(
+ 'timeZone long + hour numeric + minute twodigit',
+ () => expect(
+ intlEnUS
+ .dateTimeFormat(
+ const DateTimeFormatOptions(timestyle: TimeStyle.numeric),
+ )
+ .time(
+ DateTime(2025, 6, 18, 10, 30, 0),
+ timeZone: const TimeZone.long(
+ name: 'America/New_York',
+ offset: Duration(hours: -4),
+ ),
+ ),
+ matches(r'^10:30\sAM Eastern Daylight Time$'),
+ ),
+ );
+ }, tags: ['icu4xUnimplemented']);
+
+ group('Locale Specific Behavior', () {
+ testWithFormatting(
+ 'French locale - long date, short time',
+ () => expect(
+ Intl(locale: Locale.parse('fr-FR'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ dateFormatStyle: DateFormatStyle.long,
+ timeFormatStyle: TimeFormatStyle.short,
+ ),
+ )
+ .ymdt(date),
+ // Example: 18 juin 2025 à 10:30
+ matches(r'^18 juin 2025 à 10:30$'),
+ ),
+ tags: ['icu4xUnimplemented'],
+ );
+
+ testWithFormatting(
+ 'German locale - full date, medium time, 24-hour clock ECMA',
+ () => expect(
+ Intl(locale: Locale.parse('de-DE'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ dateFormatStyle: DateFormatStyle.full,
+ timeFormatStyle: TimeFormatStyle.medium,
+ clockstyle: ClockStyle.zeroToTwentyThree,
+ ),
+ )
+ .ymdet(date),
+ 'Mittwoch, 18. Juni 2025 um 10:30:45',
+ ),
+ testOn: 'chrome',
+ );
+
+ testWithFormatting(
+ 'German locale - full date, medium time, 24-hour clock ICU4X',
+ () => expect(
+ Intl(locale: Locale.parse('de-DE'))
+ .dateTimeFormat(
+ const DateTimeFormatOptions(
+ dateFormatStyle: DateFormatStyle.full,
+ timeFormatStyle: TimeFormatStyle.medium,
+ clockstyle: ClockStyle.zeroToTwentyThree,
+ ),
+ )
+ .ymdet(date),
+ 'Mittwoch, 18. Juni 2025, 10:30:45',
+ ),
+ testOn: 'vm',
+ );
+ });
+ });
}
diff --git a/pkgs/intl4x/test/display_names_test.dart b/pkgs/intl4x/test/display_names_test.dart
index b987735..785511e 100644
--- a/pkgs/intl4x/test/display_names_test.dart
+++ b/pkgs/intl4x/test/display_names_test.dart
@@ -12,8 +12,8 @@
testWithFormatting('basic', () {
expect(
Intl(
- locale: const Locale(language: 'en', region: 'US'),
- ).displayNames().ofLanguage(const Locale(language: 'de', region: 'DE')),
+ locale: Locale.parse('en-US'),
+ ).displayNames().ofLanguage(Locale.parse('de-DE')),
'German (Germany)',
);
});
@@ -23,53 +23,45 @@
.displayNames(const DisplayNamesOptions(style: Style.long))
.ofLanguage(language);
- const en = Locale(language: 'en');
- const fr = Locale(language: 'fr');
- const de = Locale(language: 'de');
- const zh = Locale(language: 'zh', script: 'Hant');
+ final en = Locale.parse('en');
+ final fr = Locale.parse('fr');
+ final de = Locale.parse('de');
+ final zh = Locale.parse('zh-Hant');
expect(languageOf(en, fr), 'French');
expect(languageOf(en, de), 'German');
- expect(
- languageOf(en, const Locale(language: 'fr', region: 'CA')),
- 'Canadian French',
- );
+ expect(languageOf(en, Locale.parse('fr-CA')), 'Canadian French');
//TODO(mosuem): Skip as ECMA seems to have a bug here.
// expect(languageOf(en, zh), 'Traditional Chinese');
- expect(
- languageOf(en, const Locale(language: 'en', region: 'US')),
- 'American English',
- );
+ expect(languageOf(en, Locale.parse('en-US')), 'American English');
//TODO(mosuem): Skip as ECMA seems to have a bug here.
- // expect(languageOf(en, const Locale(language: 'zh', region: 'TW')),
+ // expect(languageOf(en, Locale.parse('zh-TW')),
// 'Chinese (Taiwan)');
expect(languageOf(zh, fr), '法文');
- expect(languageOf(zh, const Locale(language: 'zh')), '中文');
+ expect(languageOf(zh, Locale.parse('zh')), '中文');
expect(languageOf(zh, de), '德文');
});
testWithFormatting('language with languageDisplay', () {
String languageWith(LanguageDisplay display) =>
- Intl(locale: const Locale(language: 'en'))
+ Intl(locale: Locale.parse('en'))
.displayNames(DisplayNamesOptions(languageDisplay: display))
- .ofLanguage(const Locale(language: 'en', region: 'GB'));
+ .ofLanguage(Locale.parse('en-GB'));
expect(languageWith(LanguageDisplay.dialect), 'British English');
expect(languageWith(LanguageDisplay.standard), 'English (United Kingdom)');
- }, tags: ['icu4xUnimplemented']);
+ });
testWithFormatting('calendar', () {
- final displayNames =
- Intl(locale: const Locale(language: 'en')).displayNames();
+ final displayNames = Intl(locale: Locale.parse('en')).displayNames();
expect(displayNames.ofCalendar(Calendar.roc), 'Minguo Calendar');
- expect(displayNames.ofCalendar(Calendar.gregory), 'Gregorian Calendar');
+ expect(displayNames.ofCalendar(Calendar.gregorian), 'Gregorian Calendar');
expect(displayNames.ofCalendar(Calendar.chinese), 'Chinese Calendar');
}, tags: ['icu4xUnimplemented']);
testWithFormatting('dateTimeField', () {
- final displayNames =
- Intl(locale: const Locale(language: 'pt')).displayNames();
+ final displayNames = Intl(locale: Locale.parse('pt')).displayNames();
expect(displayNames.ofDateTime(DateTimeField.era), 'era');
expect(displayNames.ofDateTime(DateTimeField.year), 'ano');
expect(displayNames.ofDateTime(DateTimeField.month), 'mês');
@@ -85,18 +77,14 @@
testWithFormatting('currency', () {
expect(
- Intl(
- locale: const Locale(language: 'pt'),
- ).displayNames().ofCurrency('USD'),
+ Intl(locale: Locale.parse('pt')).displayNames().ofCurrency('USD'),
'Dólar americano',
);
}, tags: ['icu4xUnimplemented']);
testWithFormatting('script', () {
expect(
- Intl(
- locale: const Locale(language: 'fr'),
- ).displayNames().ofScript('Egyp'),
+ Intl(locale: Locale.parse('fr')).displayNames().ofScript('Egyp'),
'hiéroglyphes égyptiens',
);
}, tags: ['icu4xUnimplemented']);
@@ -105,21 +93,21 @@
String regionNames(Locale locale, String region) =>
Intl(locale: locale).displayNames().ofRegion(region);
- const en = Locale(language: 'en');
+ final en = Locale.parse('en');
expect(regionNames(en, '419'), 'Latin America');
expect(regionNames(en, 'BZ'), 'Belize');
expect(regionNames(en, 'US'), 'United States');
expect(regionNames(en, 'BA'), 'Bosnia & Herzegovina');
expect(regionNames(en, 'MM'), 'Myanmar (Burma)');
- const zh = Locale(language: 'zh', script: 'Hant');
+ final zh = Locale.parse('zh-Hant');
expect(regionNames(zh, '419'), '拉丁美洲');
expect(regionNames(zh, 'BZ'), '貝里斯');
expect(regionNames(zh, 'US'), '美國');
expect(regionNames(zh, 'BA'), '波士尼亞與赫塞哥維納');
expect(regionNames(zh, 'MM'), '緬甸');
- const es = Locale(language: 'es', region: '419');
+ final es = Locale.parse('es-419');
expect(regionNames(es, 'DE'), 'Alemania');
});
}
diff --git a/pkgs/intl4x/test/ecma/display_names_test.dart b/pkgs/intl4x/test/ecma/display_names_test.dart
index 668e8f1..a9c9556 100644
--- a/pkgs/intl4x/test/ecma/display_names_test.dart
+++ b/pkgs/intl4x/test/ecma/display_names_test.dart
@@ -15,17 +15,16 @@
testWithFormatting('basic', () {
expect(
Intl(
- locale: const Locale(language: 'en', region: 'US'),
- ).displayNames().ofLanguage(const Locale(language: 'de', region: 'DE')),
+ locale: Locale.parse('en-US'),
+ ).displayNames().ofLanguage(Locale.parse('de-DE')),
'German (Germany)',
);
});
testWithFormatting('languageDisplay', () {
- String of(DisplayNamesOptions options) =>
- Intl(locale: const Locale(language: 'en'))
- .displayNames(options)
- .ofLanguage(const Locale(language: 'en', region: 'GB'));
+ String of(DisplayNamesOptions options) => Intl(
+ locale: Locale.parse('en'),
+ ).displayNames(options).ofLanguage(Locale.parse('en-GB'));
expect(
of(const DisplayNamesOptions(languageDisplay: LanguageDisplay.dialect)),
@@ -38,17 +37,15 @@
});
testWithFormatting('calendar', () {
- final displayNames =
- Intl(locale: const Locale(language: 'en')).displayNames();
+ final displayNames = Intl(locale: Locale.parse('en')).displayNames();
expect(displayNames.ofCalendar(Calendar.roc), 'Minguo Calendar');
- expect(displayNames.ofCalendar(Calendar.gregory), 'Gregorian Calendar');
+ expect(displayNames.ofCalendar(Calendar.gregorian), 'Gregorian Calendar');
expect(displayNames.ofCalendar(Calendar.chinese), 'Chinese Calendar');
});
testWithFormatting('dateTimeField', () {
- final displayNames =
- Intl(locale: const Locale(language: 'pt')).displayNames();
+ final displayNames = Intl(locale: Locale.parse('pt')).displayNames();
expect(displayNames.ofDateTime(DateTimeField.era), 'era');
expect(displayNames.ofDateTime(DateTimeField.year), 'ano');
expect(displayNames.ofDateTime(DateTimeField.month), 'mês');
@@ -64,27 +61,21 @@
testWithFormatting('currency', () {
expect(
- Intl(
- locale: const Locale(language: 'pt'),
- ).displayNames().ofCurrency('USD'),
+ Intl(locale: Locale.parse('pt')).displayNames().ofCurrency('USD'),
'Dólar americano',
);
});
testWithFormatting('script', () {
expect(
- Intl(
- locale: const Locale(language: 'fr'),
- ).displayNames().ofScript('Egyp'),
+ Intl(locale: Locale.parse('fr')).displayNames().ofScript('Egyp'),
'hiéroglyphes égyptiens',
);
});
testWithFormatting('region', () {
expect(
- Intl(
- locale: const Locale(language: 'es', region: '419'),
- ).displayNames().ofRegion('DE'),
+ Intl(locale: Locale.parse('es-419')).displayNames().ofRegion('DE'),
'Alemania',
);
});
diff --git a/pkgs/intl4x/test/ecma/numberformat_test.dart b/pkgs/intl4x/test/ecma/numberformat_test.dart
index 2965447..82a971d 100644
--- a/pkgs/intl4x/test/ecma/numberformat_test.dart
+++ b/pkgs/intl4x/test/ecma/numberformat_test.dart
@@ -26,7 +26,7 @@
void main() {
group('Some manual tests', () {
- final intl = Intl(locale: const Locale(language: 'en', region: 'US'));
+ final intl = Intl(locale: Locale.parse('en-US'));
testWithFormatting('significantDigits', () {
final numberFormatOptions = intl.numberFormat(
@@ -75,9 +75,9 @@
final numbers = [3.14, 5, 20000, 3, 4.2214, 3.99999, 20000.0001];
final locales = [
- const Locale(language: 'en', region: 'US'),
- const Locale(language: 'de', region: 'DE'),
- const Locale(language: 'zh', region: 'TW'),
+ Locale.parse('en-US'),
+ Locale.parse('de-DE'),
+ Locale.parse('zh-TW'),
];
final options = <(Object, NumberFormatOptions, JSAny)>[
(
diff --git a/pkgs/intl4x/test/list_format_test.dart b/pkgs/intl4x/test/list_format_test.dart
index 8bf1fa4..cce7a52 100644
--- a/pkgs/intl4x/test/list_format_test.dart
+++ b/pkgs/intl4x/test/list_format_test.dart
@@ -11,7 +11,7 @@
void main() {
group('List style options', () {
final list = ['A', 'B', 'C'];
- final intl = Intl(locale: const Locale(language: 'en', region: 'US'));
+ final intl = Intl(locale: Locale.parse('en-US'));
testWithFormatting('long', () {
final listFormat = intl.listFormat(
const ListFormatOptions(style: ListStyle.long),
@@ -34,7 +34,7 @@
group('List type options', () {
final list = ['A', 'B', 'C'];
- final intl = Intl(locale: const Locale(language: 'en', region: 'US'));
+ final intl = Intl(locale: Locale.parse('en-US'));
testWithFormatting('long', () {
final listFormat = intl.listFormat(
const ListFormatOptions(type: Type.and),
@@ -57,7 +57,7 @@
group('List style and type combinations', () {
final list = ['A', 'B', 'C'];
- final intl = Intl(locale: const Locale(language: 'en', region: 'US'));
+ final intl = Intl(locale: Locale.parse('en-US'));
testWithFormatting('long', () {
final formatter = intl.listFormat(
const ListFormatOptions(style: ListStyle.narrow, type: Type.and),
diff --git a/pkgs/intl4x/test/locale/locale_test.dart b/pkgs/intl4x/test/locale/locale_test.dart
deleted file mode 100644
index b3d8f2f..0000000
--- a/pkgs/intl4x/test/locale/locale_test.dart
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:intl4x/intl4x.dart';
-import 'package:test/test.dart';
-
-void main() {
- test('Default locale is set', () {
- expect(Intl().locale.language, isNotEmpty);
- });
- test('Parsing different locales', () {
- expect(Locale.parse('de'), const Locale(language: 'de'));
- expect(Locale.parse('de-DE'), const Locale(language: 'de', region: 'DE'));
- expect(
- Locale.parse('zh-Hant-TW'),
- const Locale(language: 'zh', region: 'TW', script: 'Hant'),
- );
- expect(
- Locale.parse('zh-Hant'),
- const Locale(language: 'zh', script: 'Hant'),
- );
- });
-
- test('toLanguageTag', () {
- expect(const Locale(language: 'de').toLanguageTag(), 'de');
- expect(const Locale(language: 'de', region: 'DE').toLanguageTag(), 'de-DE');
- expect(
- const Locale(
- language: 'de',
- region: 'DE',
- script: 'Hant',
- ).toLanguageTag(),
- 'de-Hant-DE',
- );
- });
-
- test(
- 'Minimize',
- () {
- expect(
- Locale.parse('en-Latn-US').minimize(),
- const Locale(language: 'en'),
- );
- },
- testOn: 'browser', //Wait for ICU4X implementation for native
- );
-
- test(
- 'Maximize',
- () {
- expect(
- const Locale(language: 'en').maximize(),
- Locale.parse('en-Latn-US'),
- );
- },
- testOn: 'browser', //Wait for ICU4X implementation for native
- );
-}
diff --git a/pkgs/intl4x/test/numberformat_test.dart b/pkgs/intl4x/test/numberformat_test.dart
index 028aaac..22aa927 100644
--- a/pkgs/intl4x/test/numberformat_test.dart
+++ b/pkgs/intl4x/test/numberformat_test.dart
@@ -10,7 +10,7 @@
import 'utils.dart';
void main() {
- final intl = Intl(locale: const Locale(language: 'en', region: 'US'));
+ final intl = Intl(locale: Locale.parse('en-US'));
group('grouping', () {
testWithFormatting('always', () {
final numberFormatOptions = intl.numberFormat(
diff --git a/pkgs/intl4x/test/plural_rules_test.dart b/pkgs/intl4x/test/plural_rules_test.dart
index 414c64f..1f9aeb6 100644
--- a/pkgs/intl4x/test/plural_rules_test.dart
+++ b/pkgs/intl4x/test/plural_rules_test.dart
@@ -10,7 +10,7 @@
void main() {
testWithFormatting('en-US simple', () {
final numberFormatOptions = Intl(
- locale: const Locale(language: 'en', region: 'US'),
+ locale: Locale.parse('en-US'),
).plural(PluralRulesOptions());
expect(numberFormatOptions.select(0), PluralCategory.other);
@@ -21,7 +21,7 @@
testWithFormatting('ar-EG simple', () {
final numberFormatOptions = Intl(
- locale: const Locale(language: 'ar', region: 'EG'),
+ locale: Locale.parse('ar-EG'),
).plural(PluralRulesOptions());
expect(numberFormatOptions.select(0), PluralCategory.zero);
@@ -33,7 +33,7 @@
testWithFormatting('en-US ordinal', () {
final numberFormatOptions = Intl(
- locale: const Locale(language: 'en', region: 'US'),
+ locale: Locale.parse('en-US'),
).plural(PluralRulesOptions(type: Type.ordinal));
expect(numberFormatOptions.select(0), PluralCategory.other);
diff --git a/pkgs/intl4x/tool/build_libs.g.dart b/pkgs/intl4x/tool/build_libs.g.dart
deleted file mode 100644
index b20b5d3..0000000
--- a/pkgs/intl4x/tool/build_libs.g.dart
+++ /dev/null
@@ -1,192 +0,0 @@
-// This file is part of ICU4X. For terms of use, please see the file
-// called LICENSE at the top level of the ICU4X source tree
-// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
-
-import 'dart:io';
-
-import 'package:args/args.dart';
-import 'package:code_assets/code_assets.dart';
-import 'package:path/path.dart' as path;
-
-const crateName = 'icu_capi';
-
-Future<void> main(List<String> args) async {
- const fileKey = 'file';
- const osKey = 'os';
- const architectureKey = 'architecture';
- const simulatorKey = 'simulator';
- const compileTypeKey = 'compile_type';
- const cargoFeaturesKey = 'cargo_features';
- final argParser =
- ArgParser()
- ..addOption(fileKey, mandatory: true)
- ..addOption(
- compileTypeKey,
- allowed: ['static', 'dynamic'],
- mandatory: true,
- )
- ..addFlag(simulatorKey, defaultsTo: false)
- ..addOption(osKey, mandatory: true)
- ..addOption(architectureKey, mandatory: true)
- ..addMultiOption(
- cargoFeaturesKey,
- defaultsTo: ['default_components', 'compiled_data'],
- );
-
- ArgResults parsed;
- try {
- parsed = argParser.parse(args);
- } catch (e) {
- print('Error parsing $args');
- print(argParser.usage);
- exit(1);
- }
-
- final lib = await buildLib(
- OS.values.firstWhere((o) => o.name == parsed.option(osKey)!),
- Architecture.values.firstWhere(
- (o) => o.name == parsed.option(architectureKey)!,
- ),
- parsed.option(compileTypeKey)! == 'static',
- parsed.flag(simulatorKey),
- File.fromUri(Platform.script).parent,
- parsed.multiOption(cargoFeaturesKey),
- );
- await lib.copy(
- Uri.file(parsed.option(fileKey)!).toFilePath(windows: Platform.isWindows),
- );
-}
-
-// Copied from Dart's package:intl4x build.dart, see
-// https://github.com/dart-lang/i18n/blob/main/pkgs/intl4x/hook/build.dart
-Future<File> buildLib(
- OS targetOS,
- Architecture targetArchitecture,
- bool buildStatic,
- bool isSimulator,
- Directory startingPoint,
- List<String> cargoFeatures,
-) async {
- // We assume that the first folder to contain a cargo.toml above the
- // output directory is the directory containing the ICU4X code.
- var workingDirectory = startingPoint;
- while (!File.fromUri(
- workingDirectory.uri.resolve('Cargo.toml'),
- ).existsSync()) {
- workingDirectory = workingDirectory.parent;
- }
-
- final isNoStd = _isNoStdTarget((targetOS, targetArchitecture));
- final target = _asRustTarget(targetOS, targetArchitecture, isSimulator);
- if (!isNoStd) {
- final rustArguments = ['target', 'add', target];
- await runProcess(
- 'rustup',
- rustArguments,
- workingDirectory: workingDirectory,
- );
- }
-
- await runProcess('cargo', [
- if (buildStatic || isNoStd) '+nightly',
- 'rustc',
- '--manifest-path=ffi/capi/Cargo.toml',
- '--crate-type=${buildStatic ? 'staticlib' : 'cdylib'}',
- '--release',
- '--config=profile.release.panic="abort"',
- '--config=profile.release.codegen-units=1',
- '--no-default-features',
- '--features=${{
- ...cargoFeatures,
- ...(isNoStd ? ['libc_alloc', 'panic_handler'] : ['logging', 'simple_logger']),
- }.join(',')}',
- if (isNoStd) '-Zbuild-std=core,alloc',
- if (buildStatic || isNoStd) ...[
- '-Zbuild-std=std,panic_abort',
- '-Zbuild-std-features=panic_immediate_abort',
- ],
- '--target=$target',
- ], workingDirectory: workingDirectory);
-
- final file = File(
- path.join(
- workingDirectory.path,
- 'target',
- target,
- 'release',
- (buildStatic ? targetOS.staticlibFileName : targetOS.dylibFileName)(
- crateName.replaceAll('-', '_'),
- ),
- ),
- );
- if (!(await file.exists())) {
- throw FileSystemException('Building the dylib failed', file.path);
- }
- return file;
-}
-
-String _asRustTarget(OS os, Architecture? architecture, bool isSimulator) {
- if (os == OS.iOS && architecture == Architecture.arm64 && isSimulator) {
- return 'aarch64-apple-ios-sim';
- }
- return switch ((os, architecture)) {
- (OS.android, Architecture.arm) => 'armv7-linux-androideabi',
- (OS.android, Architecture.arm64) => 'aarch64-linux-android',
- (OS.android, Architecture.ia32) => 'i686-linux-android',
- (OS.android, Architecture.riscv64) => 'riscv64-linux-android',
- (OS.android, Architecture.x64) => 'x86_64-linux-android',
- (OS.fuchsia, Architecture.arm64) => 'aarch64-unknown-fuchsia',
- (OS.fuchsia, Architecture.x64) => 'x86_64-unknown-fuchsia',
- (OS.iOS, Architecture.arm64) => 'aarch64-apple-ios',
- (OS.iOS, Architecture.x64) => 'x86_64-apple-ios',
- (OS.linux, Architecture.arm) => 'armv7-unknown-linux-gnueabihf',
- (OS.linux, Architecture.arm64) => 'aarch64-unknown-linux-gnu',
- (OS.linux, Architecture.ia32) => 'i686-unknown-linux-gnu',
- (OS.linux, Architecture.riscv32) => 'riscv32gc-unknown-linux-gnu',
- (OS.linux, Architecture.riscv64) => 'riscv64gc-unknown-linux-gnu',
- (OS.linux, Architecture.x64) => 'x86_64-unknown-linux-gnu',
- (OS.macOS, Architecture.arm64) => 'aarch64-apple-darwin',
- (OS.macOS, Architecture.x64) => 'x86_64-apple-darwin',
- (OS.windows, Architecture.arm64) => 'aarch64-pc-windows-msvc',
- (OS.windows, Architecture.ia32) => 'i686-pc-windows-msvc',
- (OS.windows, Architecture.x64) => 'x86_64-pc-windows-msvc',
- (_, _) =>
- throw UnimplementedError(
- 'Target ${(os, architecture)} not available for rust',
- ),
- };
-}
-
-bool _isNoStdTarget((OS os, Architecture? architecture) arg) => [
- (OS.android, Architecture.riscv64),
- (OS.linux, Architecture.riscv64),
-].contains(arg);
-
-Future<void> runProcess(
- String executable,
- List<String> arguments, {
- Directory? workingDirectory,
- bool dryRun = false,
-}) async {
- print('----------');
- print('Running `$executable $arguments` in $workingDirectory');
- if (!dryRun) {
- final processResult = await Process.run(
- executable,
- arguments,
- workingDirectory: workingDirectory?.path,
- );
- print('stdout:');
- print(processResult.stdout);
- if ((processResult.stderr as String).isNotEmpty) {
- print('stderr:');
- print(processResult.stderr);
- }
- if (processResult.exitCode != 0) {
- throw ProcessException(executable, arguments, '', processResult.exitCode);
- }
- } else {
- print('Not running, as --dry-run is set.');
- }
- print('==========');
-}
diff --git a/submodules/icu4x b/submodules/icu4x
index 0ce638f..7a4a00d 160000
--- a/submodules/icu4x
+++ b/submodules/icu4x
@@ -1 +1 @@
-Subproject commit 0ce638f209f363994ec3dc1ff666d8d22aed580d
+Subproject commit 7a4a00d5c373c123d19aaf1dabf475c971c81898
diff --git a/tools/regenerate_bindings.sh b/tools/regenerate_bindings.sh
index 845a123..544c6fd 100644
--- a/tools/regenerate_bindings.sh
+++ b/tools/regenerate_bindings.sh
@@ -3,8 +3,6 @@
cp -a ../../../../../submodules/icu4x/ffi/capi/bindings/dart/*.dart .
cd ../../../../../
-cp submodules/icu4x/ffi/dart/tool/build_libs.dart pkgs/intl4x/tool/build_libs.g.dart
cp submodules/icu4x/ffi/dart/tool/build_libs.dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart
dart format pkgs/intl4x/lib/src/bindings/
-dart format pkgs/intl4x/tool/build_libs.g.dart
dart format pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart