summaryrefslogtreecommitdiff
path: root/Runtime/Containers/ConstantStringSerialization.h
blob: 47fd4b7c0173ef6c32e7c6d166091ace8f755d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include "Runtime/Allocator/STLAllocator.h"
#include "Runtime/Serialize/SerializeTraits.h"

template<class TransferFunction>
inline void TransferConstantString (ConstantString& constantString, const char* name, TransferMetaFlags transferFlags, MemLabelId label, TransferFunction& transfer)
{
	//@TODO: Make this string use temp data
	UnityStr tempStr;
	if (transfer.IsWriting())
		tempStr = constantString.c_str();
	
	transfer.Transfer(tempStr, name, transferFlags);
	
	if (transfer.IsReading())
		constantString.assign(tempStr.c_str(), label);
}