icudataver.cpp 1021 B

12345678910111213141516171819202122232425262728293031
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. ******************************************************************************
  5. *
  6. * Copyright (C) 2009-2011, International Business Machines
  7. * Corporation and others. All Rights Reserved.
  8. *
  9. ******************************************************************************
  10. */
  11. #include "unicode/utypes.h"
  12. #include "unicode/icudataver.h"
  13. #include "unicode/ures.h"
  14. #include "uresimp.h" /* for ures_getVersionByKey */
  15. U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status) {
  16. UResourceBundle *icudatares = nullptr;
  17. if (U_FAILURE(*status)) {
  18. return;
  19. }
  20. if (dataVersionFillin != nullptr) {
  21. icudatares = ures_openDirect(nullptr, U_ICU_VERSION_BUNDLE , status);
  22. if (U_SUCCESS(*status)) {
  23. ures_getVersionByKey(icudatares, U_ICU_DATA_KEY, dataVersionFillin, status);
  24. }
  25. ures_close(icudatares);
  26. }
  27. }