本文整理汇总了C#中StreamWriterLevel.WriteCodeBlock方法的典型用法代码示例。如果您正苦于以下问题:C# StreamWriterLevel.WriteCodeBlock方法的具体用法?C# StreamWriterLevel.WriteCodeBlock怎么用?C# StreamWriterLevel.WriteCodeBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamWriterLevel
的用法示例。
在下文中一共展示了StreamWriterLevel.WriteCodeBlock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintCDecodeFragmentation
public void PrintCDecodeFragmentation(PEREffectiveConstraint cns, StreamWriterLevel c, string varName, int lev,
string arrName, long max, string prefix,
string length, string curBlockSize, string nCount)
{
string i = "i1";
c.P(lev); c.WriteLine("/* Fragmentation required since {0} is grater than 64K*/", max);
c.WriteCodeBlock(lev,
@"if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &{1}, 0, 0xFF))
{{
*pErrCode = ERR_INSUFFICIENT_DATA;
return FALSE;
}}
while(({1} & 0xC0)==0xC0)
{{
if ({1} == 0xC4)
{2} = 0x10000;
else if ({1} == 0xC3)
{2} = 0xC000;
else if ({1} == 0xC2)
{2} = 0x8000;
else if ({1} == 0xC1)
{2} = 0x4000;
else {{
*pErrCode = ERR_INCORRECT_PER_STREAM;
return FALSE;
}}
if ({3}+{2}>{4})
{{
*pErrCode = ERR_INSUFFICIENT_DATA;
return FALSE;
}}
", i, length, curBlockSize, nCount,max);
// ((ISCCSizeable)pThis).PrintCDecodeItem(cns, c, prefix + arrName + "[" + i + "]", lev + 2);
c.P(lev+1);
c.WriteLine("if (!BitStream_ReadBits(pBitStrm, &{0}arr[{1}/8], {2})) {{", prefix, nCount, curBlockSize);
c.P(lev + 2);
c.WriteLine("*pErrCode = ERR_INSUFFICIENT_DATA;");
c.P(lev + 2);
c.WriteLine("return FALSE;");
c.P(lev+1);
c.WriteLine("}");
c.WriteCodeBlock(lev,
@"
{3}+={2};
if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &{1}, 0, 0xFF)) {{
*pErrCode = ERR_INSUFFICIENT_DATA;
return FALSE;
}}
}}
if ( ({1} & 0x80)>0)
{{
asn1SccSint len2=0;
{1}<<=8;
if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &len2, 0, 0xFF)) {{
*pErrCode = ERR_INSUFFICIENT_DATA;
return FALSE;
}}
{1} |= len2;
{1} &= 0x7FFF;
}}
if ({3}+{1}>{4})
{{
*pErrCode = ERR_INSUFFICIENT_DATA;
return FALSE;
}}
", i, length, curBlockSize, nCount,max);
// ((ISCCSizeable)pThis).PrintCDecodeItem(cns, c, prefix + arrName + "[" + i + "]", lev + 1);
c.P(lev);
c.WriteLine("if (!BitStream_ReadBits(pBitStrm, &{0}arr[{1}/8], {2})) {{", prefix, nCount, length);
c.P(lev + 1);
c.WriteLine("*pErrCode = ERR_INSUFFICIENT_DATA;");
c.P(lev + 1);
c.WriteLine("return FALSE;");
c.P(lev);
c.WriteLine("}");
c.WriteCodeBlock(lev,
@"
{0}+=(long){1};", nCount, length);
c.P(lev); c.WriteLine("{0}nCount = (long){1};", prefix, nCount);
}