// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
#include "Define/TapTraceEvent.h"
|
|
#include "Taptap.h"
|
|
UTapTraceEvent::UTapTraceEvent()
|
{
|
JsonObject = MakeShareable(new FJsonObject());
|
}
|
|
void UTapTraceEvent::PutString(FString name, FString value)
|
{
|
JsonObject->SetStringField(name,value);
|
}
|
|
void UTapTraceEvent::PutInt(FString name, int32 value)
|
{
|
JsonObject->SetNumberField(name,value);
|
}
|
|
void UTapTraceEvent::PutFlot(FString name, float value)
|
{
|
JsonObject->SetNumberField(name,value);
|
}
|
|
FString UTapTraceEvent::Build()
|
{
|
FString content;
|
const TSharedRef<TJsonWriter<TCHAR>> write = TJsonWriterFactory<TCHAR>::Create(&content);
|
if (!FJsonSerializer::Serialize(JsonObject.ToSharedRef(),write))
|
{
|
TAPLOG_E(TEXT("BuildTapTrackEvent时出错,无法序列化"))
|
return FString();
|
}
|
TAPLOG_D(TEXT("buildTraceEvent成功:%s"),*content)
|
return content;
|
}
|