Imt.Base C++ API V4.1.1.0
Loading...
Searching...
No Matches
StringConversion.h
Go to the documentation of this file.
1// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
2
3#ifndef IMT_BASE_LIB_STRINGS_STRINGCONVERSION_H
4#define IMT_BASE_LIB_STRINGS_STRINGCONVERSION_H
5
8
9#ifdef USE_STL
10
11namespace imt {
12namespace base {
13namespace lib {
14namespace strings {
15
25// AXIVION Next Construct AutosarC++19_03-A0.1.6: not all project use the type
26class StringConversion final : private ::imt::base::core::platform::StaticClass {
27
28public:
29
35 // AXIVION Next Codeline AutosarC++19_03-A8.4.7: Pass by value not possible for string.
36 static std::string toNarrowString(wchar_t const* const pString, int32_t const len = -1);
37
41 static inline std::string toNarrowString(std::wstring const& str) {
42 return toNarrowString(str.c_str(), static_cast<int32_t>(str.length()));
43 }
44
50 static std::wstring toWideString(char_t const* const pString, int32_t const len = -1);
51
57 static std::wstring utf8ToWideString(char_t const* const pString, int32_t const len = -1);
58};
59
60} // namespace strings
61} // namespace lib
62} // namespace base
63} // namespace imt
64
65#endif // USE_STL
66#endif // IMT_BASE_LIB_STRINGS_STRINGCONVERSION_H
Base class for a static class that disables construction, copy, assignment and move of instances.
Definition StaticClass.h:48
This is a application specific file which is used to configure Imt.Base.Core.Math.
char char_t
The char_t typedef does not indicate size and signedness and is simply included to allow char objects...
Definition stdchar.h:55
__int32 int32_t
Definition stdint.h:60