本文整理汇总了C++中raise_notice函数的典型用法代码示例。如果您正苦于以下问题:C++ raise_notice函数的具体用法?C++ raise_notice怎么用?C++ raise_notice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了raise_notice函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
String Variant::toStringHelper() const {
switch (m_type) {
case KindOfUninit:
case KindOfNull:
return empty_string();
case KindOfBoolean:
return m_data.num ? static_cast<String>(s_1)
: empty_string();
case KindOfInt64:
return m_data.num;
case KindOfDouble:
return m_data.dbl;
case KindOfStaticString:
case KindOfString:
assert(false); // Should be done in caller
return m_data.pstr;
case KindOfArray:
raise_notice("Array to string conversion");
return array_string;
case KindOfObject:
return m_data.pobj->invokeToString();
case KindOfResource:
return m_data.pres->o_toString();
case KindOfRef:
return m_data.pref->var()->toString();
case KindOfClass:
break;
}
not_reached();
}
示例2: str_replace
static Variant str_replace(CVarRef search, CVarRef replace, CStrRef subject,
int &count, bool caseSensitive) {
if (search.is(KindOfArray)) {
String ret = subject;
Array searchArr = search.toArray();
if (replace.is(KindOfArray)) {
Array replArr = replace.toArray();
ArrayIter replIter(replArr);
for (ArrayIter iter(searchArr); iter; ++iter) {
TAINT_OBSERVER(TAINT_BIT_MUTATED, TAINT_BIT_NONE);
if (replIter) {
ret = ret.replace(iter.second().toString(),
replIter.second().toString(),
count, caseSensitive);
++replIter;
} else {
ret = ret.replace(iter.second().toString(),
"", count, caseSensitive);
}
}
return ret;
}
TAINT_OBSERVER(TAINT_BIT_MUTATED, TAINT_BIT_NONE);
String repl = replace.toString();
for (ArrayIter iter(searchArr); iter; ++iter) {
ret = ret.replace(iter.second().toString(), repl, count, caseSensitive);
}
return ret;
}
if (replace.is(KindOfArray)) {
raise_notice("Array to string conversion");
}
TAINT_OBSERVER(TAINT_BIT_MUTATED, TAINT_BIT_NONE);
return subject.replace(search.toString(), replace.toString(), count,
caseSensitive);
}
示例3: create_new_conn
bool MySQL::connect(const String& host, int port, const String& socket,
const String& username, const String& password,
const String& database, int client_flags,
int connect_timeout) {
if (m_conn == nullptr) {
m_conn = create_new_conn();
}
if (connect_timeout >= 0) {
MySQLUtil::set_mysql_timeout(m_conn, MySQLUtil::ConnectTimeout,
connect_timeout);
}
if (RuntimeOption::EnableStats && RuntimeOption::EnableSQLStats) {
ServerStats::Log("sql.conn", 1);
}
IOStatusHelper io("mysql::connect", host.data(), port);
m_xaction_count = 0;
if (m_host.empty()) m_host = static_cast<std::string>(host);
if (m_username.empty()) m_username = static_cast<std::string>(username);
if (m_password.empty()) m_password = static_cast<std::string>(password);
if (m_socket.empty()) m_socket = static_cast<std::string>(socket);
if (m_database.empty()) m_database = static_cast<std::string>(database);
if (!m_port) m_port = port;
bool ret = mysql_real_connect(m_conn, host.data(), username.data(),
password.data(),
(database.empty() ? nullptr : database.data()),
port,
socket.empty() ? nullptr : socket.data(),
client_flags);
if (ret && mysqlExtension::WaitTimeout > 0) {
String query("set session wait_timeout=");
query += String((int64_t)(mysqlExtension::WaitTimeout / 1000));
if (mysql_real_query(m_conn, query.data(), query.size())) {
raise_notice("MySQL::connect: failed setting session wait timeout: %s",
mysql_error(m_conn));
}
}
m_state = (ret) ? MySQLState::CONNECTED : MySQLState::CLOSED;
return ret;
}
示例4: HHVM_FUNCTION
XDEBUG_NOTIMPLEMENTED
static void HHVM_FUNCTION(xdebug_start_code_coverage,
int64_t options /* = 0 */) {
// XDEBUG_CC_UNUSED and XDEBUG_CC_DEAD_CODE not supported right now primarily
// because the internal CodeCoverage class does support either unexecuted line
// tracking or dead code analysis
if (options != 0) {
raise_error("XDEBUG_CC_UNUSED and XDEBUG_CC_DEAD_CODE constants are not "
"currently supported.");
return;
}
// If we get here, turn on coverage
auto ti = ThreadInfo::s_threadInfo.getNoCheck();
ti->m_reqInjectionData.setCoverage(true);
if (g_context->isNested()) {
raise_notice("Calling xdebug_start_code_coverage from a nested VM instance "
"may cause unpredicable results");
}
throw VMSwitchModeBuiltin();
}
示例5: tvCastToStringInPlace
void tvCastToStringInPlace(TypedValue* tv) {
assert(tvIsPlausible(*tv));
tvUnboxIfNeeded(tv);
StringData * s;
switch (tv->m_type) {
case KindOfUninit:
case KindOfNull: s = staticEmptyString(); goto static_string;
case KindOfBoolean:
s = tv->m_data.num ? s_1.get() : staticEmptyString();
goto static_string;
case KindOfInt64: s = buildStringData(tv->m_data.num); break;
case KindOfDouble: s = buildStringData(tv->m_data.dbl); break;
case KindOfStaticString:
case KindOfString: return;
case KindOfArray:
raise_notice("Array to string conversion");
s = array_string.get();
tvDecRefArr(tv);
goto static_string;
case KindOfObject:
// For objects, we fall back on the Variant machinery
tvAsVariant(tv) = tv->m_data.pobj->invokeToString();
return;
case KindOfResource:
// For resources, we fall back on the Variant machinery
tvAsVariant(tv) = tv->m_data.pres->o_toString();
return;
default:
not_reached();
}
s->incRefCount();
tv->m_data.pstr = s;
tv->m_type = KindOfString;
return;
static_string:
tv->m_data.pstr = s;
tv->m_type = KindOfStaticString;
}
示例6: HHVM_METHOD
Variant HHVM_METHOD(XMLReader, expand,
const Variant& basenode /* = null */) {
auto* data = Native::data<XMLReader>(this_);
Object doc;
xmlDocPtr docp = nullptr;
SYNC_VM_REGS_SCOPED();
if (!basenode.isNull()) {
DOMNode *dombasenode = toDOMNode(basenode.toObject().get());
doc = dombasenode->doc();
docp = (xmlDocPtr) toDOMNode(doc.get())->m_node;
if (docp == nullptr) {
raise_warning("Invalid State Error");
return false;
}
} else {
doc = DOMDocument::newInstance();
}
if (data->m_ptr) {
xmlNodePtr node = xmlTextReaderExpand(data->m_ptr);
if (node == nullptr) {
raise_warning("An Error Occurred while expanding");
return false;
} else {
xmlNodePtr nodec = xmlDocCopyNode(node, docp, 1);
if (nodec == nullptr) {
raise_notice("Cannot expand this node type");
return false;
} else {
return php_dom_create_object(nodec, doc, false);
}
}
}
raise_warning("Load Data before trying to read");
return false;
}
示例7: IsValid
bool TimeZone::SetCurrent(const char* name) {
bool valid;
auto const it = s_tzvCache->find(name);
if (it != s_tzvCache->end()) {
valid = it->second;
} else {
valid = IsValid(name);
auto key = strdup(name);
auto result = s_tzvCache->insert(TimeZoneValidityCacheEntry(key, valid));
if (!result.second) {
// The cache is full or a collision occurred, and we don't need our
// strdup'ed key.
free(key);
}
}
if (!valid) {
raise_notice("Timezone ID '%s' is invalid", name);
return false;
}
RID().setTimeZone(name);
return true;
}
示例8: warn_non_object
static Variant warn_non_object() {
raise_notice("Cannot access property on non-object");
return uninit_null();
}
示例9: raise_hackarr_compat_notice
void raise_hackarr_compat_notice(const std::string& msg) {
if (UNLIKELY(RID().getSuppressHackArrayCompatNotices())) return;
raise_notice("Hack Array Compat: %s", msg.c_str());
}
示例10: raise_intish_index_cast
void raise_intish_index_cast() {
if (UNLIKELY(RID().getSuppressHackArrayCompatNotices())) return;
raise_notice("Hack Array Compat: Intish index cast");
}
示例11: collator_is_numeric
static DataType collator_is_numeric(UChar *str, int length, int64_t *lval,
double *dval, int allow_errors ) {
int64_t local_lval;
double local_dval;
UChar *end_ptr_long, *end_ptr_double;
int conv_base=10;
if (!length) {
return KindOfNull;
}
/* handle hex numbers */
if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
conv_base=16;
}
errno=0;
local_lval = collator_u_strtol(str, &end_ptr_long, conv_base);
if (errno != ERANGE) {
if (end_ptr_long == str+length) { /* integer string */
if (lval) {
*lval = local_lval;
}
return KindOfInt64;
} else if (end_ptr_long == str &&
*end_ptr_long != '\0' &&
*str != '.' &&
*str != '-') { /* ignore partial string matches */
return KindOfNull;
}
} else {
end_ptr_long = nullptr;
}
if (conv_base == 16) { /* hex string, under UNIX strtod() messes it up */
/* UTODO: keep compatibility with is_numeric_string() here? */
return KindOfNull;
}
local_dval = collator_u_strtod(str, &end_ptr_double);
if (local_dval == 0 && end_ptr_double == str) {
end_ptr_double = nullptr;
} else {
if (end_ptr_double == str+length) { /* floating point string */
if (!finite(local_dval)) {
/* "inf","nan" and maybe other weird ones */
return KindOfNull;
}
if (dval) {
*dval = local_dval;
}
return KindOfDouble;
}
}
if (!allow_errors) {
return KindOfNull;
}
if (allow_errors == -1) {
raise_notice("A non well formed numeric value encountered");
}
if (allow_errors) {
if (end_ptr_double > end_ptr_long && dval) {
*dval = local_dval;
return KindOfDouble;
} else if (end_ptr_long && lval) {
*lval = local_lval;
return KindOfInt64;
}
}
return KindOfNull;
}
示例12: arrayGetNotFound
NEVER_INLINE
TypedValue arrayGetNotFound(const StringData* k) {
raise_notice("Undefined index: %s", k->data());
return make_tv<KindOfNull>();
}
示例13: raiseArrayIndexNotice
void raiseArrayIndexNotice(const int64_t index) {
raise_notice("Undefined index: %" PRId64, index);
}
示例14: raise_notice
TypedValue* ArrayData::nvGetNotFound(const StringData* k) {
raise_notice("Undefined index: %s", k->data());
return (TypedValue*)&init_null_variant;
}
示例15: raise_notice
CVarRef ArrayData::getNotFound(int64 k) {
raise_notice("Undefined index: %lld", k);
return null_variant;
}