SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
ToString.hpp
Go to the documentation of this file.
1// Copyright (c) 2023 Sapphire's Suite. All Rights Reserved.
2
3#pragma once
4
5#ifndef SAPPHIRE_LOGGER_TO_STRING_GUARD
6#define SAPPHIRE_LOGGER_TO_STRING_GUARD
7
8#include <cstdint>
9
10#include <string>
11#include <vector>
12
22namespace SA
23{
24
25//{ ToString
26
37 template <typename T>
38 std::string ToStringBinary(const T& _elem) noexcept;
39
41
42 namespace Intl
43 {
54 std::string ToStringBinary(const char* _data, uint64_t _size) noexcept;
55 }
56
58
59
70 template <typename T>
71 std::string ToString(const T& _elem);
72
81 template <typename T>
82 std::string ToString(T* _ptr);
83
93 template <typename T>
94 std::string ToString(const T* _elems, uint64_t _size);
95
104 template <typename T>
105 std::string ToString(const std::vector<T>& _vec);
106
107
109
111 std::string ToString(const char& _char);
112
114 std::string ToString(const char* _cstr);
115
117 std::string ToString(const std::string& _str) noexcept;
118
120 std::string ToString(std::string&& _str) noexcept;
121
123
124//}
125
126
127//{ ToWString
128
139 template <typename T>
140 std::wstring ToWString(const T& _elem) noexcept;
141
150 template <typename T>
151 std::wstring ToWString(T* _ptr) noexcept;
152
162 template <typename T>
163 std::wstring ToWString(const T* _elems, uint64_t _size);
164
173 template <typename T>
174 std::wstring ToWString(const std::vector<T>& _vec);
175
176
178
180 std::wstring ToWString(const char& _char);
181
183 std::wstring ToWString(const char* _cstr);
184
186 std::wstring ToWString(const wchar_t& _char);
187
189 std::wstring ToWString(const wchar_t* _cstr);
190
192 std::wstring ToWString(const std::string& _str);
193
195 std::wstring ToWString(const std::wstring& _str) noexcept;
196
198 std::wstring ToWString(std::wstring&& _str) noexcept;
199
201
202//}
203
204} // namespace SA
205
206#include <SA/Logger/Misc/ToString.inl>
207
210#endif // GUARD
std::wstring ToWString(const Log &_log)
ToWString implementation for log.
std::string ToString(LogLevel _lvl) noexcept
ToString implementation for LogLevel.
std::string ToStringBinary(const T &_elem) noexcept
Binary ToString implementation.