本文整理汇总了C++中RAWTRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ RAWTRACE函数的具体用法?C++ RAWTRACE怎么用?C++ RAWTRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RAWTRACE函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: RAWTRACE
void MethodResultJni::callRubyBack(jboolean jReleaseCallback)
{
RAWTRACE(__FUNCTION__);
RAWTRACE(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
jhstring jhStrCallbackData = getStrCallbackData(m_env);
jlong jRubyProc = getRubyProcCallback(m_env);
if (jRubyProc != 0)
{
VALUE oProc = static_cast<VALUE>(jRubyProc);
rho::String strResBody = RHODESAPP().addCallbackObject(new CRubyCallbackResult<MethodResultJni>(*this), "body");
RAWTRACE1("Call Ruby proc by address: 0x%.8x", oProc);
RHODESAPP().callCallbackProcWithData( oProc, strResBody, rho_cast<rho::String>(m_env, jhStrCallbackData.get()), true);
if(static_cast<bool>(jReleaseCallback))
{
releaseRubyProcCallback(jRubyProc);
}
}
else
{
jhstring jhStrCallback = getStrCallback(m_env);
String strCallback = rho_cast<String>(m_env, jhStrCallback.get());
if(strCallback.length())
{
RAWTRACE1("Call Ruby controller by URL: %s", rho_cast<rho::String>(jhStrCallback.get()).c_str());
rho::String strResBody = RHODESAPP().addCallbackObject(new CRubyCallbackResult<MethodResultJni>(*this), "__rho_inline");
RHODESAPP().callCallbackWithData(rho_cast<rho::String>(m_env, jhStrCallback.get()), strResBody, rho_cast<rho::String>(m_env, jhStrCallbackData.get()), true);
}
}
}
开发者ID:javiermolina1234,项目名称:rhodes,代码行数:35,代码来源:MethodResultJni.cpp
示例2: RAWTRACE
VALUE MethodResultJni::enumerateRubyObjects(VALUE klass)
{
RAWTRACE("enumerateRubyObjects");
JNIEnv *env = jniInit();
if (!env) {
RAWLOG_ERROR("JNI initialization failed");
rb_raise(rb_eRuntimeError,"JNI initialization failed");
return Qnil;;
}
if(getResultType(env) == typeList)
{
CHoldRubyValue valArray(rho_ruby_create_array());
HStringVector pIDs = rho_cast<HStringVector>(env, getListResult(env));
for(HStringVector::element_type::size_type i = 0; i < pIDs->size(); ++i)
{
VALUE valObj = rho_ruby_create_object_with_id( klass, (*pIDs)[i].c_str() );
rho_ruby_add_to_array(valArray, valObj);
}
RAWTRACE("has enumerated");
reset(env);
return valArray;
} else
{
return toRuby();
}
}
开发者ID:bulatovalexey,项目名称:rhodes,代码行数:32,代码来源:MethodResultJni.cpp
示例3: RAWLOG_ERROR2
int CURLNetRequest::getResponseCode(CURLcode err, char const *body, size_t bodysize, IRhoSession* oSession )
{
//if (err != CURLE_OK)
// return -1;
if (!body) {
body = "";
bodysize = 0;
}
long statusCode = 0;
CURL *curl = m_curl.curl();
if (curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &statusCode) != 0)
statusCode = 500;
if (statusCode == 416) {
statusCode = 206;
}
if (statusCode >= 400) {
RAWLOG_ERROR2("Request failed. HTTP Code: %d returned. HTTP Response: %s",
(int)statusCode, body);
if (statusCode == 401)
if (oSession)
oSession->logout();
}
else {
RAWTRACE1("RESPONSE----- (%d bytes)", bodysize);
RAWTRACE(body);
RAWTRACE("END RESPONSE-----");
}
return (int)statusCode;
}
开发者ID:3runo5ouza,项目名称:rhodes,代码行数:34,代码来源:CURLNetRequest.cpp
示例4: rho_phonebook_getpageparams
const PbPageParam* rho_phonebook_getpageparams(rho_param* param, PbPageParam* page)
{
bool offset = false;
bool per_page = false;
if(param == 0 || page == 0)
{
RAWTRACE2("Param(0x%.8X) or page(0x%.8X) is NULL, skipping", param, page);
return 0;
}
if (param->type == RHO_PARAM_HASH)
{
for (int i = 0, lim = param->v.hash->size; i < lim; ++i)
{
const char* key = param->v.hash->name[i];
rho_param* value = param->v.hash->value[i];
if (strcasecmp(key, "offset") == 0)
{
RAWTRACE("'offset' parameter found");
if (value->type == RHO_PARAM_STRING)
{
RAWTRACE1("'offset' parameter is string: %s", value->v.string);
sscanf(value->v.string, "%d", &page->offset);
offset = true;
}
} else if (strcasecmp(key, "per_page") == 0)
{
RAWTRACE("'per_page' parameter found");
if (value->type == RHO_PARAM_STRING)
{
RAWTRACE1("'per_page' parameter is string: %s", value->v.string);
sscanf(value->v.string, "%d", &page->per_page);
per_page = true;
}
}
if(offset && per_page) break;
}
}
else
{
RAWTRACE("rho_param is not a hash!");
}
if(!offset)
page->offset = 0;
if(!per_page)
page->per_page = -1;
return page;
}
开发者ID:4nkh,项目名称:rhodes,代码行数:49,代码来源:PhonebookParams.cpp
示例5: RAWTRACE
jobjectArray rho_cast_helper<jobjectArray, VALUE>::operator()(JNIEnv *env, VALUE value)
{
RAWTRACE("rho_cast<jobjectArray, VALUE>");
if (!initConvertor(env))
return 0;
if (NIL_P(value))
return 0;
if(TYPE(value) == T_ARRAY)
{
int size = RARRAY_LEN(value);
jobjectArray jArray = env->NewObjectArray(size, clsString, 0);
if (!jArray)
return 0;
for (int i = 0; i < size; ++i)
{
jhstring jhElement = rho_cast<jstring>(env, rb_ary_entry(value, i));
env->SetObjectArrayElement(jArray, i, jhElement.get());
}
return jArray;
}
RAWLOG_ERROR1("rho_cast<jobjectArray, VALUE>: wrong type of VALUE: %d", TYPE(value));
return 0;
}
开发者ID:gokugong,项目名称:rhodes,代码行数:29,代码来源:JNIRhoRuby.cpp
示例6: RAWTRACE
jobjectArray rho_cast_helper<jobjectArray, VALUE>::operator()(JNIEnv *env, VALUE value)
{
RAWTRACE("rho_cast<jobjectArray, VALUE>");
if (!initConvertor(env))
return 0;
if (NIL_P(value))
return 0;
if(TYPE(value) == RUBY_T_ARRAY)
{
int size = RARRAY_LEN(value);
jobjectArray jArray = env->NewObjectArray(size, clsString, 0);
if(env->ExceptionCheck() == JNI_TRUE)
{
rho::String message = rho::common::clearException(env);
RAWLOG_ERROR(message.c_str());
return 0;
}
for (int i = 0; i < size; ++i)
{
jhstring jhElement = rho_cast<jstring>(env, rb_ary_entry(value, i));
env->SetObjectArrayElement(jArray, i, jhElement.get());
}
return jArray;
}
RAWLOG_ERROR1("rho_cast<jobjectArray, VALUE>: wrong type of VALUE: %d", TYPE(value));
return 0;
}
开发者ID:CSanshulgandhi,项目名称:rhodes,代码行数:33,代码来源:JNIRhoRuby.cpp
示例7: RAWLOG_INFO
void CHttpServer::stop()
{
// WARNING!!! It is not enough to just close listener on Android
// to stop server. By unknown reason accept does not unblock if
// it was closed in another thread. However, on iPhone it works
// right. To work around this, we create dummy socket and connect
// to the listener. This surely unblock accept on listener and,
// therefore, stop server thread (because m_active set to false).
m_active = false;
RAWLOG_INFO("Stopping server...");
SOCKET conn = socket(AF_INET, SOCK_STREAM, 0);
sockaddr_in sa;
memset(&sa, 0, sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_port = htons((uint16_t)m_port);
sa.sin_addr.s_addr = inet_addr("127.0.0.1");
int err = connect(conn, (struct sockaddr *)&sa, sizeof(sa));
if (err == SOCKET_ERROR)
RAWLOG_ERROR1("Stopping server: can not connect to listener: %d", RHO_NET_ERROR_CODE);
else
RAWTRACE("Stopping server: command sent");
closesocket(conn);
/*
RAWTRACE("Close listening socket");
close_listener();
RAWTRACE("Listening socket closed");
*/
}
开发者ID:kumarvegeta,项目名称:rhodes,代码行数:28,代码来源:HttpServer.cpp
示例8: set_capabilities
static bool set_capabilities(JNIEnv *env)
{
RAWTRACE("Capabilities setup");
char const *caps[] = {
#define RHO_DEFINE_CAP(x) #x,
#include "rhocaps.inc"
#undef RHO_DEFINE_CAP
};
std::map<std::string, bool> actual_caps;
#define RHO_DEFINE_CAP(x) actual_caps[#x] = RHO_CAP_ ## x ## _ENABLED;
#include "rhocaps.inc"
#undef RHO_DEFINE_CAP
jclass cls = getJNIClass(RHODES_JAVA_CLASS_CAPABILITIES);
if (!cls) return false;
for (size_t i = 0, lim = sizeof(caps)/sizeof(caps[0]); i < lim; ++i)
{
std::string field_name = std::string(caps[i]) + "_ENABLED";
RAWTRACE2("%s->%d", field_name.c_str(), static_cast<int>(actual_caps[caps[i]]));
jfieldID fid = getJNIClassStaticField(env, cls, field_name.c_str(), "Z");
if (!fid) return false;
env->SetStaticBooleanField(cls, fid, actual_caps[caps[i]]);
}
return true;
}
开发者ID:hirotaka,项目名称:rhodes,代码行数:27,代码来源:rhodesapp.cpp
示例9: RAWTRACE
HStringMap
rho_cast_helper<HStringMap, jobjectArray>::operator()(JNIEnv *env, jobjectArray jKeys, jobjectArray jVals)
{
RAWTRACE("rho_cast<HStringMap, jobjectArray>");
value_type result(new value_type::element_type);
unsigned n = env->GetArrayLength(jKeys);
for(unsigned i = 0; i < n; ++i)
{
jobject jkeyraw = env->GetObjectArrayElement(jKeys, i);
jobject jvalraw = env->GetObjectArrayElement(jVals, i);
jhstring jkey = static_cast<jstring>(jkeyraw);
jhstring jval = static_cast<jstring>(jvalraw);
std::string key = rho_cast<std::string>(env, jkey);
std::string val = rho_cast<std::string>(env, jval);
env->DeleteLocalRef(jkeyraw);
env->DeleteLocalRef(jvalraw);
result->put(key, val);
}
return result;
}
开发者ID:CSanshulgandhi,项目名称:rhodes,代码行数:26,代码来源:rhodes.cpp
示例10: RAWTRACE
void CBarcode1::setJavaFactory(JNIEnv* env, jobject jFactory)
{
RAWTRACE("setJavaFactory");
env = jniInit(env);
if (!env) {
RAWLOG_ERROR("JNI initialization failed");
return;
}
RAWTRACE1("s_clsFactorySingleton: 0x%.8X ------------------------------------", s_clsFactorySingleton);
env->CallStaticVoidMethod(s_clsFactorySingleton, s_midFactorySetInstance, jFactory);
RAWTRACE("setJavaFactory succeeded");
}
开发者ID:kumarvegeta,项目名称:rhodes,代码行数:16,代码来源:Barcode1.cpp
示例11: Init_NativeToolbar
extern "C" void Init_NativeToolbar(void)
{
RAWTRACE(__FUNCTION__);
JNIEnv *env = jnienv();
if(env)
{
jclass cls = rho_find_class(env, NATIVETOOLBAR_FACTORY_CLASS);
if(!cls)
{
RAWLOG_ERROR1("Failed to find java class: %s", NATIVETOOLBAR_FACTORY_CLASS);
return;
}
jmethodID midFactory = env->GetMethodID(cls, "<init>", "()V");
if(!midFactory)
{
RAWLOG_ERROR1("Failed to get constructor for java class %s", NATIVETOOLBAR_FACTORY_CLASS);
return;
}
jobject jFactory = env->NewObject(cls, midFactory);
if(env->IsSameObject(jFactory, NULL))
{
RAWLOG_ERROR1("Failed to create %s instance", NATIVETOOLBAR_FACTORY_CLASS);
return;
}
RAWTRACE("Initializing Java factory");
rho::CNativeToolbarBase::setJavaFactory(env, jFactory);
RAWTRACE("Deleting JNI reference");
env->DeleteLocalRef(jFactory);
RAWTRACE("Initializing API");
Init_NativeToolbar_API();
RAWTRACE("Init_NativeToolbar succeeded");
}
else
{
RAWLOG_ERROR("Failed to initialize NativeToolbar API: jnienv() is failed");
}
RHODESAPP().getExtManager().requireRubyFile("RhoNativeToolbarApi");
}
开发者ID:AdmontVT,项目名称:rhodes,代码行数:46,代码来源:NativeToolbar_impl.cpp
示例12: Init_Development
extern "C" void Init_Development(void)
{
RAWTRACE(__FUNCTION__);
JNIEnv *env = jnienv();
if(env)
{
jclass cls = rho_find_class(env, DEVELOPMENT_FACTORY_CLASS);
if(!cls)
{
RAWLOG_ERROR1("Failed to find java class: %s", DEVELOPMENT_FACTORY_CLASS);
return;
}
jmethodID midFactory = env->GetMethodID(cls, "<init>", "()V");
if(!midFactory)
{
RAWLOG_ERROR1("Failed to get constructor for java class %s", DEVELOPMENT_FACTORY_CLASS);
return;
}
jobject jFactory = env->NewObject(cls, midFactory);
if(env->IsSameObject(jFactory, NULL))
{
RAWLOG_ERROR1("Failed to create %s instance", DEVELOPMENT_FACTORY_CLASS);
return;
}
RAWTRACE("Initializing Java factory");
rho::CDevelopmentBase::setJavaFactory(env, jFactory);
RAWTRACE("Deleting JNI reference");
env->DeleteLocalRef(jFactory);
RAWTRACE("Initializing API");
Init_Development_API();
RAWTRACE("Init_Development succeeded");
}
else
{
RAWLOG_ERROR("Failed to initialize Development API: jnienv() is failed");
}
}
开发者ID:Gaurav2728,项目名称:rhodes,代码行数:46,代码来源:Development_impl.cpp
示例13: _CreateRequestHash
static VALUE
_CreateRequestHash(HttpContextRef context, RouteRef route) {
RAWTRACE("Creating Req Hash");
VALUE hash = createHash();
const char* applicationName = route->_application;
addStrToHash(hash, "application", applicationName, strlen(applicationName));
const char* modelName = route->_model;
addStrToHash(hash, "model", modelName, strlen(modelName));
if (route->_action!=NULL) {
const char* actionName = route->_action;
addStrToHash(hash, "action", actionName, strlen(actionName));
}
if (route->_id!=NULL) {
const char* _id = route->_id;
addStrToHash(hash, "id", _id, strlen(_id));
}
const char* method = HTTPGetMethod(context->_request->_method);
addStrToHash(hash, "request-method", method, strlen(method));
const char* uri = context->_request->_uri;
addStrToHash(hash, "request-uri", uri, strlen(uri));
const char* query = context->_request->_query == NULL ? "" : context->_request->_query;
addStrToHash(hash, "request-query", query, strlen(query));
VALUE hash_headers = createHash();
struct parsed_header* h = &context->_request->_cheaders.cl;
for (int i = 0; i < sizeof(struct headers)/sizeof(struct parsed_header); i++) {
if (h->_name) {
char* name = trim(strdup(h->_name));
if (h->_type == HDR_STRING) {
addStrToHash(hash_headers,name,h->_v.v_vec.ptr,h->_v.v_vec.len);
} else if (h->_type == HDR_INT) {
addIntToHash(hash_headers, name, h->_v.v_big_int);
} else if (h->_type == HDR_DATE) {
addTimeToHash(hash_headers, name, h->_v.v_time);
}
free(name);
}
h++;
}
addHashToHash(hash,"headers",hash_headers);
int buflen = CFDataGetLength(context->_rcvdBytes);
if (buflen > 0) {
addStrToHash(hash, "request-body",
(char*)CFDataGetBytePtr(context->_rcvdBytes), buflen);
}
return hash;
}
开发者ID:jixc2008,项目名称:rhodes,代码行数:57,代码来源:Dispatcher.c
示例14: ServeIndex
int ServeIndex(HttpContextRef context, char* index_name) {
RAWLOG_INFO("Calling ruby framework to serve index");
VALUE val = callServeIndex(index_name);
char* res = getStringFromValue(val);
if (res) {
RAWTRACE("RESPONSE:");
RAWTRACE_DATA((UInt8*)res, strlen(res));
RAWTRACE("RESPONSE -- eof --");
RAWTRACE("Add response to the send buffer");
CFDataAppendBytes(context->_sendBytes, (UInt8*)res, (CFIndex)strlen(res));
releaseValue(val);
return 1;
}
return 0;
}
开发者ID:jixc2008,项目名称:rhodes,代码行数:19,代码来源:Dispatcher.c
示例15: _CallApplication
static int
_CallApplication(HttpContextRef context, RouteRef route) {
RAWLOG_INFO("Calling ruby framework");
VALUE val = callFramework(_CreateRequestHash(context,route));
char* res = getStringFromValue(val);
if (res) {
RAWTRACE("RESPONSE:");
RAWTRACE_DATA((UInt8*)res, strlen(res));
RAWTRACE( "RESPONSE -- eof --");
RAWTRACE("Add response to the send buffer");
CFDataAppendBytes(context->_sendBytes, (UInt8*)res, (CFIndex)strlen(res));
releaseValue(val);
return 1;
}
return 0;
}
开发者ID:jixc2008,项目名称:rhodes,代码行数:20,代码来源:Dispatcher.c
示例16: Init_Barcode1
extern "C" void Init_Barcode1(void)
{
RAWTRACE("Init_Barcode1");
JNIEnv *env = jnienv();
if(env)
{
jclass cls = rho_find_class(env, BARCODE1_FACTORY_CLASS);
if(!cls)
{
RAWLOG_ERROR1("Failed to find java class: %s", BARCODE1_FACTORY_CLASS);
return;
}
jmethodID midFactory = env->GetMethodID(cls, "<init>", "()V");
if(!midFactory)
{
RAWLOG_ERROR1("Failed to get constructor for java class %s", BARCODE1_FACTORY_CLASS);
return;
}
jobject jFactory = env->NewObject(cls, midFactory);
if(env->IsSameObject(jFactory, NULL))
{
RAWLOG_ERROR1("Failed to create %s instance", BARCODE1_FACTORY_CLASS);
return;
}
rhoelements::CBarcode1::setJavaFactory(env, jFactory);
env->DeleteLocalRef(jFactory);
Init_Barcode1_API();
RAWTRACE("Init_Barcode1 succeeded");
}
else
{
RAWLOG_ERROR("Failed to initialize Barcode1 API: jnienv() is failed");
}
}
开发者ID:kumarvegeta,项目名称:rhodes,代码行数:40,代码来源:Barcode1_impl.cpp
注:本文中的RAWTRACE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论