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

C++ RAWLOG_ERROR1函数代码示例

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

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



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

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


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


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


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


示例5: mapview_preload_map_tiles

int mapview_preload_map_tiles(const char* engine, const char* map_type, double top_latitude, double left_longitude, double bottom_latitude, double right_longitude, int min_zoom, int max_zoom, const char* callback) {
    
    rhomap::EmptyDrawingDevice empty_device;
    
    
    std::string providerId = engine;
    std::transform(providerId.begin(), providerId.end(), providerId.begin(), &::tolower);    
    
    rhomap::IMapView *mapview = RHOMAPPROVIDER().createMapView(providerId, &empty_device);
    
    if (mapview == NULL) {
        RAWLOG_ERROR1("Can not create MapView for provider=%s", engine);
        return 0;
    }

    mapview->setMapType(map_type);
    mapview->set_file_caching_enable(true);
    
    int count = mapview->preloadMapTiles(top_latitude, left_longitude, bottom_latitude, right_longitude, min_zoom, max_zoom);
     
    CheckProgress* cp = new CheckProgress(mapview, callback, count);    
    
    cp->start(rho::common::IRhoRunnable::epNormal);
    
    return count; 
}
开发者ID:raulvejar,项目名称:rhodes,代码行数:26,代码来源:MapEngine.cpp


示例6: getJNIObjectClass

jclass getJNIObjectClass(JNIEnv *env, jobject obj)
{
    jclass cls = env->GetObjectClass(obj);
    if (!cls)
        RAWLOG_ERROR1("Can not get class for object: %p (JNI)", obj);
    return cls;
}
开发者ID:bkumar,项目名称:rhodes,代码行数:7,代码来源:rhodes.cpp


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


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


示例9: getJNIClass

jclass getJNIClass(int n)
{
    if (n < 0 || (size_t)n >= g_classes.size())
    {
        RAWLOG_ERROR1("Illegal index when call getJNIClass: %d", n);
        return NULL;
    }
    return g_classes[n];
}
开发者ID:bkumar,项目名称:rhodes,代码行数:9,代码来源:rhodes.cpp


示例10: report_error

static void report_error(const char *s, CFStreamError *e)
{
    if (e->domain == kCFStreamErrorDomainPOSIX)
        RAWLOG_ERROR2("%s, errno: %d", s, e->error);
    else if (e->domain == kCFStreamErrorDomainMacOSStatus)
        RAWLOG_ERROR2("%s, Mac OS status: %d", s, e->error);
    else
        RAWLOG_ERROR1("%s, unknown error", s);
}
开发者ID:nhinze,项目名称:rhodes,代码行数:9,代码来源:sslimpl.cpp


示例11: jnienv

//----------------------------------------------------------------------------------------------------------------------
JNIEnv* CBarcode1::jniInit()
{
    JNIEnv *env = jnienv();
    if(!s_class)
    {
        s_class = rho_find_class(env, CLASS);
        if(!s_class)
        {
            RAWLOG_ERROR1("Failed to find java class: %s", CLASS);
            s_class = 0;
            return NULL;
        }
        s_midEnumerate = env->GetStaticMethodID(s_class, "enumerate", "(V)java/util/List;");
        if(!s_midEnumerate)
        {
            RAWLOG_ERROR1("Failed to get method 'enumerate' for java class %s", CLASS);
            s_class = 0;
            return NULL;
        }
        s_midGetDefault = env->GetStaticMethodID(s_class, "getDefault", "()com/rhomobile/rhoelements/IBarcode1;");
        if(!s_midGetDefault)
        {
            RAWLOG_ERROR1("Failed to get method 'getDefault' for java class %s", CLASS);
            s_class = 0;
            return NULL;
        }
        s_midSetDefaultID = env->GetStaticMethodID(s_class, "setDefaultID", "(java/util/String;)V");
        if(!s_midSetDefaultID)
        {
            RAWLOG_ERROR1("Failed to get method 'setDefaultID' for java class %s", CLASS);
            s_class = 0;
            return NULL;
        }
        s_midCreate = env->GetStaticMethodID(s_class, "create", "(java/util/String;)com/rhomobile/rhoelements/IBarcode1;");
        if(!s_midCreate)
        {
            RAWLOG_ERROR1("Failed to get method 'create' for java class %s", CLASS);
            s_class = 0;
            return NULL;
        }
    }
    return env;
}
开发者ID:ariejan,项目名称:rhodes,代码行数:44,代码来源:Barcode1.cpp


示例12: getJNIClass

jclass& getJNIClass(int n)
{
    static jclass jcNull = 0;
    if (n < 0 || (size_t)n >= g_classes.size())
    {
        RAWLOG_ERROR1("Illegal index when call getJNIClass: %d", n);
        return jcNull;
    }
    return g_classes[n];
}
开发者ID:CSanshulgandhi,项目名称:rhodes,代码行数:10,代码来源:rhodes.cpp


