Commit graph

31311 commits

Author SHA1 Message Date
Hugo
6d78a95d6d
Merge pull request #23 from younies/unit_header
add usage to number formatter settings header
2020-05-28 10:42:56 +02:00
Hugo
6b14d7f1a0
Merge pull request #45 from hugovdm/usagefix
Support usage component dropping, and more
2020-05-28 10:41:28 +02:00
Hugo van der Merwe
38e4adc92c Drop unnecessary reference to "draft API". 2020-05-28 00:46:28 +02:00
Hugo van der Merwe
10c8ffe7ee Add an error check, as per code review. 2020-05-28 00:33:11 +02:00
Hugo van der Merwe
9b2f8d33c0 Support usage component dropping, and more:
- Improve efficiency by not constructing UnitPreferenceMetadata instance
  in binarySearch: reuse an instance passed in.
- Fix stale documentation. (Doc freshness is hard! ;-)
- getPreferenceMetadataIndex actually returns -1 upon failure.
2020-05-28 00:13:03 +02:00
Hugo van der Merwe
2fc5cc2df0 Add test cases for dropping last component(s) of usage. 2020-05-28 00:13:03 +02:00
Hugo van der Merwe
5fa0dafa31 ICU 68 (not 67). Add U_HIDE_DRAFT_API ifdef guards. 2020-05-27 00:49:19 +02:00
Hugo van der Merwe
0b18db6dd9 Some more documentation tweaks. 2020-05-27 00:40:42 +02:00
Hugo van der Merwe
da8cb01ff7 Clarify the documentation. 2020-05-26 00:45:31 +02:00
Younies Mahmoud
34d357ac72
Merge pull request #42 from younies/unit_header_staging
Add missing comments ...
2020-05-19 15:45:51 +02:00
Younies Mahmoud
a59ad456e4 add a note about with sub usage 2020-05-19 15:42:23 +02:00
Younies Mahmoud
b88aeeecf5 add a note about with empty string 2020-05-19 15:34:48 +02:00
Hugo
d406b915c4
Merge pull request #43 from hugovdm/getUnitCategory
Add getUnitCategory()
2020-05-14 21:42:45 +02:00
Hugo van der Merwe
142fc7db0e Merge branch 'units-staging' into getUnitCategory 2020-05-14 21:07:59 +02:00
Hugo van der Merwe
03270d097b TODO(CLDR-13787) for improving inverse handling. 2020-05-14 21:05:03 +02:00
Hugo van der Merwe
559e76d781 Add unit tests, improve docs, add a FIXME for consumption-inverse. 2020-05-13 16:44:50 +02:00
Shane F. Carr
24494d985e
Merge pull request #42 from hugovdm/UnitPreferences
UnitPreferences class in unitsdata.cpp
2020-05-12 13:41:30 -05:00
Hugo van der Merwe
9b51361358 Add getUnitCategory. 2020-05-12 01:02:27 +02:00
Hugo van der Merwe
3b1d33a543 const implemented: const UnitPreferences *const 2020-05-09 02:56:11 +02:00
Hugo van der Merwe
481c2a59e6 Code review feedback incorporated. 2020-05-08 02:30:06 +02:00
Hugo van der Merwe
4cabfec6e5 Merge branch 'units-staging' into UnitPreferences 2020-05-07 13:28:40 +02:00
Younies Mahmoud
9bcc4b698f
Merge pull request #21 from younies/tryingdouble
Add unit converter.
2020-05-07 13:24:31 +02:00
Hugo van der Merwe
911a3cdc32 const annotations for getPreferencesFor() and thus getAlias() 2020-05-06 15:20:23 +02:00
Hugo van der Merwe
aeccdbf85c Implement slicing via UnitPreference **&outPreferences.
(Still multiple TODOs for make things cleaner/neater.)
2020-05-06 15:08:00 +02:00
Younies Mahmoud
05b0b5c840
Merge pull request #39 from younies/tryingdouble_staging
add a TODO to load the constants\' values from the units data
2020-05-06 04:49:32 +02:00
Younies Mahmoud
4e9a587cb2 add a TODO to load the constants\' values from the units data 2020-05-06 04:48:35 +02:00
Younies Mahmoud
86b7a1ad6e
Merge pull request #38 from younies/tryingdouble_staging
fix substituteConstans function
2020-05-06 04:45:04 +02:00
Younies Mahmoud
bddc5133e3 fix substituteConstans function 2020-05-06 04:43:48 +02:00
Younies Mahmoud
b21e8a9935
Merge pull request #37 from younies/tryingdouble_staging
add substitution of the constant to `Factor`
2020-05-06 02:12:13 +02:00
Younies Mahmoud
3adaf1d0d5 add substitution of the constant to 2020-05-06 02:07:36 +02:00
Younies Mahmoud
0f8d14c335
Merge pull request #36 from younies/tryingdouble_staging
Fix Shane's comment about unitconverter.cpp
2020-05-05 15:54:40 +02:00
Younies Mahmoud
31be989ab6 fix UnitConverter 2020-05-05 15:48:19 +02:00
Hugo van der Merwe
d518e3d6e9 Reduce number of binary searches again, resulting in more complexity. 2020-05-05 15:19:38 +02:00
Hugo van der Merwe
ab4087b670 More readable binarySearch at 4x worst-case cost.
With this hopefully more readable version, looking for an unknown
usage and region will result in the binary search being repeated four
times.

