tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Currency.cpp (679B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #include "mozilla/intl/Currency.h"
      6 
      7 #include "unicode/ucurr.h"
      8 #include "unicode/uenum.h"
      9 #include "unicode/utypes.h"
     10 
     11 namespace mozilla::intl {
     12 
     13 Result<SpanEnumeration<char>, ICUError> Currency::GetISOCurrencies() {
     14  UErrorCode status = U_ZERO_ERROR;
     15  UEnumeration* enumeration = ucurr_openISOCurrencies(UCURR_ALL, &status);
     16  if (U_FAILURE(status)) {
     17    return Err(ToICUError(status));
     18  }
     19  return SpanEnumeration<char>(enumeration);
     20 }
     21 
     22 }  // namespace mozilla::intl