TextUtilities.cpp 579 Bytes
Newer Older
's avatar
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "TextUtilities.h"
namespace glare
{
	namespace core
	{
		std::wstring TextUtilities::toWString(const std::string& input)
		{
			//make text unsigned (const char* to const unsigned char*) as it's needed for conversion.
			const unsigned char* ch_text = reinterpret_cast<const unsigned char*>(input.data());
			return std::wstring(&ch_text[0], &ch_text[input.size()]);
		}

		bool TextUtilities::isLineBreakable(wchar_t character)
		{
			return (character == ' ' || character == '-' || character == '+' || character == '*' || character == '/');
		}
	}
}