AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
Encoding.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGX_ENCODING_H
18#define AGX_ENCODING_H
19
20#include <agx/agx.h>
21#include <string>
22
23namespace 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)
AGXCORE_EXPORT const char * UnicodeName(const char *s)
Definition Encoding.h:49
std::wstring AGXCORE_EXPORT utf8ToWide(const char *str)
std::string AGXCORE_EXPORT wideToUtf8(const std::wstring &wide)