The previous version did not use a metadata instance comparator so
that individual components of the metadata key could be compared. A
comparator that returns status information on which of the components
had been found would be able to improve on this.
2020-05-05 14:41:49 +02:00
Hugo van der Merwe
86cdb41712 One improvement to error reporting. 2020-05-05 14:40:15 +02:00
Younies Mahmoud
0aa80c1d6b
Merge pull request #35 from younies/tryingdouble_staging
Fix dependencies and small nits
2020-05-05 03:50:19 +02:00
Younies Mahmoud
9f1429dc1c fix dependices and small nits 2020-05-05 03:43:49 +02:00
Hugo van der Merwe
535ce7148a First set of code review improvements. 2020-05-05 02:42:03 +02:00
Hugo van der Merwe
ebb9e634ae Fix dependencies.txt, add documentation, add appropriate UMemory inheritence. 2020-05-04 21:39:37 +02:00
Younies Mahmoud
0a93866597
Merge pull request #34 from younies/tryingdouble_staging
Remove extractUnitInfo from UnitConverter's helpers
2020-05-04 15:07:05 +02:00
Younies Mahmoud
8d75df17e4 remove extra spaces from the factors 2020-05-04 15:06:05 +02:00
Hugo van der Merwe
cb3e32625e UnitPreferences class in unitsdata.cpp 2020-05-04 10:46:42 +02:00
Younies Mahmoud
c6bb755ecf remove extractUnitInfo from UnitConverter's helpers 2020-05-04 05:34:45 +02:00
Younies Mahmoud
03345300d0
Merge pull request #33 from hugovdm/tryingdouble_unitsTestTxt
testConversions: test UnitConverter against unitsTest.txt test cases
2020-05-03 20:17:06 +02:00
Shane F. Carr
be7f69941d
Merge pull request #41 from hugovdm/units-staging
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
2020-05-01 21:11:40 -05:00
Hugo van der Merwe
f8722bc575 Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master. 2020-04-30 15:49:12 +02:00
Hugo van der Merwe
308be970c8 testConversions: test UnitConverter against unitsTest.txt test cases 2020-04-30 15:30:59 +02:00
Younies Mahmoud
dad17b1b82
Merge pull request #32 from hugovdm/tryingdouble
Reinstate assertEqualsNear that got lost in merge.
2020-04-30 14:06:58 +02:00
Hugo van der Merwe
984a1c9a43 Reinstate assertEqualsNear that got lost in merge.
- Code compiles, `make check` returns OK.
2020-04-30 10:46:29 +02:00
Younies Mahmoud
256e3bf5f3 merge sffc/units-staging 2020-04-30 01:48:25 +02:00