JSONStreamWriterImpl.cpp dna/stream/JSONStreamWriterImpl.h dna/TypeDefs.h cassert cstddef cstring tuple utility dna //CopyrightEpicGames,Inc.AllRightsReserved. #include"dna/stream/JSONStreamWriterImpl.h" #include"dna/TypeDefs.h" #include<cassert> #include<cstddef> #include<cstring> #include<tuple> #include<utility> namespacedna{ JSONStreamWriter::~JSONStreamWriter()=default; JSONStreamWriter*JSONStreamWriter::create(BoundedIOStream*stream,std::uint32_tindentWidth,MemoryResource*memRes){ PolyAllocator<JSONStreamWriterImpl>alloc{memRes}; returnalloc.newObject(stream,indentWidth,memRes); } voidJSONStreamWriter::destroy(JSONStreamWriter*instance){ //NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast) autowriter=static_cast<JSONStreamWriterImpl*>(instance); PolyAllocator<JSONStreamWriterImpl>alloc{writer->getMemoryResource()}; alloc.deleteObject(writer); } JSONStreamWriterImpl::JSONStreamWriterImpl(BoundedIOStream*stream_,std::uint32_tindentWidth,MemoryResource*memRes_): BaseImpl{memRes_}, WriterImpl{memRes_}, stream{stream_}, archive{stream_,indentWidth}{ } voidJSONStreamWriterImpl::write(){ stream->open(); archive<<dna; archive.sync(); stream->close(); } }//namespacedna