本文整理汇总了C++中xmlrpc_c::paramList::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ paramList::getString方法的具体用法?C++ paramList::getString怎么用?C++ paramList::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpc_c::paramList
的用法示例。
在下文中一共展示了paramList::getString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exception
void devTcp4Client_Interface::client_create(xmlrpc_c::paramList const& paramList,
xmlrpc_c::value* retvalP) {
ACE_TRACE("devTcp4Client_Interface::create");
std::string devname = static_cast<std::string>(paramList.getString(0));
if (devices::instance()->exists(devname)) {
throw Exception("Device with that name already exists.");
}
std::string address = IPv4Addr::IPv4_Any;
int port = 0;
devTcp4Client* tcp4_dev = new devTcp4Client(devname, this);
devices::instance()->add(tcp4_dev);
if (paramList.size() > 1) {
address = static_cast<std::string>(paramList.getString(2));
tcp4_dev->setAddress(address);
}
if (paramList.size() > 2) {
port = static_cast<int>(paramList.getInt(3));
tcp4_dev->setPort(port);
if (port > 0) tcp4_dev->openConnection();
}
*retvalP = xmlrpc_c::value_nil();
}
示例2: execute
void RegisterDeviceHandler::execute(xmlrpc_c::paramList const& paramList, xmlrpc_c::value * const retvalP){
std::string device(paramList.getString(0));
LOG_INFO("Register device: " << device);
*retvalP = xmlrpc_c::value_int(1337);
}
示例3:
/** Execute method.
* @param params parameters
* @param result result value
*/
void
XmlRpcLogMethods::log_log::execute(xmlrpc_c::paramList const& params,
xmlrpc_c::value * const result)
{
std::string component = params.getString(0);
std::string message = params.getString(1);
__logger->log(__log_level, component.c_str(), "%s", message.c_str());
*result = xmlrpc_c::value_nil();
}
示例4:
void devTcp4Client_Interface::client_get_address(xmlrpc_c::paramList const& paramList,
xmlrpc_c::value* retvalP) {
ACE_TRACE("devTcp4Client_Interface::get_address");
std::string devname = static_cast<std::string>(paramList.getString(0));
devTcp4Client* tcp4_dev = dynamic_cast<devTcp4Client*>(devices::instance()->device(devname));
std::string address = tcp4_dev->getAddress();
*retvalP = xmlrpc_c::value_string(address);
}
示例5:
void devUdp4_Interface::dev_udp_bind(xmlrpc_c::paramList const& paramList,
xmlrpc_c::value* retvalP) {
ACE_TRACE("devUdp4_Interface::get_port");
std::string devname = static_cast<std::string>(paramList.getString(0));
devUdp4* udp4_dev = dynamic_cast<devUdp4*>(devices::instance()->device(devname));
udp4_dev->bindSocket();
*retvalP = xmlrpc_c::value_nil();
}
示例6: execute
void execute(xmlrpc_c::paramList const& paramList, xmlrpc_c::value* const retvalP)
{
chair = paramList.getInt(0);
symbol_name = paramList.getString(1);
SetEvent(symbol_need);
DWORD wait_result;
wait_result = WaitForSingleObject(symbol_ready, INFINITE);
if(WAIT_OBJECT_0 == wait_result)
{
*retvalP = xmlrpc_c::value_double(symbol_value);
} else {
msg(L"Something went wrong.", L"openholdem-xmlrpc-dll");
}
}
示例7: fault
/** Execute method.
* @param params parameters
* @param result result value
*/
void
XmlRpcPluginMethods::plugin_unload::execute(xmlrpc_c::paramList const& params,
xmlrpc_c::value * const result)
{
try {
std::string plugin_name = params.getString(0);
__plugin_manager->unload(plugin_name.c_str());
} catch (girerr::error &e) {
throw xmlrpc_c::fault(e.what(), xmlrpc_c::fault::CODE_UNSPECIFIED);
} catch (fawkes::Exception &e) {
__logger->log_warn("XML-RPC plugin.unload", e);
*result = xmlrpc_c::value_boolean(false);
}
*result = xmlrpc_c::value_boolean(true);
}
示例8: execute
void METHOD_MESSAGE_SEND::execute(xmlrpc_c::paramList const & paramList,
xmlrpc_c::value * const retvalPtr)
{
std::string cookie = paramList.getString(0);
std::vector<xmlrpc_c::value> logins(paramList.getArray(1));
std::map<std::string, xmlrpc_c::value> msgInfo(paramList.getStruct(2));
paramList.verifyEnd(3);
ADMIN_INFO adminInfo;
if (config->GetAdminInfo(cookie, &adminInfo))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
}
STG_MSG message;
std::map<std::string, xmlrpc_c::value>::iterator it;
if ((it = msgInfo.find("version")) == msgInfo.end())
{
message.header.ver = 1; // Default value
}
else
{
message.header.ver = xmlrpc_c::value_int(it->second);
}
if ((it = msgInfo.find("type")) == msgInfo.end())
{
message.header.type = 1; // default value
}
else
{
message.header.type = xmlrpc_c::value_int(it->second);
}
if ((it = msgInfo.find("repeat")) == msgInfo.end())
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
}
message.header.repeat = xmlrpc_c::value_int(it->second);
if ((it = msgInfo.find("repeat_period")) == msgInfo.end())
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
}
message.header.repeatPeriod = xmlrpc_c::value_int(it->second);
if ((it = msgInfo.find("show_time")) == msgInfo.end())
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
}
message.header.showTime = xmlrpc_c::value_int(it->second);
if ((it = msgInfo.find("text")) == msgInfo.end())
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
}
message.text = IconvString(xmlrpc_c::value_string(it->second), "UTF-8", "CP1251");
message.header.creationTime = static_cast<int>(stgTime);
message.header.lastSendTime = 0;
std::vector<xmlrpc_c::value>::iterator lit;
for (lit = logins.begin(); lit != logins.end(); ++lit)
{
USER_PTR ui;
if (users->FindByName(xmlrpc_c::value_string(*lit), &ui))
{
printfd(__FILE__, "METHOD_MESSAGE_SEND::execute(): 'User '%s' not found'\n", std::string(xmlrpc_c::value_string(*lit)).c_str());
}
else
{
ui->AddMessage(&message);
}
}
*retvalPtr = xmlrpc_c::value_boolean(true);
}