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

C++ payload函数代码示例

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

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



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

示例1: payload

bool AddInterfaceEC::parsePayload(connector::EditingCommandData* ecd)
{
        // addLink(baseID, documentID, compositeId, xmlLink)
        unsigned int argsLength = 0;
        std::string payload ((const char *)ecd->getPayload(), (size_t)ecd->getPayloadSize());
        std::vector<std::string>* tokens = util::split(payload, ",");
        int token_cnt = tokens->size();
        if (token_cnt > 3) {
		baseId = (*tokens)[0];
		argsLength += baseId.length();
		
		documentId = (*tokens)[1];
		argsLength += documentId.length();

		nodeId = (*tokens)[2];
		argsLength += nodeId.length();
		
		argsLength += 3; //por las comas
		xmlInterface = payload.substr(argsLength, payload.length() - argsLength);
		
		delete tokens;
		return true;
	} else {
		delete tokens;
		return false;
	}	
}
开发者ID:Gingar,项目名称:port,代码行数:27,代码来源:editingcommandevents.cpp


示例2: payload

/*!
    Returns the encoding of the contents.
*/
QNdefNfcTextRecord::Encoding QNdefNfcTextRecord::encoding() const
{
    if (payload().isEmpty())
        return Utf8;

    QByteArray p = payload();

    quint8 status = p.at(0);

    bool utf16 = status & 0x80;

    if (utf16)
        return Utf16;
    else
        return Utf8;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:19,代码来源:qndefnfctextrecord.cpp


示例3: exe_trace

static char exe_trace(fdja_value *node, fdja_value *exe)
{
  fdja_value *pl = payload(exe);

  fdja_value *trace = fdja_l(pl, "trace");
  if (trace == NULL) trace = fdja_set(pl, "trace", fdja_array_malloc());

  fdja_value *atts = attributes(node, exe);

  if (atts->child == NULL)
  {
    fdja_value *ret = fdja_l(exe, "payload.ret");
    fdja_push(trace, ret ? fdja_clone(ret) : fdja_v("null"));
  }
  else if (atts->child && atts->child->sibling == NULL)
  {
    fdja_push(trace, fdja_lc(atts, "_0"));
  }
  else
  {
    fdja_push(trace, shrink_atts(atts));
  }

  fdja_free(atts);

  return 'v'; // over
}
开发者ID:flon-io,项目名称:flon,代码行数:27,代码来源:fl_n_trace.c


示例4: lagTestFinished

void AddressTester::onConnected()
{
    timer.stop();
    emit lagTestFinished(time.msecsTo(QTime::currentTime()));
    if (testingConnectivity) {
        Encryptor encryptor(encryptionMethod, encryptionPassword);
        /*
         * A http request to Google to test connectivity
         * The payload is dumped from
         * `curl http://www.google.com --socks5 127.0.0.1:1080`
         *
         * TODO: find a better way to check connectivity
         */
        std::string dest =
                Common::packAddress(Address("www.google.com", 80));
        static const QByteArray expected = QByteArray::fromHex(
                        "474554202f20485454502f312e310d0a486f73743a"
                        "207777772e676f6f676c652e636f6d0d0a55736572"
                        "2d4167656e743a206375726c2f372e34332e300d0a"
                        "4163636570743a202a2f2a0d0a0d0a");
        std::string payload(expected.data(), expected.length());
        std::string toWrite = encryptor.encrypt(dest + payload);
        socket.write(toWrite.data(), toWrite.size());
    } else {
        socket.abort();
    }
}
开发者ID:ForMyLoveLys,项目名称:libQtShadowsocks,代码行数:27,代码来源:addresstester.cpp


示例5: pathandquery_social_subpath

pplx::task<xbox_live_result<xbox_social_relationship_result>>
social_service_impl::get_social_relationships(
    _In_ const string_t& xboxUserId,
    _In_ xbox_social_relationship_filter filter,
    _In_ unsigned int startIndex,
    _In_ unsigned int maxItems
    )
{
    bool includeViewFilter = (filter != xbox_social_relationship_filter::all);

    string_t pathAndQuery = pathandquery_social_subpath(
        xboxUserId,
        includeViewFilter,
        xbox_social_relationship_filter_to_string(filter),
        startIndex,
        maxItems
        );

    std::shared_ptr<http_call> httpCall = xbox::services::system::xbox_system_factory::get_factory()->create_http_call(
        m_xboxLiveContextSettings,
        _T("GET"),
        utils::create_xboxlive_endpoint(_T("social"), m_appConfig),
        pathAndQuery,
        xbox_live_api::get_social_relationships
        );

    auto userContext = m_userContext;
    auto xboxLiveContextSettings = m_xboxLiveContextSettings;
    auto appConfig = m_appConfig;

    std::shared_ptr<social_service_impl> thisShared = shared_from_this();
    auto task = httpCall->get_response_with_auth(m_userContext)
    .then([thisShared, userContext, xboxLiveContextSettings, appConfig, startIndex, filter](std::shared_ptr<http_call_response> response)
    {
        auto result = xbox_social_relationship_result::_Deserialize(response->response_body_json());

        auto& socialRelationship = result.payload();
        uint32_t itemSize = static_cast<uint32_t>(socialRelationship.items().size());
        if (itemSize > 0)
        {
            unsigned continuationSkip = startIndex + itemSize;
            
            // Initialize the request params for get_next()
            socialRelationship._Init_next_page_info(
                thisShared,
                filter,
                continuationSkip
                );
        }

        return utils::generate_xbox_live_result<xbox_social_relationship_result>(
            result,
            response
            );
    });

    return utils::create_exception_free_task<xbox_social_relationship_result>(
        task
        );
}
开发者ID:heatha7979,项目名称:xbox-live-api,代码行数:60,代码来源:social_service_impl.cpp


示例6: _main

void _main()
{
	Handle fileHandle = 0x0;
	Result ret = 0x0;

	u32 compressed_size = 0x0;
	u8* compressed_buffer = LINEAR_BUFFER;

	// load payload.bin from savegame
	ret = _FSUSER_OpenFileDirectly(fsHandle, &fileHandle, 0x0, 0x00000004, PATH_EMPTY, "", 1, PATH_CHAR, "/payload.bin", 13, 0x1, 0x0);
	if(ret)*(u32*)ret = 0xdead0001;

	ret = _FSUSER_ReadFile(&fileHandle, &compressed_size, 0x0, compressed_buffer, 0xA000);
	if(ret)*(u32*)ret = 0xdead0002;

	u8* decompressed_buffer = &compressed_buffer[(compressed_size + 0xfff) & ~0xfff];
	u32 decompressed_size = lzss_get_decompressed_size(compressed_buffer, compressed_size);

	// decompress payload
	ret = lzss_decompress(compressed_buffer, compressed_size, decompressed_buffer, decompressed_size);

	// copy payload to text
	ret = _GSPGPU_FlushDataCache(gspHandle, 0xFFFF8001, (u32*)decompressed_buffer, decompressed_size);
	ret = gspwn((void*)(IRON_CODE_LINEAR_BASE + 0x00101000 - 0x00100000), decompressed_buffer, (decompressed_size + 0x1f) & ~0x1f);
	svc_sleepThread(300*1000*1000);

	// ghetto dcache invalidation
	// don't judge me
	int i, j;//, k;
	// for(k=0; k<0x2; k++)
		for(j=0; j<0x4; j++)
			for(i=0; i<0x01000000/0x4; i+=0x4)
				LINEAR_BUFFER[i+j]^=0xDEADBABE;

	// put framebuffers in linear mem so they're writable
	u8* top_framebuffer = &LINEAR_BUFFER[0x00100000];
	u8* low_framebuffer = &top_framebuffer[0x00046500];
	_GSPGPU_SetBufferSwap(*gspHandle, 0, (GSP_FramebufferInfo){0, (u32*)top_framebuffer, (u32*)top_framebuffer, 240 * 3, (1<<8)|(1<<6)|1, 0, 0});
	_GSPGPU_SetBufferSwap(*gspHandle, 1, (GSP_FramebufferInfo){0, (u32*)low_framebuffer, (u32*)low_framebuffer, 240 * 3, 1, 0, 0});

	// un-init DSP so killing Ironfall will work
	_DSP_UnloadComponent(dspHandle);
	_DSP_RegisterInterruptEvents(dspHandle, 0x0, 0x2, 0x2);

	// run payload
	{
		void (*payload)(u32* paramlk, u32* stack_pointer) = (void*)0x00101000;
		u32* paramblk = (u32*)LINEAR_BUFFER;

		paramblk[0x1c >> 2] = IRON_GSPGPU_GXCMD4;
		paramblk[0x20 >> 2] = IRON_GSPGPU_FLUSHDATACACHE_WRAPPER;
		paramblk[0x48 >> 2] = 0x8d; // flags
		paramblk[0x58 >> 2] = IRON_GSPGPU_HANDLE;
		paramblk[0x64 >> 2] = 0x08010000;

		payload(paramblk, (u32*)(0x10000000 - 4));
	}

	*(u32*)ret = 0xdead0008;
}
开发者ID:meowy,项目名称:ironhax,代码行数:60,代码来源:main.c


示例7: test_reuse_helper

inline void test_reuse_helper(Encoder encoder, Decoder decoder)
{
    std::vector<uint8_t> payload(encoder->payload_size());

    std::vector<uint8_t> data_in = random_vector(encoder->block_size());
    sak::mutable_storage storage_in = sak::storage(data_in);

    encoder->set_symbols(storage_in);

    // Set the encoder non-systematic
    if(kodo::is_systematic_encoder(encoder))
        kodo::set_systematic_off(encoder);

    while( !decoder->is_complete() )
    {
        uint32_t payload_used = encoder->encode( &payload[0] );
        EXPECT_TRUE(payload_used <= encoder->payload_size());

        decoder->decode( &payload[0] );
    }

    std::vector<uint8_t> data_out(decoder->block_size(), '\0');
    decoder->copy_symbols(sak::storage(data_out));

    EXPECT_TRUE(std::equal(data_out.begin(),
                           data_out.end(),
                           data_in.begin()));

}
开发者ID:cocoriuse,项目名称:kodo,代码行数:29,代码来源:helper_test_reuse_api.hpp


示例8: initializeData

/*!
  \brief Deletes any details currently stored in the Smart Poster
  and re-initializes them by parsing the contents of the payload.
  */
void NdefNfcSpRecord::parseRecords()
{
    initializeData();
    QNdefMessage message = QNdefMessage::fromByteArray(payload());
    qDebug() << "Sp Record Count: " << message.count();

    foreach (const QNdefRecord &record, message) {
        qDebug() << "Sp Record type: " << QString(record.type());
        qDebug() << "Sp Type name: " << record.typeNameFormat();

        // URI
        if (record.isRecordType<QNdefNfcUriRecord>()) {
            if (recordUri) { delete recordUri; recordUri = NULL; }
            recordUri = new QNdefNfcUriRecord(record);
            qDebug() << "Sp URI: " << recordUri->uri().toString();
        }
        // Title
        else if (record.isRecordType<QNdefNfcTextRecord>()) {
            QNdefNfcTextRecord* recordTitle = new QNdefNfcTextRecord(record);
            addTitle(*recordTitle);
            if (!recordTitleList.isEmpty()) {
                qDebug() << "Sp Title: " << recordTitleList.last().text();
            }
        }
        // Image
        else if (record.typeNameFormat() == QNdefRecord::Mime &&
                   record.type().startsWith("image/")) {
            if (recordImage) { delete recordImage; recordImage = NULL; }
            recordImage = new NdefNfcMimeImageRecord(record);
            qDebug() << "Sp Image: " << recordImage->format();
        }
        // Action
        else if (record.typeNameFormat() == QNdefRecord::NfcRtd &&
                 QString(record.type()) == "act") {
            if (recordAction) { delete recordAction; recordAction = NULL; }
            recordAction = new NdefNfcActRecord(record);
            qDebug() << "Sp Action: " << action();
        }
        // Size
        else if (record.typeNameFormat() == QNdefRecord::NfcRtd &&
                 QString(record.type()) == "s") {
            if (recordSize) { delete recordSize; recordSize = NULL; }
            recordSize = new NdefNfcSizeRecord(record);
            qDebug() << "Sp Size: " << size();
        }
        // Type
        else if (record.typeNameFormat() == QNdefRecord::NfcRtd &&
                 QString(record.type()) == "t") {
            if (recordType) { delete recordType; recordType = NULL; }
            recordType = new NdefNfcTypeRecord(record);
            qDebug() << "Sp Type: " << type();
        }
        else
        {
            // This class handles all records defined in the Smart Poster
            // specification, so this case should never happen for a valid
            // Smart Poster record in the current version.
            qDebug() << "Sp: Don't know how to handle this record";
        }
    }
开发者ID:rlinfati,项目名称:nfcwriter,代码行数:64,代码来源:ndefnfcsprecord.cpp


示例9:

void
device_presence_change_subscription::on_subscription_created(
    _In_ uint32_t id, 
    _In_ const web::json::value& data
    )
{
    real_time_activity_subscription::on_subscription_created(id, data);
    xbox_live_result<device_presence_change_event_args> devicePresenceChangeArgs;

    if (!data.is_null())
    {
        auto initialPresenceRecord = presence_record::_Deserialize(data);

        if (!initialPresenceRecord.err())
        {
            if (m_devicePresenceChangeHandler != nullptr)
            {
                for (const auto& deviceRecord : initialPresenceRecord.payload().presence_device_records())
                {
                    auto deviceType = deviceRecord.device_type();

                    m_devicePresenceChangeHandler(
                        device_presence_change_event_args(
                            m_xboxUserId,
                            deviceType,
                            true
                            )
                        );
                }
            }
        }
        else
        {
            if (m_subscriptionErrorHandler != nullptr)
            {
                m_subscriptionErrorHandler(
                    xbox::services::real_time_activity::real_time_activity_subscription_error_event_args(
                        *this,
                        xbox_live_error_code::json_error,
                        "JSON Deserialization Failure"
                        )
                    );
            }
        }
    }
    else
    {
        if (m_subscriptionErrorHandler != nullptr)
        {
            m_subscriptionErrorHandler(
                xbox::services::real_time_activity::real_time_activity_subscription_error_event_args(
                    *this,
                    xbox_live_error_code::json_error,
                    "JSON Not Found"
                    )
                );
        }
    }
}
开发者ID:heatha7979,项目名称:xbox-live-api,代码行数:59,代码来源:device_presence_change_subscription.cpp


示例10: src

QByteArray UBPacket::packetize(void) {
    QByteArray src(((char*)(&m_srcID)), sizeof(m_srcID));
    QByteArray des(((char*)(&m_desID)), sizeof(m_desID));

    QByteArray payload(m_payload);

    return src + des + payload;
}
开发者ID:jmodares,项目名称:explorer,代码行数:8,代码来源:UBPacket.cpp


示例11: payload

Collection<ByteArray> NotSpans::getPayload() {
    Collection<ByteArray> result;
    if (includeSpans->isPayloadAvailable()) {
        Collection<ByteArray> payload(includeSpans->getPayload());
        result = Collection<ByteArray>::newInstance(payload.begin(), payload.end());
    }
    return result;
}
开发者ID:304471720,项目名称:LucenePlusPlus,代码行数:8,代码来源:SpanNotQuery.cpp


示例12: MQTTMessageArrived

int MQTTMessageArrived(void* context, char* topicName, int topicLength, MQTTClient_message* message)
{
    std::vector<char> payload((char*)message->payload, (char*)message->payload + message->payloadlen);
    MQTTClient_freeMessage(&message);
    MQTTClient_free(topicName);
    GD::mqtt->messageReceived(payload);
    return 1;
}
开发者ID:MartinHaimberger,项目名称:Homegear,代码行数:8,代码来源:MQTT.cpp


示例13: CommandTraceFunction

void DeleteActivitiesCommand::GetActivityList()
{
	CommandTraceFunction();

	MojObject payload(MojObject::TypeObject);

	m_client.SendRequest(m_activityListSlot, "com.palm.activitymanager", "list", payload);
}
开发者ID:Garfonso,项目名称:app-services,代码行数:8,代码来源:DeleteActivitiesCommand.cpp


示例14: addr

int logClient::process(ACE_CString* s){
  ACE_SOCK_Stream logger;
  ACE_SOCK_Connector connector;
  ACE_INET_Addr addr(9876, "127.0.0.1");
  if(connector.connect(logger, addr) == -1){
    ACE_ERROR_RETURN((LM_ERROR, ACE_TEXT("%p \n"), ACE_TEXT("open")), -1);
  }
  ACE_Log_Record record(LM_DEBUG,
			ACE_OS::time ((time_t *) 0),
			ACE_OS::getpid());
  record.msg_data(s.c_str());
  const size_t max_payload_size =
    4
    + 8
    + 4
    + 4
    + ACE_Log_Record::MAXLOGMSGLEN
    + ACE_CDR::MAX_ALIGNMENT;
  ACE_OutputCDR payload(max_payload_size);
  payload<< record;

  ACE_CDR::ULong length =
    ACE_Utils::truncate_cast<ACE_CDR::ULong> (payload.total_length());

  ACE_OutputCDR header (ACE_CDR::MAX_ALIGNMENT + 8);
  header << ACE_OutputCDR::from_boolean (ACE_CDR_BYTE_ORDER);
  header << ACE_CDR::ULong(length);

  iovec iov[2];
  iov[0].iov_base = header.begin() -> rd_ptr();
  iov[0].iov_len = 8;
  iov[1].iov_base = payload.begin() -> rd_ptr();
  iov[1].iov_len = length;

  if (logger.sendv_n(iov, 2) ==  -1)
    ACE_ERROR_RETURN((LM_ERROR,"%p\n","send"), -1);

  /* 
   */
  ACE_Message_Block* header_p;
  auto_ptr<ACE_Message_Block> header(header_p);
  ACE_CDR::mb_align(header.get());
  
  ACE_Message_Block* payload_p;

  ssize_t count = logger.recv_n(header->wr_ptr(),8);
  switch(count){
  default:
  case -1:
  case 0:
  case 8:
    break;
  }

  header->wr_ptr(8);

  
}
开发者ID:jungu,项目名称:brokenseal,代码行数:58,代码来源:logClient.cpp


示例15: ntohs

	void presentation_message::check_format() const
	{
		if (length() < MIN_BODY_LENGTH)
		{
			throw std::runtime_error("bad message length");
		}

		uint16_t sig_len = ntohs(buffer_tools::get<uint16_t>(payload(), 0));

		if (sig_len == 0)
		{
			throw std::runtime_error("invalid sig_len");
		}

		cert_type sig_cert = cert_type::from_der(payload() + sizeof(uint16_t), sig_len);

		if (length() < MIN_BODY_LENGTH + sig_len)
		{
			throw std::runtime_error("sig_len value mismatch");
		}

		uint16_t enc_len = ntohs(buffer_tools::get<uint16_t>(payload(), sizeof(uint16_t) + sig_len));

		if (enc_len == 0)
		{
			if (length() != MIN_BODY_LENGTH + sig_len)
			{
				throw std::runtime_error("unexpected data after null enc_len");
			}
		}
		else
		{
			cert_type enc_cert = cert_type::from_der(payload() + MIN_BODY_LENGTH + sig_len, enc_len);

			if (cryptoplus::x509::compare(sig_cert.subject(), enc_cert.subject()) != 0)
			{
				throw std::runtime_error("certificate subject name do not match");
			}

			if (cryptoplus::x509::compare(sig_cert.issuer(), enc_cert.issuer()) != 0)
			{
				throw std::runtime_error("certificate issuer name do not match");
			}
		}
	}
开发者ID:reaper,项目名称:libfscp,代码行数:45,代码来源:presentation_message.cpp


示例16: theTop

Collection<ByteArray> OrSpans::getPayload() {
    Collection<ByteArray> result;
    SpansPtr theTop(top());
    if (theTop && theTop->isPayloadAvailable()) {
        Collection<ByteArray> payload(theTop->getPayload());
        result = Collection<ByteArray>::newInstance(payload.begin(), payload.end());
    }
    return result;
}
开发者ID:304471720,项目名称:LucenePlusPlus,代码行数:9,代码来源:SpanOrQuery.cpp


示例17: list_yama

static void list_yama(YAMA *yama) {
  yama_item *item;
  for (item = yama_latest(yama); item; item = yama_previous(item)) {
    char buf[80];
    time_t t = timestamp(item);
    strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M", gmtime(&t));
    printf("%08lx\t%s\t%.*s\n", id(item), buf, size(item), payload(item));
  }
}
开发者ID:aragaer,项目名称:libyama,代码行数:9,代码来源:client.c


示例18: geteuid

int  geteuid() {
  char *cmd;
  if (getenv("LD_PRELOAD") == NULL) { return 0; }
  unsetenv("LD_PRELOAD");
  if ((cmd = getenv("_evilcmd")) != NULL) {
    payload(cmd);
  }
  return 1;
}
开发者ID:tothi,项目名称:ctfs,代码行数:9,代码来源:evil.c


示例19: DP_ASSERT

      void TransformObserver::attach( dp::sg::core::TransformSharedPtr const & t, ObjectTreeIndex index )
      {
        DP_ASSERT( m_indexMap.find( index ) == m_indexMap.end() );

        DirtyPayloadSharedPtr payload( DirtyPayload::create( index ) );
        Observer<ObjectTreeIndex>::attach( t, payload );

        payload->m_dirty = true;
        m_dirtyPayloads.push_back( payload.operator->() );    // Big Hack !!
      }
开发者ID:swq0553,项目名称:pipeline,代码行数:10,代码来源:TransformObserver.cpp


示例20: ifcommon_do_all

/**
 * Execute if<xxx> command over all network devices
 *
 * @v payload		Command to execute
 * @ret rc		Exit code
 */
static int ifcommon_do_all ( int ( * payload ) ( struct net_device * ) ) {
	struct net_device *netdev;
	int rc = 0;

	/* Execute payload for each network device */
	for_each_netdev ( netdev ) {
		if ( payload ( netdev ) != 0 )
			rc = 1;
	}
	return rc;
}
开发者ID:pierre,项目名称:syslinux-fastboot,代码行数:17,代码来源:ifmgmt_cmd.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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