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


C++ CStrRef::isNull方法代码示例

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


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

示例1: f_http_build_query

Variant f_http_build_query(CVarRef formdata,
                           CStrRef numeric_prefix /* = null_string */,
                           CStrRef arg_separator /* = null_string */) {
  if (!formdata.is(KindOfArray) && !formdata.is(KindOfObject)) {
    throw_invalid_argument("formdata: (need Array or Object)");
    return false;
  }

  String arg_sep;
  if (arg_separator.isNull()) {
    arg_sep = f_ini_get("arg_separator.output");
  } else {
    arg_sep = arg_separator;
  }

  StringBuffer ret(1024);
  std::set<void*> seen_arrs;
  url_encode_array(ret, formdata, seen_arrs,
                   numeric_prefix, String(), String(), arg_sep);
  return ret.detach();
}
开发者ID:kodypeterson,项目名称:hiphop-php,代码行数:21,代码来源:ext_url.cpp

示例2: f_spl_autoload

void f_spl_autoload(CStrRef class_name,
                    CStrRef file_extensions /* = null_string */) {
  Array ext = file_extensions.isNull()
              ? s_extension_list->extensions
              : StringUtil::Explode(file_extensions, ",").toArray();
  String lClass = StringUtil::ToLower(class_name);
  Globals *variables = hhvm ? nullptr : get_globals();
  bool found = false;
  for (ArrayIter iter(ext); iter; ++iter) {
    String fileName = lClass + iter.second();
    include(fileName, true, variables, "", false);
    if (f_class_exists(class_name, false)) {
      found = true;
      break;
    }
  }

  if (!found && !AutoloadHandler::s_instance->isRunning()) {
    throw_spl_exception("Class %s could not be loaded", class_name.c_str());
  }
}
开发者ID:BauerBox,项目名称:hiphop-php,代码行数:21,代码来源:ext_spl.cpp

示例3: t_writeelement

bool c_XMLWriter::t_writeelement(CStrRef name,
                                 CStrRef content /* = null_string */) {
  INSTANCE_METHOD_INJECTION_BUILTIN(XMLWriter, XMLWriter::writeelement);
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    if (content.isNull()) {
      ret = xmlTextWriterStartElement(m_ptr, (xmlChar*)name.data());
      if (ret == -1) return false;
      ret = xmlTextWriterEndElement(m_ptr);
      if (ret == -1) return false;
    } else {
      ret = xmlTextWriterWriteElement(m_ptr, (xmlChar*)name.data(),
                                      (xmlChar*)content.data());
    }
  }
  return ret != -1;
}
开发者ID:activeingredient,项目名称:hiphop-php,代码行数:21,代码来源:ext_xmlwriter.cpp

示例4: f_hphp_create_continuation

p_Continuation f_hphp_create_continuation(CStrRef clsname,
                                          CStrRef funcname,
                                          CStrRef origFuncName,
                                          CArrRef args /* = null_array */) {
  if (hhvm) {
    throw_fatal("hphp_create_continuation is not supported under hhvm");
  }
  Array definedVariables;
  Object obj;
  Eval::VariableEnvironment *env =
    FrameInjection::GetVariableEnvironment(true);
  if (UNLIKELY(!env)) {
    throw_fatal("Invalid call hphp_create_continuation");
  }
  definedVariables = env->getDefinedVariables();
  obj = FrameInjection::GetThis(true);
  bool isMethod = !clsname.isNull() && !clsname.empty();
  int64 callInfo = f_hphp_get_call_info(clsname, funcname);
  int64 extra = f_hphp_get_call_info_extra(clsname, funcname);
  if (has_eval_support && isMethod &&
      Eval::MethodStatementWrapper::isTraitMethod(
        (const Eval::MethodStatementWrapper *)extra)) {
    extra = f_hphp_get_call_info_extra(FrameInjection::GetClassName(false),
                                       funcname);
  }
  p_GenericContinuation cont(
      ((c_GenericContinuation*)coo_GenericContinuation())->
        create(callInfo, extra, isMethod, origFuncName,
               definedVariables, obj, args));
  if (isMethod) {
    CStrRef cls = f_get_called_class();
    cont->setCalledClass(cls);
  }

  return cont;
}
开发者ID:hashaash,项目名称:hiphop-php,代码行数:36,代码来源:ext_continuation.cpp

示例5: t_writeelementns

bool c_xmlwriter::t_writeelementns(CStrRef prefix, CStrRef name, CStrRef uri,
                                   CStrRef content /* = null_string */) {
  if (xmlValidateName((xmlChar*)name.data(), 0)) {
    raise_warning("invalid element name: %s", name.data());
    return false;
  }
  int ret = -1;
  if (m_ptr) {
    if (content.isNull()) {
      ret = xmlTextWriterStartElementNS(m_ptr, (xmlChar*)prefix.data(),
                                        (xmlChar*)name.data(),
                                        (xmlChar*)uri.data());
      if (ret == -1) return false;
      ret = xmlTextWriterEndElement(m_ptr);
      if (ret == -1) return false;
    } else {
      ret = xmlTextWriterWriteElementNS(m_ptr, (xmlChar*)prefix.data(),
                                        (xmlChar*)name.data(),
                                        (xmlChar*)uri.data(),
                                        (xmlChar*)content.data());
    }
  }
  return ret != -1;
}
开发者ID:scottmac,项目名称:hiphop-dev,代码行数:24,代码来源:ext_xmlwriter.cpp


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