本文整理汇总了C++中CREATE_VECTOR2函数的典型用法代码示例。如果您正苦于以下问题:C++ CREATE_VECTOR2函数的具体用法?C++ CREATE_VECTOR2怎么用?C++ CREATE_VECTOR2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CREATE_VECTOR2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: f_fopen
bool TestExtFile::test_vfprintf() {
Variant f = f_fopen("test/test_ext_file.tmp", "w");
f_vfprintf(f, "%s %s", CREATE_VECTOR2("testing", "vfprintf"));
f_fclose(f);
f = f_fopen("test/test_ext_file.tmp", "r");
VF(f, "testing vfprintf");
return Count(true);
}
示例2: CREATE_VECTOR4
bool TestExtPreg::test_preg_grep() {
Array array = CREATE_VECTOR4("foo 123.1", "fg 24bar", "123.1", "24");
Array fl_array = f_preg_grep("/^(\\d+)?\\.\\d+$/", array);
VS(fl_array.size(), 1);
VS(fl_array[2], "123.1");
VS(f_preg_grep("/a/", CREATE_VECTOR2("c", "b")), Array::Create());
return Count(true);
}
示例3: f_ob_start
bool TestExtOutput::test_ob_list_handlers() {
f_ob_start();
f_ob_start("test");
Array handlers = f_ob_list_handlers();
f_ob_end_clean();
f_ob_end_clean();
VS(handlers, CREATE_VECTOR2(null, "test"));
return Count(true);
}
示例4: assert
void AsioSession::onSetResultToRefCreate(c_SetResultToRefWaitHandle* wait_handle, CObjRef child) {
assert(m_onSetResultToRefCreateCallback.get());
try {
vm_call_user_func(
m_onSetResultToRefCreateCallback,
CREATE_VECTOR2(wait_handle, child));
} catch (const Object& callback_exception) {
raise_warning("[asio] Ignoring exception thrown by SetResultToRefWaitHandle::onCreate callback");
}
}
示例5: fb_cs_test
bool TestExtFb::test_fb_compact_serialize() {
fb_cs_test(null);
fb_cs_test(true);
fb_cs_test(false);
fb_cs_test(1234.5678);
fb_cs_test("");
fb_cs_test("a");
fb_cs_test("\0");
fb_cs_test("\0 a");
fb_cs_test("0123012301230123");
fb_cs_test("0123012301230123a");
fb_cs_test("012301230123012");
fb_cs_test(Array());
fb_cs_test(CREATE_VECTOR1(12345));
fb_cs_test(CREATE_VECTOR3(12345,"abc",0.1234));
fb_cs_test(CREATE_MAP1(1, 12345));
fb_cs_test(CREATE_MAP3(1, 12345, "a", 123124, "sdf", 0.1234));
fb_cs_test(CREATE_VECTOR1(CREATE_VECTOR1("a")));
fb_cs_test(CREATE_VECTOR2(1, CREATE_VECTOR1("a")));
fb_cs_test(CREATE_VECTOR2(CREATE_VECTOR1("a"), 1));
fb_cs_test(CREATE_VECTOR2(CREATE_VECTOR1("a"), CREATE_VECTOR1(1)));
// Test skips
fb_cs_test(CREATE_MAP3(0, "a", 1, "b", 3, "c"));
fb_cs_test(CREATE_MAP3(1, "a", 2, "b", 3, "c"));
fb_cs_test(CREATE_MAP3(0, "a", 2, "b", 3, "c"));
fb_cs_test(CREATE_MAP1(3, "a"));
// Test for overflow
fb_cs_test(CREATE_MAP1((int64)((1ULL << 63) - 1), "a"));
// Test each power of two, +/- 1 and the negatives of them
// Test a single number and packed inside an array
for (int i = 0; i < 64; ++i) {
int64 n = (1ULL << i);
fb_cs_test(n); fb_cs_test(CREATE_VECTOR1(n));
fb_cs_test(n-1); fb_cs_test(CREATE_VECTOR1(n-1));
fb_cs_test(n+1); fb_cs_test(CREATE_VECTOR1(n+1));
fb_cs_test(-n); fb_cs_test(CREATE_VECTOR1(-n));
fb_cs_test(-n-1); fb_cs_test(CREATE_VECTOR1(-n-1));
fb_cs_test(-n+1); fb_cs_test(CREATE_VECTOR1(-n+1));
}
return Count(true);
}
示例6: getMethodStatement
Variant EvalObjectData::t___set(Variant v_name, Variant v_value) {
const MethodStatement *ms = getMethodStatement("__set");
if (ms) {
return ms->invokeInstance(Object(root),
CREATE_VECTOR2(v_name, withRefBind(v_value)),
false);
} else {
return DynamicObjectData::t___set(v_name, withRefBind(v_value));
}
}
示例7: CREATE_VECTOR2
bool TestExtFile::test_fputcsv() {
Array fields = CREATE_VECTOR2("apple", "\"banana\"");
Variant f = f_fopen("test/test_ext_file.tmp", "w");
f_fputcsv(f, fields);
f_fclose(f);
f = f_fopen("test/test_ext_file.tmp", "r");
VF(f, "apple,\"\"\"banana\"\"\"\n");
return Count(true);
}
示例8: VS
bool TestExtIconv::test_iconv_mime_decode_headers() {
VS(f_iconv_mime_decode_headers
("Subject: =?UTF-8?B?UHLDnGZ1bmcgUHLDnGZ1bmc=?=\n"
"Subject: =?UTF-8?B?UHLDnGZ1bmcgUHLDnGZ1bmc=?=\n",
0, "ISO-8859-1"),
CREATE_MAP1("Subject", CREATE_VECTOR2("Pr\xDC""fung Pr\xDC""fung",
"Pr\xDC""fung Pr\xDC""fung")));
return Count(true);
}
示例9: ASSERT
bool BaseExecutionContext::obFlush() {
ASSERT(m_protectedLevel >= 0);
if ((int)m_buffers.size() > m_protectedLevel) {
std::list<OutputBuffer*>::const_iterator iter = m_buffers.end();
OutputBuffer *last = *(--iter);
const int flag = PHP_OUTPUT_HANDLER_START | PHP_OUTPUT_HANDLER_END;
if (iter != m_buffers.begin()) {
OutputBuffer *prev = *(--iter);
if (last->handler.isNull()) {
prev->oss.absorb(last->oss);
} else {
try {
Variant tout =
f_call_user_func_array(last->handler,
CREATE_VECTOR2(last->oss.detach(), flag));
prev->oss.append(tout.toString());
last->oss.reset();
} catch (...) {
prev->oss.absorb(last->oss);
}
}
return true;
}
if (!last->handler.isNull()) {
try {
Variant tout =
f_call_user_func_array(last->handler,
CREATE_VECTOR2(last->oss.detach(), flag));
String sout = tout.toString();
writeStdout(sout.data(), sout.size());
last->oss.reset();
return true;
} catch (...) {}
}
writeStdout(last->oss.data(), last->oss.size());
last->oss.reset();
return true;
}
return false;
}
示例10: f_mb_regex_encoding
bool TestExtMb::test_mb_ereg_search_pos() {
String str = "Pr\xC3\x9C\xC3\x9D""fung abc p\xC3\x9C";
String reg = "\\w+";
f_mb_regex_encoding("UTF-8");
f_mb_ereg_search_init(str, reg);
Variant r = f_mb_ereg_search();
r = f_mb_ereg_search_getregs(); // get first result
VS(r, CREATE_VECTOR1("Pr\xC3\x9C\xC3\x9D""fung"));
VS(f_mb_ereg_search_pos(), CREATE_VECTOR2(11, 3));
return Count(true);
}
示例11: VS
bool TestExtString::test_str_replace() {
{
VS(f_str_replace("%body%", "black", "<body text='%body%'>"),
"<body text='black'>");
}
{
Array vowels;
vowels.append("a");
vowels.append("e");
vowels.append("i");
vowels.append("o");
vowels.append("u");
vowels.append("A");
vowels.append("E");
vowels.append("I");
vowels.append("O");
vowels.append("U");
VS(f_str_replace(vowels, "", "Hello World of PHP"), "Hll Wrld f PHP");
}
{
String phrase = "You should eat fruits, vegetables, and fiber every day.";
Array healthy = CREATE_VECTOR3("fruits", "vegetables", "fiber");
Array yummy = CREATE_VECTOR3("pizza", "beer", "ice cream");
VS(f_str_replace(healthy, yummy, phrase),
"You should eat pizza, beer, and ice cream every day.");
}
{
Variant count;
Variant str = f_str_replace("ll", "", "good golly miss molly!",
ref(count));
VS(count, 2);
}
{
Array letters = CREATE_VECTOR2("a", "p");
Array fruit = CREATE_VECTOR2("apple", "pear");
String text = "a p";
VS(f_str_replace(letters, fruit, text), "apearpearle pear");
}
return Count(true);
}
示例12: objOffsetSet
void objOffsetSet(TypedValue* base, CVarRef offset, TypedValue* val,
bool validate /* = true */) {
if (validate) {
objArrayAccess(base);
}
static StringData* sd__offsetSet = StringData::GetStaticString("offsetSet");
ObjectData* obj = base->m_data.pobj;
if (LIKELY(obj->isInstance())) {
Instance* instance = static_cast<Instance*>(obj);
const Func* method = instance->methodNamed(sd__offsetSet);
ASSERT(method != NULL);
TypedValue tvResult;
tvWriteUninit(&tvResult);
instance->invokeUserMethod(&tvResult, method,
CREATE_VECTOR2(offset, tvAsCVarRef(val)));
tvRefcountedDecRef(&tvResult);
} else {
tvAsVariant(base).getArrayAccess()
->o_invoke(sd__offsetSet, CREATE_VECTOR2(offset, tvAsCVarRef(val)));
}
}
示例13: getMethodStatement
Variant EvalObjectData::t___set(Variant v_name, Variant v_value) {
if (v_value.isReferenced()) {
v_value.setContagious();
}
const MethodStatement *ms = getMethodStatement("__set");
if (ms) {
return ms->invokeInstance(Object(root), CREATE_VECTOR2(v_name, v_value),
false);
} else {
return DynamicObjectData::t___set(v_name, v_value);
}
}
示例14: f_mb_convert_variables
bool TestExtMb::test_mb_convert_variables() {
Variant str = "Pr\xC3\x9C""fung";
Variant str1 = "Pr\xC3\x9C""fung";
Variant str2 = "Pr\xC3\x9C""fung";
Variant inputenc = f_mb_convert_variables(5, "ISO-8859-1", "UTF-8", ref(str),
CREATE_VECTOR2(ref(str1),
ref(str2)));
VS(str, "Pr\xDC""fung");
VS(str1, "Pr\xDC""fung");
VS(str2, "Pr\xDC""fung");
return Count(true);
}
示例15: f_exec
bool TestExtProcess::test_exec() {
Variant output, ret;
String last_line = f_exec("echo hello; echo world;", ref(output), ref(ret));
VS(output, CREATE_VECTOR2("hello", "world"));
VS(last_line, "world");
VS(ret, 0);
string cur_cwd = Process::GetCurrentDirectory();
f_chdir("/tmp/");
VS(f_exec("/bin/pwd"), "/tmp");
f_chdir(String(cur_cwd));
return Count(true);
}