当前位置: 首页>>代码示例>>C++>>正文


C++ RAWLOG_ERROR1函数代码示例

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


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


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