Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
StringTools.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
11JPH_EXPORT String StringFormat(const char *inFMT, ...);
12
14template<typename T>
15String ConvertToString(const T &inValue)
16{
17 using OStringStream = std::basic_ostringstream<char, std::char_traits<char>, STLAllocator<char>>;
18 OStringStream oss;
19 oss << inValue;
20 return oss.str();
21}
22
24JPH_EXPORT void StringReplace(String &ioString, const string_view &inSearch, const string_view &inReplace);
25
27JPH_EXPORT void StringToVector(const string_view &inString, Array<String> &outVector, const string_view &inDelimiter = ",", bool inClearVector = true);
28
30JPH_EXPORT void VectorToString(const Array<String> &inVector, String &outString, const string_view &inDelimiter = ",");
31
33JPH_EXPORT String ToLower(const string_view &inString);
34
36JPH_EXPORT const char *NibbleToBinary(uint32 inNibble);
37
#define JPH_EXPORT
Definition Core.h:271
#define JPH_NAMESPACE_END
Definition Core.h:414
std::uint32_t uint32
Definition Core.h:484
#define JPH_NAMESPACE_BEGIN
Definition Core.h:408
std::basic_string< char, std::char_traits< char >, STLAllocator< char > > String
Definition STLAllocator.h:107
JPH_EXPORT String ToLower(const string_view &inString)
Convert a string to lower case.
Definition StringTools.cpp:86
String ConvertToString(const T &inValue)
Convert type to string.
Definition StringTools.h:15
JPH_EXPORT void VectorToString(const Array< String > &inVector, String &outString, const string_view &inDelimiter=",")
Convert an array strings to a delimited string.
Definition StringTools.cpp:70
JPH_EXPORT void StringToVector(const string_view &inString, Array< String > &outVector, const string_view &inDelimiter=",", bool inClearVector=true)
Convert a delimited string to an array of strings.
Definition StringTools.cpp:43
JPH_NAMESPACE_BEGIN JPH_EXPORT String StringFormat(const char *inFMT,...)
Definition StringTools.cpp:15
JPH_EXPORT void StringReplace(String &ioString, const string_view &inSearch, const string_view &inReplace)
Replace substring with other string.
Definition StringTools.cpp:28
JPH_EXPORT const char * NibbleToBinary(uint32 inNibble)
Converts the lower 4 bits of inNibble to a string that represents the number in binary format.
Definition StringTools.cpp:95
Definition Array.h:36
STL allocator that forwards to our allocation functions.
Definition STLAllocator.h:17