Hi,
So I have been wondering why there is no Unreal-version of these two standard library classes:
- std::stringstream
- std::wstringstream
I think it could be useful, and I have personally found the need for them several times now. The biggest argument I think is that I have to use TCHAR_TO_WCHAR()
and WCHAR_TO_TCHAR()
macros to safely convert to/from a format so I can use std::wstringstream
(given that I’m actually doing things the right way!).
A much more straight-forward and safer approach would be to have:
template <typename CharType> class TStringStream;
using FStringStream = TStringStream<TCHAR>;
[...]
FStringStream ss;
ss << TEXT("Please append me");
[...]
FString str = TEXT("A text consisting of several words together forming a sentence.");
FStringStream ss(str);
FString word;
ss >> word;
while (!word.empty)
{
print(word); // default usage of each word
ss >> word;
}
So this is kind of both a question and a request. Can we have this? And why does it not already exist?
Thanks!