LEFT | RIGHT |
(no file at all) | |
1 // © 2017 and later: Unicode, Inc. and others. | 1 // © 2017 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html | 2 // License & terms of use: http://www.unicode.org/copyright.html |
3 | 3 |
4 #include "unicode/utypes.h" | 4 #include "unicode/utypes.h" |
5 | 5 |
6 #if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT | 6 #if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT |
7 #ifndef __NUMBER_TYPES_H__ | 7 #ifndef __NUMBER_TYPES_H__ |
8 #define __NUMBER_TYPES_H__ | 8 #define __NUMBER_TYPES_H__ |
9 | 9 |
10 #include <cstdint> | 10 #include <cstdint> |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 * | 223 * |
224 * @param quantity | 224 * @param quantity |
225 * The quantity for consideration and optional mutation. | 225 * The quantity for consideration and optional mutation. |
226 * @param micros | 226 * @param micros |
227 * The MicroProps instance to populate. | 227 * The MicroProps instance to populate. |
228 * @return A MicroProps instance resolved for the quantity. | 228 * @return A MicroProps instance resolved for the quantity. |
229 */ | 229 */ |
230 virtual void processQuantity(DecimalQuantity& quantity, MicroProps& micros,
UErrorCode& status) const = 0; | 230 virtual void processQuantity(DecimalQuantity& quantity, MicroProps& micros,
UErrorCode& status) const = 0; |
231 }; | 231 }; |
232 | 232 |
| 233 /** |
| 234 * An interface used by compact notation and scientific notation to choose a mul
tiplier while rounding. |
| 235 */ |
233 class MultiplierProducer { | 236 class MultiplierProducer { |
234 public: | 237 public: |
235 virtual ~MultiplierProducer() = default; | 238 virtual ~MultiplierProducer() = default; |
236 | 239 |
| 240 /** |
| 241 * Maps a magnitude to a multiplier in powers of ten. For example, in compac
t notation in English, a magnitude of 5 |
| 242 * (e.g., 100,000) should return a multiplier of -3, since the number is dis
played in thousands. |
| 243 * |
| 244 * @param magnitude |
| 245 * The power of ten of the input number. |
| 246 * @return The shift in powers of ten. |
| 247 */ |
237 virtual int32_t getMultiplier(int32_t magnitude) const = 0; | 248 virtual int32_t getMultiplier(int32_t magnitude) const = 0; |
238 }; | 249 }; |
239 | 250 |
240 // Exported as U_I18N_API because it is a public member field of exported Decima
lFormatProperties | 251 // Exported as U_I18N_API because it is a public member field of exported Decima
lFormatProperties |
241 template<typename T> | 252 template<typename T> |
242 class U_I18N_API NullableValue { | 253 class U_I18N_API NullableValue { |
243 public: | 254 public: |
244 NullableValue() : fNull(true) {} | 255 NullableValue() : fNull(true) {} |
245 | 256 |
246 NullableValue(const NullableValue<T> &other) = default; | 257 NullableValue(const NullableValue<T> &other) = default; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 T fValue; | 295 T fValue; |
285 }; | 296 }; |
286 | 297 |
287 } // namespace impl | 298 } // namespace impl |
288 } // namespace number | 299 } // namespace number |
289 U_NAMESPACE_END | 300 U_NAMESPACE_END |
290 | 301 |
291 #endif //__NUMBER_TYPES_H__ | 302 #endif //__NUMBER_TYPES_H__ |
292 | 303 |
293 #endif /* #if !UCONFIG_NO_FORMATTING */ | 304 #endif /* #if !UCONFIG_NO_FORMATTING */ |
LEFT | RIGHT |