本文整理汇总了C++中CREATE_VECTOR2函数的典型用法代码示例。如果您正苦于以下问题:C++ CREATE_VECTOR2函数的具体用法?C++ CREATE_VECTOR2怎么用?C++ CREATE_VECTOR2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CREATE_VECTOR2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:JustProgrammer,项目名称:hiphop-php,代码行数:9,代码来源:test_ext_file.cpp
示例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);
}
开发者ID:ArPharazon,项目名称:hiphop-php,代码行数:9,代码来源:test_ext_preg.cpp
示例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);
}
开发者ID:F4m3uS,项目名称:hiphop-php,代码行数:9,代码来源:test_ext_output.cpp
示例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");
}
}
开发者ID:orakle,项目名称:hiphop-php,代码行数:10,代码来源:asio_session.cpp
示例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);
}
开发者ID:Sydney-o9,项目名称:hiphop-php,代码行数:43,代码来源:test_ext_fb.cpp
示例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));
}
}
开发者ID:neurodrone,项目名称:hiphop-php,代码行数:10,代码来源:eval_object_data.cpp
示例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);
}
开发者ID:JustProgrammer,项目名称:hiphop-php,代码行数:10,代码来源:test_ext_file.cpp
示例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);
}
开发者ID:bastiaanzapf,项目名称:hiphop-php,代码行数:10,代码来源:test_ext_iconv.cpp
示例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;
}
开发者ID:Bathrisyah,项目名称:hiphop-php,代码行数:42,代码来源:execution_context.cpp
示例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);
}
开发者ID:wanghong1987,项目名称:hiphop-php,代码行数:11,代码来源:test_ext_mb.cpp
示例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);
}
开发者ID:BauerBox,项目名称:hiphop-php,代码行数:41,代码来源:test_ext_string.cpp
示例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)));
}
}
开发者ID:hashaash,项目名称:hiphop-php,代码行数:21,代码来源:member_operations.cpp
示例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);
}
}
开发者ID:jahankhanna,项目名称:hiphop-php,代码行数:12,代码来源:eval_object_data.cpp
示例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);
}
开发者ID:wanghong1987,项目名称:hiphop-php,代码行数:12,代码来源:test_ext_mb.cpp
示例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);
}
开发者ID:wanghong1987,项目名称:hiphop-php,代码行数:13,代码来源:test_ext_process.cpp
示例16: s_command
bool TestExtProcess::test_proc_get_status() {
static const StaticString
s_command("command"),
s_pid("pid"),
s_running("running"),
s_signaled("signaled"),
s_exitcode("exitcode"),
s_termsig("termsig"),
s_stopsig("stopsig");
Array descriptorspec =
CREATE_MAP3(0, CREATE_VECTOR2("pipe", "r"),
1, CREATE_VECTOR2("pipe", "w"),
2, CREATE_VECTOR3("file", "/tmp/error-output.txt", "a"));
Variant pipes;
Variant process = f_proc_open(php_path, descriptorspec, ref(pipes));
VERIFY(!same(process, false));
Array ret = f_proc_get_status(process.toObject());
VS(ret[s_command], php_path);
VERIFY(ret[s_pid].toInt32() > 0);
VERIFY(ret[s_running]);
VERIFY(!ret[s_signaled]);
VS(ret[s_exitcode], -1);
VS(ret[s_termsig], 0);
VS(ret[s_stopsig], 0);
{
File *f = pipes[0].toObject().getTyped<File>();
VERIFY(f->valid());
f->close();
}
{
File *f = pipes[1].toObject().getTyped<File>();
VERIFY(f->valid());
f->close();
}
VS(f_proc_close(process.toObject()), 0);
return Count(true);
}
开发者ID:wanghong1987,项目名称:hiphop-php,代码行数:39,代码来源:test_ext_process.cpp
示例17: VS
bool TestExtJson::test_json_encode() {
VS(f_json_encode(CREATE_MAP3("a", 1, "b", 2.3, 3, "test")),
"{\"a\":1,\"b\":2.3,\"3\":\"test\"}");
VS(f_json_encode(CREATE_VECTOR5("a", 1, true, false, uninit_null())),
"[\"a\",1,true,false,null]");
VS(f_json_encode("a\xE0"), "null");
VS(f_json_encode("a\xE0", k_JSON_FB_LOOSE), "\"a?\"");
VS(f_json_encode(CREATE_MAP2("0", "apple", "1", "banana")),
"[\"apple\",\"banana\"]");
VS(f_json_encode(CREATE_VECTOR1(CREATE_MAP1("a", "apple"))),
"[{\"a\":\"apple\"}]");
VS(f_json_encode(CREATE_VECTOR1(CREATE_MAP1("a", "apple")),
k_JSON_PRETTY_PRINT),
"[\n {\n \"a\": \"apple\"\n }\n]");
VS(f_json_encode(CREATE_VECTOR4(1, 2, 3, CREATE_VECTOR3(1, 2, 3)),
k_JSON_PRETTY_PRINT),
"[\n"
" 1,\n"
" 2,\n"
" 3,\n"
" [\n"
" 1,\n"
" 2,\n"
" 3\n"
" ]\n"
"]");
Array arr = CREATE_MAP3(
"a", 1,
"b", CREATE_VECTOR2(1, 2),
"c", CREATE_MAP1("d", 42)
);
VS(f_json_encode(arr, k_JSON_PRETTY_PRINT),
"{\n"
" \"a\": 1,\n"
" \"b\": [\n"
" 1,\n"
" 2\n"
" ],\n"
" \"c\": {\n"
" \"d\": 42\n"
" }\n"
"}");
return Count(true);
}
开发者ID:bibitutanh,项目名称:hiphop-php,代码行数:51,代码来源:test_ext_json.cpp
示例18: VS
bool TestExtMath::test_max() {
VS(f_max(4, 2, CREATE_VECTOR4(3, 1, 6, 7)), 7);
VS(f_max(0, CREATE_VECTOR3(2, 4, 5)), 5);
VS(f_max(1, 0, CREATE_VECTOR1("hello")), 0);
VS(f_max(1, "hello", CREATE_VECTOR1(0)), "hello");
VS(f_max(1, "hello", CREATE_VECTOR1(-1)), "hello");
VS(f_max(1, CREATE_VECTOR3(2, 4, 8),
CREATE_VECTOR1(CREATE_VECTOR3(2, 5, 1))),
CREATE_VECTOR3(2, 5, 1));
VS(f_max(1, "string", CREATE_VECTOR2(CREATE_VECTOR3(2, 5, 7), 42)),
CREATE_VECTOR3(2, 5, 7));
VS(f_max(1, CREATE_MAP1(1, "1236150163")), "1236150163");
return Count(true);
}
开发者ID:wanghong1987,项目名称:hiphop-php,代码行数:14,代码来源:test_ext_math.cpp
示例19: s_display
bool TestExtMailparse::test_mailparse_rfc822_parse_addresses() {
static const StaticString
s_display("display"),
s_address("address"),
s_is_group("is_group");
Array addresses =
CREATE_VECTOR2("\":sysmail\"@ Some-Group. Some-Org, Muhammed."
"(I am the greatest) Ali @(the)Vegas.WBA",
"\"strange\":\":sysmail\"@ Some-Group. Some-Org, Muhammed."
"(I am the greatest) Ali @(the)Vegas.WBA;");
f_ob_start();
for (ArrayIter iter(addresses); iter; ++iter) {
Variant parsed = f_mailparse_rfc822_parse_addresses(iter.second());
for (ArrayIter iter2(parsed); iter2; ++iter2) {
Variant pair = iter2.second();
echo(pair[s_display]);
echo("\n");
echo(pair[s_address]);
echo("\n");
if (pair[s_is_group].toBoolean()) {
Variant sub = f_mailparse_rfc822_parse_addresses
(f_substr(pair[s_address], 1, f_strlen(pair[s_address]) - 2));
for (ArrayIter iter3(sub); iter3; ++iter3) {
echo(" ");
echo(iter3.second()[s_address]);
echo("\n");
}
}
}
echo("...\n");
}
String output = f_ob_get_contents();
f_ob_end_clean();
VS(output,
":[email protected]\n"
"\":sysmail\"@Some-Group.Some-Org\n"
"I am the greatest the\n"
"[email protected]\n"
"...\n"
"strange\n"
":\":sysmail\"@Some-Group.Some-Org,[email protected];\n"
" \":sysmail\"@Some-Group.Some-Org\n"
" [email protected]\n"
"...\n");
return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:50,代码来源:test_ext_mailparse.cpp
示例20: CREATE_VECTOR2
bool TestExtSoap::test_SoapServerFunctionParam() {
Array funcs = CREATE_VECTOR2("Sub", "Add");
m_server->t_addfunction(funcs);
VS(m_server->t_getfunctions(), funcs);
VSOAP("<ns1:Add xmlns:ns1=\"http://testuri.org\">"
"<x xsi:type=\"xsd:int\">22</x>"
"<y xsi:type=\"xsd:int\">33</y>"
"</ns1:Add>",
"<ns1:AddResponse><return xsi:type=\"xsd:int\">55"
"</return></ns1:AddResponse>");
return Count(true);
}
开发者ID:devmario,项目名称:hiphop-php,代码行数:14,代码来源:test_ext_soap.cpp
注:本文中的CREATE_VECTOR2函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论