本文整理汇总了C++中MathCell::ListToXML方法的典型用法代码示例。如果您正苦于以下问题:C++ MathCell::ListToXML方法的具体用法?C++ MathCell::ListToXML怎么用?C++ MathCell::ListToXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MathCell
的用法示例。
在下文中一共展示了MathCell::ListToXML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToXML
wxString IntCell::ToXML()
{
MathCell* tmp = m_base;
wxString base = _T("<r>") + tmp->ListToXML() + _T("</r>");
tmp = m_var;
wxString var = ( tmp == NULL )? wxEmptyString : _T("<r>");
var += tmp->ListToXML();
var += ( var == wxEmptyString )? wxEmptyString : _T("</r>");
tmp = m_under;
wxString from = _T("<r>") + tmp->ListToXML() + _T("</r>");
tmp = m_over;
wxString to = _T("<r>") + tmp->ListToXML() + _T("</r>");
if (m_intStyle == INT_DEF)
return wxT("<in>") + from + to + base + var + wxT("</in>");
else
return wxT("<in def=\"false\">") + base + var + wxT("</in>");
}
示例2: ToXML
wxString GroupCell::ToXML()
{
wxString str;
str = wxT("\n<cell"); // start opening tag
// write "type" according to m_groupType
switch (m_groupType) {
case GC_TYPE_CODE:
str += wxT(" type=\"code\"");
break;
case GC_TYPE_IMAGE:
str += wxT(" type=\"image\"");
break;
case GC_TYPE_TEXT:
str += wxT(" type=\"text\"");
break;
case GC_TYPE_TITLE:
str += wxT(" type=\"title\" sectioning_level=\"1\"");
break;
case GC_TYPE_SECTION:
str += wxT(" type=\"section\" sectioning_level=\"2\"");
break;
case GC_TYPE_SUBSECTION:
str += wxT(" type=\"subsection\" sectioning_level=\"3\"");
break;
case GC_TYPE_SUBSUBSECTION:
// We save subsubsections as subsections with a higher sectioning level:
// This makes them backwards-compatible in the way that they are displayed
// as subsections on old wxMaxima installations.
str += wxT(" type=\"subsection\" sectioning_level=\"4\"");
break;
case GC_TYPE_PAGEBREAK:
{
str += wxT(" type=\"pagebreak\"/>");
return str;
}
break;
default:
str += wxT(" type=\"unknown\"");
break;
}
// write hidden status
if (m_hide)
str += wxT(" hide=\"true\"");
str += wxT(">\n");
MathCell *input = GetInput();
MathCell *output = GetLabel();
// write contents
switch (m_groupType) {
case GC_TYPE_CODE:
if (input != NULL) {
str += wxT("<input>\n");
str += input->ListToXML();
str += wxT("</input>");
}
if (output != NULL) {
str += wxT("\n<output>\n");
str += wxT("<mth>");
str += output->ListToXML();
str += wxT("\n</mth></output>");
}
break;
case GC_TYPE_IMAGE:
if (input != NULL)
str += input->ListToXML();
if (output != NULL)
str += output->ListToXML();
break;
case GC_TYPE_TEXT:
if (input)
str += input->ListToXML();
break;
case GC_TYPE_TITLE:
case GC_TYPE_SECTION:
case GC_TYPE_SUBSECTION:
case GC_TYPE_SUBSUBSECTION:
if (input)
str += input->ListToXML();
if (m_hiddenTree) {
str += wxT("<fold>");
str+= m_hiddenTree->ListToXML();
str += wxT("</fold>");
}
break;
default:
{
MathCell *tmp = output;
while (tmp != NULL) {
str += tmp->ListToXML();
tmp = tmp->m_next;
}
break;
}
}
str += wxT("\n</cell>\n");
return str;
}