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


C++ value::get_quickbook方法代码示例

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


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

示例1: pre

    std::string pre(quickbook::state& state, parse_iterator pos,
            value include_doc_id, bool nested_file)
    {
        // The doc_info in the file has been parsed. Here's what we'll do
        // *before* anything else.
        //
        // If there isn't a doc info block, then values will be empty, so most
        // of the following code won't actually do anything.

        value_consumer values = state.values.release();

        // Skip over invalid attributes

        while (values.check(value::default_tag)) values.consume();

        bool use_doc_info = false;
        std::string doc_type;
        value doc_title;

        if (values.check(doc_info_tags::type))
        {
            doc_type = detail::to_s(values.consume(doc_info_tags::type).get_quickbook());
            doc_title = values.consume(doc_info_tags::title);
            use_doc_info = !nested_file || qbk_version_n >= 106u;
        }
        else
        {
            if (!nested_file)
            {
                detail::outerr(state.current_file, pos.base())
                    << "No doc_info block."
                    << std::endl;

                ++state.error_count;

                // Create a fake document info block in order to continue.
                doc_type = "article";
                doc_title = qbk_value(state.current_file,
                    pos.base(), pos.base(),
                    doc_info_tags::type);
                use_doc_info = true;
            }
        }

        std::vector<std::string> duplicates;

        std::vector<value> escaped_attributes = consume_multiple_values(values, doc_info_tags::escaped_attribute);

        value qbk_version = consume_list(values, doc_attributes::qbk_version, &duplicates);
        value compatibility_mode = consume_list(values, doc_attributes::compatibility_mode, &duplicates);
        consume_multiple_values(values, doc_attributes::source_mode);

        value id = consume_value_in_list(values, doc_info_attributes::id, &duplicates);
        value dirname = consume_value_in_list(values, doc_info_attributes::dirname, &duplicates);
        value last_revision = consume_value_in_list(values, doc_info_attributes::last_revision, &duplicates);
        value purpose = consume_value_in_list(values, doc_info_attributes::purpose, &duplicates);
        std::vector<value> categories = consume_multiple_values(values, doc_info_attributes::category);
        value lang = consume_value_in_list(values, doc_info_attributes::lang, &duplicates);
        value version = consume_value_in_list(values, doc_info_attributes::version, &duplicates);
        std::vector<value> authors = consume_multiple_values(values, doc_info_attributes::authors);
        std::vector<value> copyrights = consume_multiple_values(values, doc_info_attributes::copyright);
        value license = consume_value_in_list(values, doc_info_attributes::license, &duplicates);
        std::vector<value> biblioids = consume_multiple_values(values, doc_info_attributes::biblioid);
        value xmlbase = consume_value_in_list(values, doc_info_attributes::xmlbase, &duplicates);

        values.finish();

        if(!duplicates.empty())
        {
            detail::outwarn(state.current_file->path)
                << (duplicates.size() > 1 ?
                    "Duplicate attributes" : "Duplicate attribute")
                << ":" << boost::algorithm::join(duplicates, ", ")
                << "\n"
                ;
        }

        std::string include_doc_id_, id_;

        if (!include_doc_id.empty())
            include_doc_id_ = detail::to_s(include_doc_id.get_quickbook());
        if (!id.empty())
            id_ = detail::to_s(id.get_quickbook());

        // Quickbook version

        unsigned new_version = get_version(state, use_doc_info, qbk_version);

        if (new_version != qbk_version_n)
        {
            if (new_version >= 107u)
            {
                detail::outwarn(state.current_file->path)
                    << "Quickbook " << (new_version / 100) << "." << (new_version % 100)
                    << " is still under development and is "
                    "likely to change in the future." << std::endl;
            }
        }

        if (new_version) {
//.........这里部分代码省略.........
开发者ID:AlexMioMio,项目名称:boost,代码行数:101,代码来源:doc_info_actions.cpp


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