示例13: Init_Development_extension

extern "C" void Init_Development_extension() {
     Development_Init();

     JNIEnv *env = jnienv();
     jclass cls = rho_find_class(env, DEVELOPMENT_CLASS);
     if (!cls) {
    	 RAWLOG_ERROR1("Failed to create %s instance", DEVELOPMENT_CLASS);
    	 return;
     }
     jmethodID mid = getJNIClassStaticMethod(env, cls, "initExtension", "()V");
     if (!mid) {
    	 RAWLOG_ERROR1("Failed to get initExtension() method from %s class", DEVELOPMENT_CLASS);
    	 return;
     }
     if (already_inited == 0) {
    	 already_inited = 1;
    	 env->CallStaticVoidMethod(cls, mid);
     }

}
开发者ID:Gaurav2728,项目名称:rhodes,代码行数:20,代码来源:Development_impl.cpp


示例14: getJNIClass

RHO_GLOBAL jobject JNICALL Java_com_rhomobile_rhodes_socket_SSLImpl_getRemoteSockAddr
  (JNIEnv *env, jobject, jint sock)
{
    jclass clsSockAddr = getJNIClass(RHODES_JAVA_CLASS_RHOSOCKADDR);
    if (!clsSockAddr) return NULL;
    jclass clsInetAddr = getJNIClass(RHODES_JAVA_CLASS_INET4ADDRESS);
    if (!clsInetAddr) return NULL;
    jmethodID midSockAddr = getJNIClassMethod(env, clsSockAddr, "<init>", "()V");
    if (!midSockAddr) return NULL;
    jmethodID midInetAddr = getJNIClassMethod(env, clsInetAddr, "<init>", "([BLjava/lang/String;)V");
    if (!midInetAddr) return NULL;
    jfieldID fidInetAddr = getJNIClassField(env, clsSockAddr, "host", "Ljava/net/InetAddress;");
    if (!fidInetAddr) return NULL;
    jfieldID fidPort = getJNIClassField(env, clsSockAddr, "port", "I");
    if (!fidPort) return NULL;

    jbyteArray array = env->NewByteArray(4);
    if (!array) return NULL;
    jbyte *arr = env->GetByteArrayElements(array, NULL);
    if (!arr) return NULL;

    sockaddr_in sa;
    socklen_t salen = sizeof(sa);
    int e = ::getpeername(sock, (sockaddr*)&sa, &salen);
    if (e == -1) {
      RAWLOG_ERROR1("getpeername failed: %d", errno);
      return NULL;
    }
    uint32_t addr = ntohl(sa.sin_addr.s_addr);
    arr[3] = (jbyte)(addr & 0xFF);
    addr >>= 8;
    arr[2] = (jbyte)(addr & 0xFF);
    addr >>= 8;
    arr[1] = (jbyte)(addr & 0xFF);
    addr >>= 8;
    arr[0] = (jbyte)(addr & 0xFF);
    env->ReleaseByteArrayElements(array, arr, 0);

    jstring ipaddrObj = rho_cast<jstring>(::inet_ntoa(sa.sin_addr));
    jobject inetaddrObj = env->NewObject(clsInetAddr, midInetAddr, array, ipaddrObj);
    env->DeleteLocalRef(ipaddrObj);
    if (!inetaddrObj) return NULL;

    jobject sockaddrObj = env->NewObject(clsSockAddr, midSockAddr);
    if (!sockaddrObj) return NULL;

    env->SetObjectField(sockaddrObj, fidInetAddr, inetaddrObj);
    env->SetIntField(sockaddrObj, fidPort, ntohs(sa.sin_port));

    env->DeleteLocalRef(inetaddrObj);

    return sockaddrObj;
}
开发者ID:JamieDelton,项目名称:rhodes,代码行数:53,代码来源:sslimpl.cpp


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


示例16: RAWTRACE

bool CHttpServer::init()
{
    RAWTRACE("Open listening socket...");
    
    close_listener();
    m_listener = socket(AF_INET, SOCK_STREAM, 0);
    if (m_listener == INVALID_SOCKET) {
        RAWLOG_ERROR1("Can not create listener: %d", RHO_NET_ERROR_CODE);
        return false;
    }
    
    int enable = 1;
    if (setsockopt(m_listener, SOL_SOCKET, SO_REUSEADDR, (const char *)&enable, sizeof(enable)) == SOCKET_ERROR) {
        RAWLOG_ERROR1("Can not set socket option (SO_REUSEADDR): %d", RHO_NET_ERROR_CODE);
        close_listener();
        return false;
    }
    
    struct 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 = htonl(INADDR_LOOPBACK);
    if (bind(m_listener, (const sockaddr *)&sa, sizeof(sa)) == SOCKET_ERROR) {
        RAWLOG_ERROR2("Can not bind to port %d: %d", m_port, RHO_NET_ERROR_CODE);
        close_listener();
        return false;
    }
    
    if (listen(m_listener, 128) == SOCKET_ERROR) {
        RAWLOG_ERROR1("Can not listen on socket: %d", RHO_NET_ERROR_CODE);
        close_listener();
        return false;
    }
    
    RAWLOG_INFO1("Listen for connections on port %d", m_port);
    return true;
}
开发者ID:kumarvegeta,项目名称:rhodes,代码行数:38,代码来源:HttpServer.cpp


