AGX Dynamics  2.35.0.1
Encoding.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGX_ENCODING_H
18 #define AGX_ENCODING_H
19 
20 #include <agx/agx.h>
21 #include <string>
22 
23 namespace agx
24 {
25 
26 
27  bool AGXCORE_EXPORT isASCII( const char* str );
28 
29  bool AGXCORE_EXPORT isASCII( const std::string& s );
30 
31 
32  std::wstring AGXCORE_EXPORT utf8ToWide( const char* str );
33  std::wstring AGXCORE_EXPORT utf8ToWide( const std::string& s );
34 
35  std::string AGXCORE_EXPORT wideToUtf8( const std::wstring& wide );
36 
37 #ifdef _MSC_VER
38  inline AGXCORE_EXPORT std::wstring UnicodeName( const char *s )
39  {
40  return agx::utf8ToWide(s);
41  }
42 
43  inline AGXCORE_EXPORT std::wstring UnicodeName(const std::string& s )
44  {
45  return agx::utf8ToWide(s);
46  }
47 
48 #else
49  inline AGXCORE_EXPORT const char* UnicodeName( const char *s )
50  {
51  return s;
52  }
53 
54  inline AGXCORE_EXPORT const std::string& UnicodeName(const std::string& s )
55  {
56  return s;
57  }
58 #endif
59 
60 }
61 
62 
63 #endif
64 
#define AGXCORE_EXPORT
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool AGXCORE_EXPORT isASCII(const char *str)
std::wstring AGXCORE_EXPORT utf8ToWide(const char *str)
std::string AGXCORE_EXPORT wideToUtf8(const std::wstring &wide)
AGXCORE_EXPORT const char * UnicodeName(const char *s)
Definition: Encoding.h:49