• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CREATE_VECTOR1函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CREATE_VECTOR1函数的典型用法代码示例。如果您正苦于以下问题:C++ CREATE_VECTOR1函数的具体用法?C++ CREATE_VECTOR1怎么用?C++ CREATE_VECTOR1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: VS

bool TestExtString::test_sscanf() {
  VS(f_sscanf(0, "SN/2350001", "SN/%d"), CREATE_VECTOR1(2350001));

  Variant out;
  VS(f_sscanf(0, "SN/2350001", "SN/%d", CREATE_VECTOR1(ref(out))), 1);
  VS(out, 2350001);
  return Count(true);
}
开发者ID:BauerBox,项目名称:hiphop-php,代码行数:8,代码来源:test_ext_string.cpp


示例2: CREATE_MAP1

bool TestExtJson::test_json_decode() {
  Array arr = CREATE_MAP1("fbid", 101501853510151001LL);
  VS(f_json_decode(f_json_encode(arr), true), arr);

  VS(f_json_decode("{\"0\":{\"00\":0}}", true),
     CREATE_MAP1("0", CREATE_MAP1("00", 0)));

  VS(f_json_decode("{\"a\":1,\"b\":2.3,\"3\":\"test\"}", true),
     CREATE_MAP3("a", 1, "b", 2.3, 3, "test"));
  VS(f_json_decode("[\"a\",1,true,false,null]", true),
     CREATE_VECTOR5("a", 1, true, false, null));

  Object obj = f_json_decode("{\"a\":1,\"b\":2.3,\"3\":\"test\"}");
  Object obj2(SystemLib::AllocStdClassObject());
  obj2->o_set("a", 1);
  obj2->o_set("b", 2.3);
  obj2->o_set("3", "test");
  VS(obj.toArray(), obj2.toArray());

  obj = f_json_decode("[\"a\",1,true,false,null]");
  VS(obj.toArray(), CREATE_VECTOR5("a", 1, true, false, null));

  VS(f_json_decode("{z:1}",     true),       null);
  VS(f_json_decode("{z:1}",     true, k_JSON_FB_LOOSE), CREATE_MAP1("z", 1));
  VS(f_json_decode("{z:\"z\"}", true),       null);
  VS(f_json_decode("{z:\"z\"}", true, k_JSON_FB_LOOSE), CREATE_MAP1("z", "z"));
  VS(f_json_decode("{'x':1}",   true),       null);
  VS(f_json_decode("{'x':1}",   true, k_JSON_FB_LOOSE), CREATE_MAP1("x", 1));
  VS(f_json_decode("{y:1,}",    true),       null);
  VS(f_json_decode("{y:1,}",    true, k_JSON_FB_LOOSE), CREATE_MAP1("y", 1));
  VS(f_json_decode("{,}",       true),       null);
  VS(f_json_decode("{,}",       true, k_JSON_FB_LOOSE), null);
  VS(f_json_decode("[1,2,3,]",  true),       null);
  VS(f_json_decode("[1,2,3,]",  true, k_JSON_FB_LOOSE), CREATE_VECTOR3(1,2,3));
  VS(f_json_decode("[,]",       true),       null);
  VS(f_json_decode("[,]",       true, k_JSON_FB_LOOSE), null);
  VS(f_json_decode("[]",        true),       Array::Create());
  VS(f_json_decode("[]",        true, k_JSON_FB_LOOSE), Array::Create());
  VS(f_json_decode("{}",        true),       Array::Create());
  VS(f_json_decode("{}",        true, k_JSON_FB_LOOSE), Array::Create());
  VS(f_json_decode("test",      true),       null);
  VS(f_json_decode("test",      true, k_JSON_FB_LOOSE), "test");
  VS(f_json_decode("'test'",    true),       null);
  VS(f_json_decode("'test'",    true, k_JSON_FB_LOOSE), "test");
  VS(f_json_decode("\"test\"",  true),       "test");
  VS(f_json_decode("\"test\"",  true, k_JSON_FB_LOOSE), "test");

  VS(f_json_decode("[{\"a\":\"apple\"},{\"b\":\"banana\"}]", true),
     CREATE_VECTOR2(CREATE_MAP1("a", "apple"), CREATE_MAP1("b", "banana")));

  Variant a = "[{\"a\":[{\"n\":\"1st\"}]},{\"b\":[{\"n\":\"2nd\"}]}]";
  VS(f_json_decode(a, true),
     CREATE_VECTOR2
     (CREATE_MAP1("a", CREATE_VECTOR1(CREATE_MAP1("n", "1st"))),
      CREATE_MAP1("b", CREATE_VECTOR1(CREATE_MAP1("n", "2nd")))));

  return Count(true);
}
开发者ID:evoloshchuk,项目名称:hiphop-php,代码行数:58,代码来源:test_ext_json.cpp


