当前位置: 首页>>代码示例>>C++>>正文


C++ const_iterator::firstWordDocBook方法代码示例

本文整理汇总了C++中paragraphlist::const_iterator::firstWordDocBook方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::firstWordDocBook方法的具体用法?C++ const_iterator::firstWordDocBook怎么用?C++ const_iterator::firstWordDocBook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在paragraphlist::const_iterator的用法示例。


在下文中一共展示了const_iterator::firstWordDocBook方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: makeEnvironment

ParagraphList::const_iterator makeEnvironment(
    Buffer const & buf,
    odocstream & os,
    OutputParams const & runparams,
    Text const & text,
    ParagraphList::const_iterator const & pbegin,
    ParagraphList::const_iterator const & pend)
{
    ParagraphList const & paragraphs = text.paragraphs();
    ParagraphList::const_iterator par = pbegin;

    Layout const & defaultstyle = buf.params().documentClass().defaultLayout();
    Layout const & bstyle = par->layout();
    string item_tag;

    // Opening outter tag
    sgml::openTag(buf, os, runparams, *pbegin);
    os << '\n';
    if (bstyle.latextype == LATEX_ENVIRONMENT && bstyle.pass_thru)
        os << "<![CDATA[";

    while (par != pend) {
        Layout const & style = par->layout();
        ParagraphList::const_iterator send;
        string id = par->getID(buf, runparams);
        string wrapper = "";
        pos_type sep = 0;

        // Opening inner tag
        switch (bstyle.latextype) {
        case LATEX_ENVIRONMENT:
            if (!bstyle.innertag().empty()) {
                sgml::openTag(os, bstyle.innertag(), id);
            }
            break;

        case LATEX_ITEM_ENVIRONMENT:
            if (!bstyle.labeltag().empty()) {
                sgml::openTag(os, bstyle.innertag(), id);
                sgml::openTag(os, bstyle.labeltag());
                sep = par->firstWordDocBook(os, runparams) + 1;
                sgml::closeTag(os, bstyle.labeltag());
            }
            wrapper = defaultstyle.latexname();
            // If a sub list (embedded list) appears next with a
            // different depth, then there is no need to open
            // another tag at the current depth.
            if(par->params().depth() == pbegin->params().depth()) {
                sgml::openTag(os, bstyle.itemtag());
            }
            break;
        default:
            break;
        }

        switch (style.latextype) {
        case LATEX_ENVIRONMENT:
        case LATEX_ITEM_ENVIRONMENT: {
            if (par->params().depth() == pbegin->params().depth()) {
                sgml::openTag(os, wrapper);
                par->simpleDocBookOnePar(buf, os, runparams,
                                         text.outerFont(distance(paragraphs.begin(), par)), sep);
                sgml::closeTag(os, wrapper);
                ++par;
            }
            else {
                send = searchEnvironment(par, pend);
                par = makeEnvironment(buf, os, runparams, text, par,send);
            }
            break;
        }
        case LATEX_PARAGRAPH:
            send = searchParagraph(par, pend);
            par = makeParagraph(buf, os, runparams, text, par,send);
            break;
        case LATEX_LIST_ENVIRONMENT:
        case LATEX_BIB_ENVIRONMENT:
        case LATEX_COMMAND:
            // FIXME This means that we are just skipping any paragraph that
            // isn't implemented above, and this includes lists.
            ++par;
            break;
        }

        // Closing inner tag
        switch (bstyle.latextype) {
        case LATEX_ENVIRONMENT:
            if (!bstyle.innertag().empty()) {
                sgml::closeTag(os, bstyle.innertag());
                os << '\n';
            }
            break;
        case LATEX_ITEM_ENVIRONMENT:
            // If a sub list (embedded list) appears next, then
            // there is no need to close the current tag.
            // par should have already been incremented to the next
            // element. So we can compare the depth of the next
            // element with pbegin.
            // We need to be careful, that we don't dereference par
            // when par == pend but at the same time that the
//.........这里部分代码省略.........
开发者ID:315234,项目名称:lyx-retina,代码行数:101,代码来源:output_docbook.cpp


注:本文中的paragraphlist::const_iterator::firstWordDocBook方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。