示例17: rho_barcode_take_barcode

extern "C" void rho_barcode_take_barcode(const char* callback) {
    JNIEnv *env = jnienv();
    jclass cls = rho_find_class(env, "com/rhomobile/barcode/Barcode");
    if (!cls) return;
    jmethodID mid = env->GetStaticMethodID( cls, "take", "(Ljava/lang/String;)V");
    if (!mid) return;

    jstring objCallback = env->NewStringUTF(callback);
    if(objCallback != NULL)
    {
        env->CallStaticObjectMethod(cls, mid, objCallback);
        env->DeleteLocalRef(objCallback);
    } else
    {
        RAWLOG_ERROR1("Cannot take barcode, no memory: %d", strlen(callback));
    }
}
开发者ID:GunioRobot,项目名称:rhodes,代码行数:17,代码来源:barcode.cpp


示例18: rho_sys_get_property

VALUE rho_sys_get_property(char* szPropName) 
{
	if (!szPropName || !*szPropName) 
        return rho_ruby_get_NIL();
    
    VALUE res = rho_sysimpl_get_property(szPropName);
    if (res)
        return res;

	if (strcasecmp("platform",szPropName) == 0) 
        return rho_ruby_create_string(getPlatformProp());

	if (strcasecmp("has_network",szPropName) == 0) 
        return rho_sys_has_network();

	if (strcasecmp("locale",szPropName) == 0) 
        return rho_sys_get_locale();

	if (strcasecmp("screen_width",szPropName) == 0) 
        return rho_ruby_create_integer(rho_sys_get_screen_width());

	if (strcasecmp("screen_height",szPropName) == 0) 
        return rho_ruby_create_integer(rho_sys_get_screen_height());

	if (strcasecmp("device_id",szPropName) == 0) 
    {
        rho::String strDeviceID = "";
        if ( rho::sync::CClientRegister::getInstance() )
            strDeviceID = rho::sync::CClientRegister::getInstance()->getDevicePin();

        return rho_ruby_create_string(strDeviceID.c_str());
    }

	if (strcasecmp("full_browser",szPropName) == 0) 
        return rho_ruby_create_boolean(1);

    RAWLOG_ERROR1("Unknown Rho::System property : %s", szPropName);

    return rho_ruby_get_NIL();
}
开发者ID:MacBoyPro,项目名称:rhodes,代码行数:40,代码来源:System.cpp


示例19: rho_barcode_take_barcode

extern "C" void rho_barcode_take_barcode(const char* callback, VALUE options) {
    JNIEnv *env = jnienv();
    jclass cls = rho_find_class(env, "com/rhomobile/barcode/Barcode");
    if (!cls) return;
    jmethodID mid = env->GetStaticMethodID( cls, "take", "(Ljava/lang/String;I)V");
    if (!mid) return;
    
    int camera_index = 0;
    if (!rho_ruby_is_NIL(options)) {
        // parse options for camera index ( 0 - main, 1 - front)
        rho_param *param = rho_param_fromvalue(options);
        if (param->type == RHO_PARAM_HASH) {
            int i;
            for (i = 0; i < param->v.hash->size; i++) {
                if (strcasecmp(param->v.hash->name[i], "camera") == 0) {
                    if (param->v.hash->value[i]->type == RHO_PARAM_STRING) {
                        if (strcasecmp(param->v.hash->value[i]->v.string, "front") == 0) {
                            camera_index = 1;
                        }
                    }
                }
            }
        }
        rho_param_free(param);
    }

    jstring objCallback = env->NewStringUTF(callback);
    if(objCallback != NULL)
    {
        env->CallStaticObjectMethod(cls, mid, objCallback, camera_index);
        env->DeleteLocalRef(objCallback);
    } else
    {
        RAWLOG_ERROR1("Cannot take barcode, no memory: %d", strlen(callback));
    }
}
开发者ID:4nkh,项目名称:rhodes,代码行数:36,代码来源:barcode.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ RAWTRACE函数代码示例发布时间:2022-05-30
下一篇:
C++ RAWLOG_ERROR函数代码示例发布时间: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