示例3: f_mb_regex_encoding

bool TestExtMb::test_mb_ereg_search_regs() {
  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"));
  r = f_mb_ereg_search_regs();    // get next result
  VS(r, CREATE_VECTOR1("abc"));
  return Count(true);
}
开发者ID:wanghong1987,项目名称:hiphop-php,代码行数:12,代码来源:test_ext_mb.cpp


示例4: VS

bool TestExtFb::test_fb_thrift_serialize() {
  Variant ret;
  VS(f_fb_thrift_unserialize(f_fb_thrift_serialize("test"), ref(ret)), "test");
  VERIFY(same(ret, true));

  ret = null;
  VS(f_fb_thrift_unserialize(f_fb_thrift_serialize(CREATE_VECTOR1("test")),
                             ref(ret)),
     CREATE_VECTOR1("test"));
  VERIFY(same(ret, true));
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:12,代码来源:test_ext_fb.cpp


示例5: CREATE_VECTOR1

bool TestExtFb::test_fb_call_user_func_safe_return() {
  {
    Variant ret = f_fb_call_user_func_safe_return
      (1, "TEst", "ok", CREATE_VECTOR1("param"));
    VS(ret, "param");
  }
  {
    Variant ret = f_fb_call_user_func_safe_return
      (1, "NonTEst", "ok", CREATE_VECTOR1("param"));
    VS(ret, "ok");
  }
  return Count(true);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:13,代码来源:test_ext_fb.cpp


示例6: CREATE_VECTOR1

bool TestExtFb::test_fb_call_user_func_safe() {
  {
    Variant ret = f_fb_call_user_func_safe
      (1, "TEst", CREATE_VECTOR1("param"));
    VS(ret, CREATE_VECTOR2(true, "param"));
  }
  {
    Variant ret = f_fb_call_user_func_safe
      (1, "NonTEst", CREATE_VECTOR1("param"));
    VS(ret, CREATE_VECTOR2(false, uninit_null()));
  }
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:13,代码来源:test_ext_fb.cpp


示例7: 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


示例8: 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


示例9: CREATE_VECTOR1

bool BaseExecutionContext::onUnhandledException(Object e) {
  String err = e.toString();
  if (RuntimeOption::AlwaysLogUnhandledExceptions) {
    Logger::Error("HipHop Fatal error: Uncaught %s", err.data());
  }

  if (e.instanceof("Exception")) {
    // user thrown exception
    if (!m_userExceptionHandlers.empty()) {
      if (!same(f_call_user_func_array
                (m_userExceptionHandlers.back(),
                 CREATE_VECTOR1(e)),
                false)) {
        return true;
      }
    }
  } else {
    ASSERT(false);
  }
  m_lastError = err;

  if (!RuntimeOption::AlwaysLogUnhandledExceptions) {
    Logger::Error("HipHop Fatal error: Uncaught %s", err.data());
  }
  return false;
}
开发者ID:Bathrisyah,项目名称:hiphop-php,代码行数:26,代码来源:execution_context.cpp


示例10: f_check_user_func_async

Variant f_check_user_func_async(CVarRef handles, int timeout /* = -1 */) {
  if (handles.isArray()) {
    return FiberAsyncFunc::Status(handles, timeout);
  }
  Array ret = FiberAsyncFunc::Status(CREATE_VECTOR1(handles), timeout);
  return !ret.empty();
}
开发者ID:ckwalsh,项目名称:hiphop-php,代码行数:7,代码来源:ext_function.cpp


示例11: f_apc_store

bool TestExtApc::test_apc_exists() {
  f_apc_store(s_ts, s_TestString);
  VS(f_apc_exists(s_ts), true);
  VS(f_apc_exists(s_TestString), false);
  VS(f_apc_exists(CREATE_VECTOR2(s_ts, s_TestString)), CREATE_VECTOR1(s_ts));
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:7,代码来源:test_ext_apc.cpp


示例12: ASSERT

bool ExecutionContext::obFlush() {
  ASSERT(m_protectedLevel >= 0);
  if ((int)m_buffers.size() > m_protectedLevel) {
    list<OutputBuffer*>::const_iterator iter = m_buffers.end();
    OutputBuffer *last = *(--iter);
    if (iter != m_buffers.begin()) {
      OutputBuffer *prev = *(--iter);
      if (last->handler.isNull()) {
        prev->oss << last->oss.str();
      } else {
        try {
          string output = last->oss.str();
          String sout(output.data(), output.length(), AttachLiteral);
          Variant tout =
            f_call_user_func_array(last->handler, CREATE_VECTOR1(sout));
          sout = tout.toString();
          prev->oss << string(sout.data(), sout.size());
        } catch (...) {
          prev->oss << last->oss.str();
        }
      }
      last->oss.str("");
      return true;
    }
    cout << last->oss.str();
    last->oss.str("");
  }
  return false;
}
开发者ID:sumitk,项目名称:hiphop-php,代码行数:29,代码来源:execution_context.cpp


示例13: CREATE_AND_CONSTRUCT

ObjectData* SystemLib::AllocBadMethodCallExceptionObject(CVarRef message) {
  if (hhvm) {
    CREATE_AND_CONSTRUCT(BadMethodCallException, CREATE_VECTOR1(message));
  } else {
    return (NEWOBJ(c_BadMethodCallException)())->create(message);
  }
}
开发者ID:CoolCloud,项目名称:hiphop-php,代码行数:7,代码来源:systemlib.cpp


示例14: switch

bool UserFile::lock(int operation, bool &wouldBlock) {
    int64_t op = 0;
    if (operation & LOCK_NB) {
        op |= k_LOCK_NB;
    }
    switch (operation & ~LOCK_NB) {
    case LOCK_SH:
        op |= k_LOCK_SH;
        break;
    case LOCK_EX:
        op |= k_LOCK_EX;
        break;
    case LOCK_UN:
        op |= k_LOCK_UN;
        break;
    }

    // bool stream_lock(int $operation)
    bool success = false;
    Variant ret = invoke(m_StreamLock, s_stream_lock,
                         CREATE_VECTOR1(op), success);
    if (!success) {
        if (operation) {
            raise_warning("%s::stream_lock is not implemented!",
                          m_cls->name()->data());
        }
        return false;
    }
    return ret.isBoolean() ? ret.toBoolean() : false;
}
开发者ID:jobin-sun,项目名称:hiphop-php,代码行数:30,代码来源:user_file.cpp


示例15: f_apc_store

bool TestExtApc::test_apc_exists() {
  f_apc_store("ts", "TestString");
  VS(f_apc_exists("ts"), true);
  VS(f_apc_exists("TestString"), false);
  VS(f_apc_exists(CREATE_VECTOR2("ts", "TestString")), CREATE_VECTOR1("ts"));
  return Count(true);
}
开发者ID:dipjyotighosh,项目名称:hiphop-php,代码行数:7,代码来源:test_ext_apc.cpp


示例16: VERIFY

bool TestExtVariable::test_is_scalar() {
  VERIFY(f_is_scalar(123));
  VERIFY(f_is_scalar("test"));
  VERIFY(!f_is_scalar(uninit_null()));
  VERIFY(!f_is_scalar(CREATE_VECTOR1(123)));
  return Count(true);
}
开发者ID:wanghong1987,项目名称:hiphop-php,代码行数:7,代码来源:test_ext_variable.cpp


示例17: getMethodStatement

Variant EvalObjectData::t___unset(Variant v_name) {
    const MethodStatement *ms = getMethodStatement("__unset");
    if (ms) {
        return ms->invokeInstance(Object(root), CREATE_VECTOR1(v_name), false);
    } else {
        return DynamicObjectData::t___unset(v_name);
    }
}
开发者ID:neurodrone,项目名称:hiphop-php,代码行数:8,代码来源:eval_object_data.cpp


示例18: pclient

void CmdUser::invokeList(DebuggerClient *client, const std::string &cls) {
  p_DebuggerClient pclient(NEW(c_DebuggerClient)());
  pclient->m_client = client;
  try {
    Object cmd = create_object(cls.c_str(), null_array);
    cmd->o_invoke("onAutoComplete", CREATE_VECTOR1(pclient), -1);
  } catch (...) {}
}
开发者ID:F4m3uS,项目名称:hiphop-php,代码行数:8,代码来源:cmd_user.cpp


示例19: filter_func

static bool filter_func(CVarRef value, const void *data) {
  HPHP::VM::CallCtx* ctx = (HPHP::VM::CallCtx*)data;
  Variant ret;
  g_vmContext->invokeFunc((TypedValue*)&ret, ctx->func, CREATE_VECTOR1(value),
                          ctx->this_, ctx->cls,
                          NULL, ctx->invName);
  return ret.toBoolean();
}
开发者ID:SagaieNet,项目名称:hiphop-php,代码行数:8,代码来源:ext_array.cpp


示例20: f_evhttp_post

bool TestExtCurl::test_evhttp_post() {
  Variant ret = f_evhttp_post(String(get_request_uri()), "echo",
                              CREATE_VECTOR1("ECHO: foo"));
  VS(ret[s_code], 200);
  VS(ret[s_response], "POST: echo");
  VS(ret[s_headers][0], "ECHOED: foo");
  VS(ret[s_headers][4], "Content-Length: 10");
  return Count(true);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:9,代码来源:test_ext_curl.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CREATE_VECTOR2函数代码示例发布时间:2022-05-30
下一篇:
C++ CREATE_ABC函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap