Files
Devin Doucette aaa2b7e0c8 LowLevelTests: Changed string conversions to use std::ostream
#preflight 62284f8e8842e17a67d8b0dc
#preflight 6228b09b31133a23da807108
#rb Zousar.Shaker
#rnx

[CL 19320231 by Devin Doucette in ue5-main branch]
2022-03-09 10:27:41 -05:00

49 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "TestHarness.h"
#include "Containers/StringConv.h"
#include "Containers/StringView.h"
#include "Containers/UnrealString.h"
#include "Misc/StringBuilder.h"
std::ostream& operator<<(std::ostream& Stream, const TCHAR* Value)
{
return Stream << FUtf8StringView(FTCHARToUTF8(Value));
}
std::ostream& operator<<(std::ostream& Stream, const FString& Value)
{
return Stream << FUtf8StringView(FTCHARToUTF8(Value));
}
std::ostream& operator<<(std::ostream& Stream, const FAnsiStringView& Value)
{
return Stream.write(Value.GetData(), Value.Len());
}
std::ostream& operator<<(std::ostream& Stream, const FWideStringView& Value)
{
return Stream << FUtf8StringView(FTCHARToUTF8(Value));
}
std::ostream& operator<<(std::ostream& Stream, const FUtf8StringView& Value)
{
return Stream.write((const char*)Value.GetData(), Value.Len());
}
std::ostream& operator<<(std::ostream& Stream, const FAnsiStringBuilderBase& Value)
{
return Stream.write(Value.GetData(), Value.Len());
}
std::ostream& operator<<(std::ostream& Stream, const FWideStringBuilderBase& Value)
{
return Stream << FUtf8StringView(FTCHARToUTF8(Value));
}
std::ostream& operator<<(std::ostream& Stream, const FUtf8StringBuilderBase& Value)
{
return Stream << Value.ToView();
}