本文整理汇总了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();
}
示例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());
}
}
示例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;
}
示例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;
}
示例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;
}