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


C++ Value::is_member方法代码示例

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


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

示例1: create_anyof_validator

    ValidatorJsonSPtr create_anyof_validator(const json::Value& value) {
        if (value["anyof"].is_array() && value.is_member("type")) {
            const auto type = value["type"].as_string();
            if ("string" == type) {
                return create_anyof_string(value);
            }

            if ("int" == type) {
                return create_anyof_int(value);
            }
        }
        return nullptr;
    }
开发者ID:iamyaw,项目名称:IntelRackScaleArchitecture,代码行数:13,代码来源:schema_reader.cpp

示例2: read_configuration

void Port::read_configuration(const json::Value& port_configuration) {
    try {
        log_debug(GET_LOGGER("module"), "Reading ports configuration.");
        set_id(port_configuration["id"].as_uint());

        if (port_configuration.is_member("link_state")) {
            set_link_state(m_state_string_to_enum(
                           port_configuration["link_state"].as_string()));
        }

        // Optional parameters
        if (port_configuration.is_member("ethmod")) {
            set_iface_mode(port_configuration["ethmod"].as_string());
        }
        else {
            set_iface_mode("default");
        }

        if (port_configuration.is_member("type")) {
            set_type(port_configuration["type"].as_string());
        }

        if (port_configuration.is_member("autoneg")) {
            set_autoneg_mode(port_configuration["autoneg"].as_string());
        }
        else {
            set_autoneg_mode("default");
        }
     }
    catch (const json::Value::Exception& e) {
        log_warning(GET_LOGGER("module"), "Invalid/missing submodule configuration member: "
                  << e.what());
    }
    catch (...) {
        log_alert(GET_LOGGER("module"), "Unknown error in submodule section");
    }
}
开发者ID:iamyaw,项目名称:intelRSD,代码行数:37,代码来源:port.cpp

示例3: is_validator_object

 bool is_validator_object(const json::Value& value) {
      return value.is_object() && value.is_member("validator") &&
          (value.is_member("max") ||
           value.is_member("min") ||
           value.is_member("type") ||
           value.is_member("addrV") ||
           value.is_member("url") ||
           value.is_member("anyof"));
 }
开发者ID:iamyaw,项目名称:IntelRackScaleArchitecture,代码行数:9,代码来源:schema_reader.cpp


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