本文整理汇总了C++中Dsymbol::toCBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ Dsymbol::toCBuffer方法的具体用法?C++ Dsymbol::toCBuffer怎么用?C++ Dsymbol::toCBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dsymbol
的用法示例。
在下文中一共展示了Dsymbol::toCBuffer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toCBuffer
void AnonDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
buf->printf(isunion ? "union" : "struct");
buf->writestring("\n{\n");
if (decl)
{
for (unsigned i = 0; i < decl->dim; i++)
{
Dsymbol *s = (Dsymbol *)decl->data[i];
//buf->writestring(" ");
s->toCBuffer(buf, hgs);
}
}
buf->writestring("}\n");
}
示例2: toCBuffer
void AnonDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
buf->printf(isunion ? "union" : "struct");
buf->writenl();
buf->writestring("{");
buf->writenl();
buf->level++;
if (decl)
{
for (size_t i = 0; i < decl->dim; i++)
{
Dsymbol *s = (*decl)[i];
s->toCBuffer(buf, hgs);
}
}
buf->level--;
buf->writestring("}");
buf->writenl();
}
示例3: gensymfile
void Module::gensymfile()
{
OutBuffer buf;
HdrGenState hgs;
//printf("Module::gensymfile()\n");
buf.printf("// Sym file generated from '%s'", srcfile->toChars());
buf.writenl();
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
s->toCBuffer(&buf, &hgs);
}
// Transfer image to file
symfile->setbuffer(buf.data, buf.offset);
buf.data = NULL;
writeFile(loc, symfile);
}
示例4: toCBuffer
void StructDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
buf->printf("%s ", kind());
if (!isAnonymous())
buf->writestring(toChars());
if (!members)
{
buf->writeByte(';');
buf->writenl();
return;
}
buf->writenl();
buf->writeByte('{');
buf->writenl();
buf->level++;
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
s->toCBuffer(buf, hgs);
}
buf->level--;
buf->writeByte('}');
buf->writenl();
}
示例5: toCBuffer
void ClassDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
if (!isAnonymous())
{
buf->printf("%s ", kind());
buf->writestring(toChars());
if (baseclasses->dim)
buf->writestring(" : ");
}
for (size_t i = 0; i < baseclasses->dim; i++)
{
BaseClass *b = (*baseclasses)[i];
if (i)
buf->writestring(", ");
//buf->writestring(b->base->ident->toChars());
b->type->toCBuffer(buf, NULL, hgs);
}
if (members)
{
buf->writenl();
buf->writeByte('{');
buf->writenl();
buf->level++;
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
s->toCBuffer(buf, hgs);
}
buf->level--;
buf->writestring("}");
}
else
buf->writeByte(';');
buf->writenl();
}