本文整理汇总了C#中StreamWriterLevel.WriteComment方法的典型用法代码示例。如果您正苦于以下问题:C# StreamWriterLevel.WriteComment方法的具体用法?C# StreamWriterLevel.WriteComment怎么用?C# StreamWriterLevel.WriteComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamWriterLevel
的用法示例。
在下文中一共展示了StreamWriterLevel.WriteComment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintH
internal void PrintH(StreamWriterLevel h, string uniqueID)
{
////print type declaration
//h.WriteLine("/*");
//h.WriteLine("Definition of :{0}", m_name);
//foreach(string line in m_comments)
// h.WriteLine("{0}", line);
//h.WriteLine("*/");
h.WriteComment(m_comments, 0);
h.Write("typedef ");
((ISCCType)m_type).PrintHTypeDeclaration(m_type.PEREffectiveConstraint, h, uniqueID, "", 0);
if (!(m_type is IA5StringType))
h.WriteLine(" {0};", uniqueID);
h.WriteLine();
//print
h.WriteLine("#define {0}_REQUIRED_BYTES_FOR_ENCODING {1}", uniqueID, m_type.MaxBytesInPER);
h.WriteLine();
((ISCCType)m_type).PrintHConstraintConstant(h, uniqueID);
h.WriteLine();
string star = "";
if (!(m_type is IA5StringType))
star = "*";
h.WriteLine("void {0}_Initialize({0}{1} pVal);", uniqueID, star);
h.WriteLine("flag {0}_IsConstraintValid(const {0}{1} val, int* pErrCode);", uniqueID, star);
h.WriteLine("flag {0}_Encode(const {0}{1} val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);", uniqueID, star);
h.WriteLine("flag {0}_Decode({0}{1} pVal, BitStream* pBitStrm, int* pErrCode);", uniqueID, star);
h.WriteLine();
h.WriteLine();
}
示例2: PrintHTypeDeclaration
public static void PrintHTypeDeclaration(SequenceOrSetType pThis, PEREffectiveConstraint cns, StreamWriterLevel h, string typeName, string varName, int lev)
{
h.WriteLine("struct {");
// h.WriteLine("struct {0} {{", typeName);
foreach (SequenceOrSetType.Child ch in pThis.m_children.Values)
{
h.WriteComment(ch.m_comments, lev + 1);
h.P(lev + 1);
((ISCCType)ch.m_type).PrintHTypeDeclaration(ch.m_type.PEREffectiveConstraint, h,
typeName + "_" + C.ID(ch.m_childVarName), C.ID(ch.m_childVarName), lev + 1);
if (!(ch.m_type is IA5StringType))
h.WriteLine(" {0};", C.ID(ch.m_childVarName));
}
if (pThis.GetNumberOfOptionalOrDefaultFields() != 0)
{
h.P(lev + 1);
h.WriteLine("struct {");
foreach (SequenceOrSetType.Child ch in pThis.m_children.Values)
{
if (ch.m_optional || ch.m_defaultValue != null)
{
h.P(lev + 2);
h.WriteLine("unsigned int {0}:1;", C.ID(ch.m_childVarName));
}
}
h.P(lev + 1);
h.WriteLine("} exist;");
}
h.P(lev);
h.Write("}");
}
示例3: PrintHTypeDeclaration
public void PrintHTypeDeclaration(PEREffectiveConstraint cns, StreamWriterLevel h, string typeName, string varName, int lev)
{
// h.WriteLine("struct {0} {{", typeName);
h.WriteLine("struct {");
h.P(lev + 1);
h.WriteLine("enum {");
// h.WriteLine("enum {0}_PR {{", typeName);
h.P(lev + 2);
h.WriteLine("{0}, /* No components present */", CID_NONE);
// h.WriteLine("{0}_NONE, /* No components present */", typeName);
int i = 0;
foreach (ChoiceChild ch in m_children.Values)
{
h.P(lev + 2);
// h.Write("{0}_{1}", typeName, ch.m_childVarName);
h.Write("{0}", ch.CID);
if (i < m_children.Values.Count - 1)
h.WriteLine(",");
else
h.WriteLine();
i++;
}
h.P(lev + 1);
h.WriteLine("} kind;");
h.P(lev + 1);
h.WriteLine("union {");
// h.WriteLine("union {0}_data {{", typeName);
foreach (ChoiceChild ch in m_children.Values)
{
h.WriteComment(ch.m_comments, lev + 2);
h.P(lev + 2);
((ISCCType)ch.m_type).PrintHTypeDeclaration(ch.m_type.PEREffectiveConstraint, h,
typeName + "_" + C.ID(ch.m_childVarName),
C.ID(ch.m_childVarName), lev + 1);
if (!(ch.m_type is IA5StringType))
h.WriteLine(" {0};", C.ID(ch.m_childVarName));
}
h.P(lev + 1);
h.WriteLine("} u;");
h.P(lev);
h.Write("}");
}