Arrays.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace PlatformAgnostic
  7. {
  8. namespace Arrays
  9. {
  10. #ifndef ENABLE_GLOBALIZATION
  11. class ArrayLocalization
  12. {
  13. char16 localeSeparator;
  14. static const uint16 BufSize = 256;
  15. public:
  16. ArrayLocalization();
  17. inline char16 GetLocaleSeparator() { return localeSeparator; }
  18. };
  19. #endif
  20. static const uint32 SeparatorBufferSize = 6;
  21. // According to MSDN the maximum number of characters for the list separator (LOCALE_SLIST) is four, including a terminating null character.
  22. bool GetLocaleSeparator(char16* szSeparator, uint32* sepOutLength, uint32 sepBufferSize);
  23. template <uint32 sepBufferSize>
  24. inline bool GetLocaleSeparator(char16(&szSeparator)[sepBufferSize], uint32 *sepOutLength)
  25. {
  26. return GetLocaleSeparator(szSeparator, sepOutLength, sepBufferSize);
  27. }
  28. } // namespace Arrays
  29. } // namespace PlatformAgnostic