本文整理汇总了C++中TextObject::type方法的典型用法代码示例。如果您正苦于以下问题:C++ TextObject::type方法的具体用法?C++ TextObject::type怎么用?C++ TextObject::type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextObject
的用法示例。
在下文中一共展示了TextObject::type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recursiveSearch
void recursiveSearch( GroupObject* group, ofstream &out )
{
if (!group) return;
for( unsigned i=0; i<group->objectCount(); i++ )
{
Object* object = group->object(i);
if( object->isText() )
{
TextObject* T = static_cast<TextObject*>(object);
if(T)
{
// out << " " << T->typeAsString() << " (" << T->listSize() << "): ";
bool written = false;
for (int j=0; j<T->listSize(); j++)
{
if (T->text(j).cstring().c_str()!=NULL
&& T->text(j).cstring().c_str()[0]!='\0'
&& strncmp(T->text(j).cstring().c_str(),"Click to edit",13)
&& strncmp(T->text(j).cstring().c_str(),"Klikk for å redigere",20))
{
if (!written)
{
if (!textonly)
{
if (T->type()==TextObject::Body || T->type()==TextObject::CenterBody
|| T->type()==TextObject::HalfBody || T->type()==TextObject::QuarterBody)
out << "<p>";
else if (T->type()==TextObject::Title || T->type()==TextObject::CenterTitle)
out << "<h2>";
else out << "<div>";
}
written = true;
}
if (!textonly) out << "<span>";
out << T->text(j).cstring().c_str();
if (!textonly) out << "</span> ";
}
}
if (written && !textonly)
{
if (T->type()==TextObject::Body || T->type()==TextObject::CenterBody
|| T->type()==TextObject::HalfBody || T->type()==TextObject::QuarterBody)
out << "</p>";
else if (T->type()==TextObject::Title || T->type()==TextObject::CenterTitle)
out << "</h2>";
else out << "</div>";
out << endl;
}
else
out << endl;
}
}
if( object->isGroup() )
recursiveSearch( static_cast<GroupObject*>(object), out );
}
}