本文整理汇总了C++中Encoder::encodeFixedLengthData方法的典型用法代码示例。如果您正苦于以下问题:C++ Encoder::encodeFixedLengthData方法的具体用法?C++ Encoder::encodeFixedLengthData怎么用?C++ Encoder::encodeFixedLengthData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encoder
的用法示例。
在下文中一共展示了Encoder::encodeFixedLengthData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
{
// FIXME: Cocoa CertificateInfo is a CF object tree. Generalize CF type coding so we don't need to use ArgumentCoder here.
IPC::ArgumentEncoder argumentEncoder;
argumentEncoder << certificateInfo;
encoder << static_cast<uint64_t>(argumentEncoder.bufferSize());
encoder.encodeFixedLengthData(argumentEncoder.buffer(), argumentEncoder.bufferSize());
}
示例2: encodeCFData
static void encodeCFData(Encoder& encoder, CFDataRef data)
{
uint64_t length = CFDataGetLength(data);
const uint8_t* bytePtr = CFDataGetBytePtr(data);
encoder << length;
encoder.encodeFixedLengthData(bytePtr, length);
}
示例3: sizeof
void ArgumentCoder<String>::encode(Encoder& encoder, const String& string)
{
// Special case the null string.
if (string.isNull()) {
encoder << std::numeric_limits<uint32_t>::max();
return;
}
uint32_t length = string.length();
bool is8Bit = string.is8Bit();
encoder << length << is8Bit;
if (is8Bit)
encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters8()), length * sizeof(LChar), alignof(LChar));
else
encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters16()), length * sizeof(UChar), alignof(UChar));
}
示例4:
void ArgumentCoder<CString>::encode(Encoder& encoder, const CString& string)
{
// Special case the null string.
if (string.isNull()) {
encoder << std::numeric_limits<uint32_t>::max();
return;
}
uint32_t length = string.length();
encoder << length;
encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.data()), length, 1);
}
示例5: adoptGRef
void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
{
if (!certificateInfo.certificate()) {
encoder << false;
return;
}
GByteArray* certificateData = 0;
g_object_get(G_OBJECT(certificateInfo.certificate()), "certificate", &certificateData, NULL);
if (!certificateData) {
encoder << false;
return;
}
encoder << true;
GRefPtr<GByteArray> certificate = adoptGRef(certificateData);
encoder << static_cast<uint64_t>(certificate->len);
encoder.encodeFixedLengthData(certificate->data, certificate->len);
encoder << static_cast<uint32_t>(certificateInfo.tlsErrors());
}
示例6: sizeof
void Coder<SHA1::Digest>::encode(Encoder& encoder, const SHA1::Digest& digest)
{
encoder.encodeFixedLengthData(digest.data(), sizeof(digest));
}