// mapped to: std::basic_string<char> * nextView2(int i, long int l, std::string & s, bool * const b, char c) const;
ulxr::MethodResponse
  UlxrIdlTestServer::nextView2 (const ulxr::MethodCall &calldata)
{
  try
  {
    int p0 = (int) ulxr::Integer(calldata.getParam(0)).getInteger();
    long int p1 = (long int) ulxr::Integer(calldata.getParam(1)).getInteger();
    std::string p2 = (std::string) ulxr::getLatin1(ulxr::RpcString(calldata.getParam(2)).getString());
    bool p3 = (bool) ulxr::Boolean(calldata.getParam(3)).getBoolean();
    char p4 = (char) ulxr::Integer(calldata.getParam(4)).getInteger();
    std::string retval = *server.nextView2(p0, p1, p2, &p3, p4);
    return ulxr::MethodResponse (ulxr::RpcString (ULXR_GET_STRING(retval)));
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'std::basic_string<char> * nextView2(int i, long int l, std::string & s, bool * const b, char c) const;'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'std::basic_string<char> * nextView2(int i, long int l, std::string & s, bool * const b, char c) const;'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}
Пример #2
0
ulxr::MethodResponse checkaccess (const ulxr::MethodCall &calldata)
{
  ulxr::RpcString rpcs = calldata.getParam(0);
  std::string s = "Access allow";
  ulxr::MethodResponse resp;
  resp.setResult(ulxr::RpcString(s));
  return resp;
}
Пример #3
0
    ulxr::MethodResponse echo(const ulxr::MethodCall &args)
    {
        // args: int, boolean, double, date, date, string, base64, array of int, struct {int, array of struct {string, bool} }
        int myIntArg = ulxr::Integer(args.getParam(0)).getInteger();
        bool myBoolArg = ulxr::Boolean(args.getParam(1)).getBoolean();
        double myDoubleArg = ulxr::Double(args.getParam(2)).getDouble();
        std::string myDateArg1 = ulxr::DateTime(args.getParam(3)).getDateTime();
        std::string myDateArg2 = ulxr::DateTime(args.getParam(4)).getDateTime();
        std::string myStrArg = ulxr::RpcString(args.getParam(5)).getString();
        std::string myB64Arg = ulxr::Base64(args.getParam(6)).getString();
        std::vector<int> myArrIntArg = deserializeIntArray<std::vector<int> >(ulxr::Array(args.getParam(7)));
        MyStruct myStructArg = deserializeMyStruct(ulxr::Struct(args.getParam(8)));

        ulxr::MethodResponse resp;
        ulxr::Struct myRetVal;
        myRetVal << ulxr::make_member("arg1", ulxr::Integer(myIntArg))
                 << ulxr::make_member("arg2", ulxr::Boolean(myBoolArg))
                 << ulxr::make_member("arg3", ulxr::Double(myDoubleArg))
                 << ulxr::make_member("arg4", ulxr::DateTime(myDateArg1))
                 << ulxr::make_member("arg5", ulxr::DateTime(myDateArg2))
                 << ulxr::make_member("arg6", ulxr::RpcString(myStrArg))
                 << ulxr::make_member("arg7", ulxr::Base64(myB64Arg))
                 << ulxr::make_member("arg8", serializeIntContainer<std::vector<int> >(myArrIntArg))
                 << ulxr::make_member("arg9", serializeMyStruct(myStructArg));

        resp.setResult(myRetVal);
        return resp;
    }
Пример #4
0
static ulxr::MethodResponse ServerChat(ulxr::MethodCall methodcall)
{
  ulxr::MethodResponse response;
  std::string strServerUrl = "api.opensubtitles.org";
  std::string method = methodcall.getMethodName();
  try
  {
    std::unique_ptr<ulxr::TcpIpConnection> connection(new ulxr::TcpIpConnection(false, ULXR_PCHAR(strServerUrl), 80));
    ulxr::HttpProtocol    protocol(connection.get());
    ulxr::Requester       client(&protocol);
    response = client.call(methodcall, ULXR_PCHAR("/xml-rpc"));
    CLog::Log(LOGDEBUG, "%s - finished -  %s", __PRETTY_FUNCTION__, method.c_str());
  }
  catch(...)
  {
    std::string method = methodcall.getMethodName();
    CLog::Log(LOGDEBUG, "%s - crashed with %s", __PRETTY_FUNCTION__, method.c_str());
  }
  
  return response;
}
// mapped to: std::string * inline_func::free_function2(long int * i, float f);   (there are overloaded methods)
ulxr::MethodResponse
  UlxrIdlTestFuncs_inline_func__free_function2 (const ulxr::MethodCall &calldata)
{
  try
  {
    long int p0 = (long int) ulxr::Integer(calldata.getParam(0)).getInteger();
    float p1 = (float) ulxr::Double(calldata.getParam(1)).getDouble();
    std::string retval = *inline_func::free_function2(&p0, p1);
    return ulxr::MethodResponse (ulxr::RpcString (ULXR_GET_STRING(retval)));
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'std::string * inline_func::free_function2(long int * i, float f);'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'std::string * inline_func::free_function2(long int * i, float f);'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}
Пример #6
0
ulxr::MethodResponse check (const ulxr::MethodCall &calldata)
{

	pid_t pid=getpid();
	std::cout<<"It is a check query. Process handle pid: "<<pid<<std::endl;

	ulxr::RpcString rpcs = calldata.getParam(0);
	std::string s = "It is RPC server."
  			"Your query string is: "+rpcs.getString();
	ulxr::MethodResponse resp;
	resp.setResult(ulxr::RpcString(s));
	return resp;
}
// mapped to: std::string * first_url4(long int li);   (there are overloaded methods)
ulxr::MethodResponse
  UlxrIdlTestServer::first_url4_ovr2 (const ulxr::MethodCall &calldata)
{
  try
  {
    long int p0 = (long int) ulxr::Integer(calldata.getParam(0)).getInteger();
    std::string retval = *server.first_url4(p0);
    return ulxr::MethodResponse (ulxr::RpcString (ULXR_GET_STRING(retval)));
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'std::string * first_url4(long int li);'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'std::string * first_url4(long int li);'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}
// mapped to: int getNumPages(const std::wstring & s);
ulxr::MethodResponse
  UlxrIdlTestServer::getNumPages (const ulxr::MethodCall &calldata)
{
  try
  {
    std::wstring p0 = (std::wstring) ulxr::getUnicode(ulxr::RpcString(calldata.getParam(0)).getString());
    long int retval = server.getNumPages(p0);
    return ulxr::MethodResponse (ulxr::Integer (retval));
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'int getNumPages(const std::wstring & s);'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'int getNumPages(const std::wstring & s);'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}
// mapped to: const std::basic_string<wchar_t> * getObject(const std::string & s);
ulxr::MethodResponse
  UlxrIdlTestServer::getObject (const ulxr::MethodCall &calldata)
{
  try
  {
    std::string p0 = (std::string) ulxr::getLatin1(ulxr::RpcString(calldata.getParam(0)).getString());
    std::wstring retval = *server.getObject(p0);
    return ulxr::MethodResponse (ulxr::RpcString (ULXR_GET_STRING(retval)));
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'const std::basic_string<wchar_t> * getObject(const std::string & s);'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'const std::basic_string<wchar_t> * getObject(const std::string & s);'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}
// mapped to: void getNumObjects(std::string s);
ulxr::MethodResponse
  UlxrIdlTestServer::getNumObjects (const ulxr::MethodCall &calldata)
{
  try
  {
    std::string p0 = (std::string) ulxr::getLatin1(ulxr::RpcString(calldata.getParam(0)).getString());
    server.getNumObjects(p0);
    return ulxr::MethodResponse (ulxr::Void());
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'void getNumObjects(std::string s);'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'void getNumObjects(std::string s);'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}
// mapped to: wchar_t * const first_url4(double li);   (there are overloaded methods)
ulxr::MethodResponse
  UlxrIdlTestServer::first_url4_ovr0 (const ulxr::MethodCall &calldata)
{
  try
  {
    double p0 = (double) ulxr::Double(calldata.getParam(0)).getDouble();
    std::wstring retval = server.first_url4(p0);
    return ulxr::MethodResponse (ulxr::RpcString (ULXR_GET_STRING(retval)));
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'wchar_t * const first_url4(double li);'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'wchar_t * const first_url4(double li);'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}
// mapped to: void funcs::free_function1(int i);   (there are overloaded methods)
ulxr::MethodResponse
  UlxrIdlTestFuncs_funcs__free_function1_ovr0 (const ulxr::MethodCall &calldata)
{
  try
  {
    int p0 = (int) ulxr::Integer(calldata.getParam(0)).getInteger();
    funcs::free_function1(p0);
    return ulxr::MethodResponse (ulxr::Void());
  }
  catch(std::exception &ex)
  {
    ulxr::CppString s = ULXR_PCHAR("C++ exception caught when invoking 'void funcs::free_function1(int i);'\n  ");
    s += ULXR_GET_STRING(ex.what());
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
  catch(...)
  {
    ulxr::CppString s = ULXR_PCHAR("Unknown exception caught when invoking 'void funcs::free_function1(int i);'");
    return ulxr::MethodResponse(ulxr::ApplicationError, s);
  }
}