MCPcopy Create free account
hub / github.com/beefytech/Beef / WriteEmitData

Method WriteEmitData

IDEHelper/Compiler/BfCompiler.cpp:9797–9831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9795}
9796
9797bool BfCompiler::WriteEmitData(const StringImpl& filePath, BfProject* project)
9798{
9799 ZipFile zipFile;
9800
9801 for (auto type : mContext->mResolvedTypes)
9802 {
9803 auto typeInst = type->ToTypeInstance();
9804 if (typeInst == NULL)
9805 continue;
9806 if (typeInst->mTypeDef->mEmitParent == NULL)
9807 continue;
9808 if (!project->ContainsReference(typeInst->mTypeDef->mProject))
9809 continue;
9810
9811 auto bfParser = typeInst->mTypeDef->GetLastSource()->ToParser();
9812 String name = bfParser->mFileName;
9813 if (name.StartsWith("$Emit$"))
9814 name.Remove(0, 6);
9815 String path = EncodeFileName(name);
9816 path.Append(".bf");
9817
9818 if (!zipFile.IsOpen())
9819 {
9820 if (!zipFile.Create(filePath))
9821 return false;
9822 }
9823
9824 zipFile.Add(path, Span<uint8>((uint8*)bfParser->mSrc, bfParser->mSrcLength));
9825 }
9826
9827 if (zipFile.IsOpen())
9828 return zipFile.Close();
9829
9830 return true;
9831}
9832
9833//////////////////////////////////////////////////////////////////////////
9834

Callers 1

BfCompiler_WriteEmitDataFunction · 0.80

Calls 11

ContainsReferenceMethod · 0.80
GetLastSourceMethod · 0.80
AppendMethod · 0.80
ToTypeInstanceMethod · 0.45
ToParserMethod · 0.45
StartsWithMethod · 0.45
RemoveMethod · 0.45
IsOpenMethod · 0.45
CreateMethod · 0.45
AddMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected