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

Method GetEmitSource

IDEHelper/COFF.cpp:6756–6808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6754}
6755
6756bool COFF::GetEmitSource(const StringImpl& filePath, String& outText)
6757{
6758 if (!filePath.StartsWith("$Emit"))
6759 return false;
6760
6761 if (mEmitSourceFile == NULL)
6762 {
6763 mEmitSourceFile = new ZipFile();
6764
6765 String zipPath = mPDBPath;
6766 int dotPos = zipPath.LastIndexOf('.');
6767 zipPath.RemoveToEnd(dotPos);
6768 zipPath.Append("__emit.zip");
6769 if (!mEmitSourceFile->Open(zipPath))
6770 {
6771 if (mCvEmitStream == -1)
6772 return "";
6773
6774 int outSize;
6775 uint8* data = CvReadStream(mCvEmitStream, &outSize);
6776
6777 FileStream fileStream;
6778 fileStream.Open(zipPath, "wb");
6779 fileStream.Write(data, outSize);
6780 fileStream.Close();
6781
6782 delete data;
6783
6784 mEmitSourceFile->Open(zipPath);
6785 }
6786 }
6787
6788 if (mEmitSourceFile->IsOpen())
6789 {
6790 String usePath = filePath;
6791 if (usePath.StartsWith("$Emit"))
6792 {
6793 int dollarPos = usePath.IndexOf('$', 1);
6794 usePath.Remove(0, dollarPos + 1);
6795 }
6796 usePath = EncodeFileName(usePath);
6797 usePath.Append(".bf");
6798
6799 Array<uint8> data;
6800 if (mEmitSourceFile->Get(usePath, data))
6801 {
6802 outText.Insert(outText.mLength, (char*)data.mVals, data.mSize);
6803 return true;
6804 }
6805 }
6806
6807 return false;
6808}
6809
6810bool COFF::HasPendingDebugInfo()
6811{

Callers 1

Calls 12

AppendMethod · 0.80
StartsWithMethod · 0.45
LastIndexOfMethod · 0.45
RemoveToEndMethod · 0.45
OpenMethod · 0.45
WriteMethod · 0.45
CloseMethod · 0.45
IsOpenMethod · 0.45
IndexOfMethod · 0.45
RemoveMethod · 0.45
GetMethod · 0.45
InsertMethod · 0.45

Tested by

no test coverage detected