本文整理汇总了C++中RAWLOG_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ RAWLOG_ERROR函数的具体用法?C++ RAWLOG_ERROR怎么用?C++ RAWLOG_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RAWLOG_ERROR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: RAWLOG_ERROR
VALUE rho_cast_helper<VALUE, jobject>::convertJavaCollectionToRubyArray(jobject jList)
{
jhobject jhIterator = m_env->CallObjectMethod(jList, midCollectionIterator);
if(m_env->ExceptionCheck() == JNI_TRUE)
{
rho::String message = rho::common::clearException(m_env);
RAWLOG_ERROR(message.c_str());
return Qnil;
}
CHoldRubyValue retval(rho_ruby_create_array());
while(m_env->CallBooleanMethod(jhIterator.get(), midIteratorHasNext))
{
jhobject jhVal = m_env->CallObjectMethod(jhIterator.get(), midIteratorNext);
if(m_env->ExceptionCheck() == JNI_TRUE)
{
rho::String message = rho::common::clearException(m_env);
RAWLOG_ERROR(message.c_str());
return Qnil;
}
CHoldRubyValue val(rho_cast<VALUE>(m_env, jhVal));
rho_ruby_add_to_array(retval, val);
}
return retval;
}
开发者ID:CSanshulgandhi,项目名称:rhodes,代码行数:26,代码来源:JNIRhoRuby.cpp
示例2: rho_barcode_barcode_recognize
extern "C" const char* rho_barcode_barcode_recognize(const char* filename) {
JNIEnv *env = jnienv();
jclass cls = rho_find_class(env, "com/rhomobile/barcode/Barcode");
if (!cls) return NULL;
jmethodID mid = env->GetStaticMethodID( cls, "recognize", "(Ljava/lang/String;)Ljava/lang/String;");
if (!mid) return NULL;
jstring objFilename = env->NewStringUTF(filename);
jstring res = (jstring)env->CallStaticObjectMethod(cls, mid, objFilename);
env->DeleteLocalRef(objFilename);
if (res == NULL) {
RAWLOG_ERROR("Failed to recognize.");
return NULL;
}
if(env->GetStringUTFLength(res) < (sizeof(barcode_result)/sizeof(barcode_result[0])))
{
const char* code = env->GetStringUTFChars(res,0);
strcpy(barcode_result, code);
env->ReleaseStringUTFChars(res, code);
} else
{
RAWLOG_ERROR("Recognized data is too large.");
return NULL;
}
return barcode_result;
}
开发者ID:4nkh,项目名称:rhodes,代码行数:29,代码来源:barcode.cpp
示例3: CFStreamCreatePairWithSocket
CURLcode SSLImpl::connect(int sockfd, int nonblocking, int *done, int ssl_verify_peer, void *storage, char* host_name)
{
ssl_data_t *data = (ssl_data_t*)storage;
CFStreamCreatePairWithSocket(kCFAllocatorDefault, sockfd, &data->readStream, &data->writeStream);
// Indicate that the connection needs to be done in secure manner
CFReadStreamSetProperty(data->readStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelSSLv3);
CFWriteStreamSetProperty(data->writeStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelSSLv3);
CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
if (!dict) {
RAWLOG_ERROR("Can not allocate CFMutableDictionaryRef");
return CURLE_SSL_CONNECT_ERROR;
}
CFDictionarySetValue(dict, kCFStreamSSLValidatesCertificateChain, ssl_verify_peer ? kCFBooleanTrue : kCFBooleanFalse);
CFReadStreamSetProperty(data->readStream, kCFStreamPropertySSLSettings, dict);
CFWriteStreamSetProperty(data->writeStream, kCFStreamPropertySSLSettings, dict);
CFRelease(dict);
if (!CFReadStreamOpen(data->readStream) || !CFWriteStreamOpen(data->writeStream)) {
RAWLOG_ERROR("SSL connection error");
return CURLE_SSL_CONNECT_ERROR;
}
CFReadStreamScheduleWithRunLoop( data->readStream,
CFRunLoopGetCurrent(),
kCFRunLoopCommonModes);
CFWriteStreamScheduleWithRunLoop( data->writeStream,
CFRunLoopGetCurrent(),
kCFRunLoopCommonModes);
*done = 1;
return CURLE_OK;
}
开发者ID:nhinze,项目名称:rhodes,代码行数:34,代码来源:sslimpl.cpp
示例4: rho_geoimpl_do_geocoding
void rho_geoimpl_do_geocoding(rho_param* p, const char* callback, int callback_tag) {
const char* c_adress = NULL;
bool adress_setted = false;
float longitude = 0;
float latitude = 0;
bool longitude_setted = false;
bool latitude_setted = false;
switch (p->type) {
case RHO_PARAM_HASH: {
for (int i = 0, lim = p->v.hash->size; i < lim; ++i) {
const char *name = p->v.hash->name[i];
rho_param *value = p->v.hash->value[i];
if (strcasecmp(name, "adress") == 0) {
c_adress = value->v.string;
adress_setted = true;
}
if (strcasecmp(name, "latitude") == 0) {
latitude = strtod(value->v.string, NULL);
latitude_setted = true;
}
if (strcasecmp(name, "longitude") == 0) {
longitude_setted = true;
longitude = strtod(value->v.string, NULL);
}
}
}
break;
default: {
RAWLOG_ERROR("Unexpected parameter type for do_geocoding, should be Hash");
return;
}
}
if ((c_adress == NULL) && (!latitude_setted && !longitude_setted)) {
RAWLOG_ERROR("Unexpected parameter type for do_geocoding, should be Hash with 'adress' or 'latitude' + 'longitude' parameters");
return;
}
if (adress_setted) {
rho::String adress = c_adress;
getGeocodeSignletone()->resolve(adress, new RhoGoogleGeocodeCallbackImpl(adress, callback, callback_tag));\
}
else if (latitude_setted && longitude_setted) {
getGeocodeSignletone()->resolve(latitude, longitude, new RhoGoogleGeocodeCallbackImpl("", callback, callback_tag));
}
else {
RAWLOG_ERROR("Ivalid parameters type for do_geocoding, should be Hash with 'adress' or 'latitude' + 'longitude' parameters");
}
}
开发者ID:Yashi100,项目名称:rhodes3.3.2,代码行数:53,代码来源:GeocodingMapEngine.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) == 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
示例6: onSuccess
virtual void onSuccess(double latitude, double longitude, const char* adress) {
char* buf = new char[2048];
if (buf == NULL) {
RAWLOG_ERROR("can not allocate temporary char buffer in GeoLocation callback");
return;
}
if (adress != NULL) {
rho::String coded_adr = adress;
coded_adr = rho::net::URI::urlEncode(coded_adr);
sprintf(buf,"&rho_callback=1&status=ok&tag=%d&latitude=%f&longitude=%f&adress=%s", mTag, (float)latitude, (float)longitude, coded_adr.c_str());
}
else {
sprintf(buf,"&rho_callback=1&status=ok&tag=%d&latitude=%f&longitude=%f", mTag, (float)latitude, (float)longitude);
}
char* norm_url = rho_http_normalizeurl(mCallback.c_str());
rho_net_request_with_data(norm_url, buf);
rho_http_free(norm_url);
delete buf;
//delete this;
}
开发者ID:Yashi100,项目名称:rhodes3.3.2,代码行数:25,代码来源:GeocodingMapEngine.cpp
示例7: rho_ruby_create_string
VALUE rho_cast_helper<VALUE, jobject>::operator()(JNIEnv *env, jobject obj)
{
if (env->IsSameObject(obj, NULL) == JNI_TRUE)
return Qnil;
if (!initConvertor(env))
{
env->ThrowNew(getJNIClass(RHODES_JAVA_CLASS_RUNTIME_EXCEPTION), "Java <=> Ruby conversion initialization failed");
return Qnil;
}
if (env->IsInstanceOf(obj, clsString))
{
const char *str = env->GetStringUTFChars(static_cast<jstring>(obj), JNI_FALSE);
VALUE res = rho_ruby_create_string(str);
env->ReleaseStringUTFChars(static_cast<jstring>(obj), str);
return res;
}
if (env->IsInstanceOf(obj, clsMap))
return convertJavaMapToRubyHash(env, obj);
RAWLOG_ERROR("rho_cast<VALUE, jobject>: unknown type of value");
return Qnil;
}
开发者ID:lilan,项目名称:rhodes,代码行数:25,代码来源:JNIRhoRuby.cpp
示例8: RAWLOG_ERROR
JNIEnv *jnienv()
{
JNIEnv *env = (JNIEnv *)pthread_getspecific(g_thrkey);
if (!env)
RAWLOG_ERROR("JNIEnv is not set for this thread!!!");
return env;
}
开发者ID:CSanshulgandhi,项目名称:rhodes,代码行数:7,代码来源:rhodes.cpp
示例9: 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
示例10: take_picture
RHO_GLOBAL void take_picture(char* callback_url, rho_param *options_hash )
{
JNIEnv *env = jnienv();
jclass cls = getJNIClass(RHODES_JAVA_CLASS_CAMERA);
if (!cls) return;
jmethodID mid = getJNIClassStaticMethod(env, cls, "takePicture", "(Ljava/lang/String;Ljava/lang/Object;)V");
if (!mid) return;
if ((options_hash != NULL) && (options_hash->type != RHO_PARAM_HASH)) {
RAWLOG_ERROR("Unexpected parameter type, should be Hash");
return;
}
jobject paramsObj = NULL;
if (options_hash != NULL) {
paramsObj = RhoValueConverter(env).createObject(options_hash);
}
env->CallStaticVoidMethod(cls, mid, rho_cast<jhstring>(callback_url).get(), paramsObj);
if (options_hash != NULL) {
env->DeleteLocalRef(paramsObj);
}
}
开发者ID:indoorsdog,项目名称:rhosetta,代码行数:25,代码来源:camera.cpp
示例11: Init_Barcode1
extern "C" void Init_Barcode1(void)
{
JNIEnv *env = jnienv();
if(env)
{
jclass barcode1SingletonClass = rho_find_class(env, BARCODE1_SINGLETON_CLASS);
if(!barcode1SingletonClass)
{
RAWLOG_ERROR1("Failed to find java class: %s", BARCODE1_SINGLETON_CLASS);
return;
}
jmethodID midInit = env->GetStaticMethodID(barcode1SingletonClass, "init", "()V");
if(!midInit)
{
RAWLOG_ERROR1("Failed to get method 'init' for java class %s", BARCODE1_SINGLETON_CLASS);
return;
}
env->CallStaticVoidMethod(barcode1SingletonClass, midInit);
Init_RubyAPI_Barcode1();
//Init_JSAPI_Barcode1();
}
else
{
RAWLOG_ERROR("Failed to initialize Barcode1 API: jnienv() is failed");
}
}
开发者ID:wzcupid1984,项目名称:rhodes,代码行数:28,代码来源:Barcode1_impl.cpp
示例12: m_jhResult
MethodResultJni::MethodResultJni(JNIEnv* env, jobject jResult) : m_jhResult(jResult), m_bGlobalRef(false), m_bSlaveRef(false), m_hasCallback(false), m_resType(typeNone)
{
m_env = jniInit(env);
if (!m_env) {
RAWLOG_ERROR("ctor - JNI initialization failed");
return;
}
}
开发者ID:raj-odc,项目名称:rhodes,代码行数:8,代码来源:MethodResultJni.cpp
示例13: m_jhResult
MethodResultJni::MethodResultJni() : m_jhResult(0), m_hasCallbackUrl(false), m_resType(typeNone)
{
JNIEnv *env = jniInit();
if (!env) {
RAWLOG_ERROR("ctor - JNI initialization failed");
return;
}
m_jhResult = env->NewObject(s_methodResultClass, s_midMethodResult);
}
开发者ID:bulatovalexey,项目名称:rhodes,代码行数:10,代码来源:MethodResultJni.cpp
示例14: m_env
MethodResultJni::MethodResultJni(bool isRuby) : m_env(0), m_jhResult(0), m_bGlobalRef(false), m_bSlaveRef(false), m_hasCallback(false), m_resType(typeNone)
{
m_env = jniInit();
if (!m_env) {
RAWLOG_ERROR("ctor - JNI initialization failed");
return;
}
m_jhResult = m_env->NewObject(s_methodResultClass, s_midMethodResult, static_cast<jboolean>(isRuby));
}
开发者ID:raj-odc,项目名称:rhodes,代码行数:10,代码来源:MethodResultJni.cpp
示例15: jnienv
JNIEnv* CBarcode1::jniInit()
{
JNIEnv *env = jnienv();
if(!env)
{
RAWLOG_ERROR("JNI init failed: JNIEnv is null");
return 0;
}
return jniInit(env);
}
开发者ID:kumarvegeta,项目名称:rhodes,代码行数:10,代码来源:Barcode1.cpp
示例16: jniInit
jhobject CBarcode1::create(jhstring& jhId)
{
JNIEnv *env = jniInit();
if (!env) {
RAWLOG_ERROR("JNI initialization failed");
return;
}
jhobject res = env->CallStaticObjectMethod(s_class, s_midCreate, ghId.get());
}
开发者ID:ariejan,项目名称:rhodes,代码行数:10,代码来源:Barcode1.cpp
示例17: RAWLOG_ERROR
jobject rho_cast_helper<jobject, VALUE>::operator()(JNIEnv *env, VALUE value)
{
if (NIL_P(value))
return NULL;
if (TYPE(value) == T_STRING)
return env->NewStringUTF(RSTRING_PTR(value));
RAWLOG_ERROR("rho_cast<jobject, VALUE>: unknown type of value");
return NULL;
}
开发者ID:lilan,项目名称:rhodes,代码行数:11,代码来源:JNIRhoRuby.cpp
示例18: google_mapview_create
//#if 0
RHO_GLOBAL void google_mapview_create(rho_param *p)
{
#ifdef RHO_GOOGLE_API_KEY
JNIEnv *env = jnienv();
jclass clsMapView = getJNIClass(RHODES_JAVA_CLASS_GOOGLEMAPVIEW);
if (!clsMapView) return;
jmethodID midCreate = getJNIClassStaticMethod(env, clsMapView, "create", "(Ljava/lang/String;Ljava/util/Map;)V");
if (!midCreate) return;
if (p->type != RHO_PARAM_HASH) {
RAWLOG_ERROR("create: wrong input parameter (expect Hash)");
return;
}
jhobject paramsObj = jhobject(RhoValueConverter(env).createObject(p));
jhstring keyObj = rho_cast<jhstring>(RHO_GOOGLE_API_KEY);
env->CallStaticVoidMethod(clsMapView, midCreate, keyObj.get(), paramsObj.get());
#else
RAWLOG_ERROR("MapView disabled at build time");
#endif
}
开发者ID:Takonis,项目名称:rhodes,代码行数:22,代码来源:mapview.cpp
示例19: RAWTRACE
void CBarcode1::enumerate(MethodResultJni& res)
{
RAWTRACE("enumerate");
JNIEnv *env = jniInit();
if (!env) {
RAWLOG_ERROR("JNI initialization failed");
return;
}
jhobject jhSingleton = getSingleton(env);
env->CallVoidMethod(jhSingleton.get(), s_midEnumerate, static_cast<jobject>(res));
}
开发者ID:kumarvegeta,项目名称:rhodes,代码行数:13,代码来源:Barcode1.cpp
示例20: m_bhasLocalFrame
MethodResultJni::MethodResultJni(JNIEnv* env, jobject jResult) : m_bhasLocalFrame(false), m_jhResult(jResult), m_bGlobalRef(false), m_bSlaveRef(false), m_hasCallback(false), m_resType(typeNone), m_javaResultType(0)
{
if(env->PushLocalFrame(256) >= 0)
{
m_bhasLocalFrame = true;
}
m_env = jniInit(env);
if (!m_env) {
RAWLOG_ERROR("ctor - JNI initialization failed");
return;
}
}
开发者ID:javiermolina1234,项目名称:rhodes,代码行数:13,代码来源:MethodResultJni.cpp
注:本文中的RAWLOG_ERROR函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论