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

Method StructToString

IDEHelper/Backend/BeModule.cpp:1882–1917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1880}
1881
1882void BeModule::StructToString(StringImpl& str, BeStructType* structType)
1883{
1884 str += structType->mName;
1885 str += " = type ";
1886 if (!structType->mMembers.IsEmpty())
1887 {
1888 if (structType->mIsPacked)
1889 str += "<";
1890 str += "{";
1891 for (int memberIdx = 0; memberIdx < (int)structType->mMembers.size(); memberIdx++)
1892 {
1893 if (memberIdx > 0)
1894 str += ", ";
1895 ToString(str, structType->mMembers[memberIdx].mType);
1896 }
1897 str += "}";
1898 if (structType->mIsPacked)
1899 str += ">";
1900 }
1901 else
1902 {
1903 str += "opaque";
1904
1905 if (structType->mSize > 0)
1906 {
1907 str += " size ";
1908 str += StrFormat("%d", structType->mSize);
1909 }
1910 if (structType->mAlign > 0)
1911 {
1912 str += " align ";
1913 str += StrFormat("%d", structType->mAlign);
1914 }
1915 }
1916 str += "\n";
1917}
1918
1919String BeModule::ToString(BeFunction* wantFunc)
1920{

Callers

nothing calls this directly

Calls 3

ToStringFunction · 0.50
IsEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected