本文整理汇总了C++中IOBuffer::ReadFromString方法的典型用法代码示例。如果您正苦于以下问题:C++ IOBuffer::ReadFromString方法的具体用法?C++ IOBuffer::ReadFromString怎么用?C++ IOBuffer::ReadFromString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOBuffer
的用法示例。
在下文中一共展示了IOBuffer::ReadFromString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeToBuffer
void AtomURL::SerializeToBuffer(IOBuffer& data, uint32_t maxFrames) {
uint32_t start=GETAVAILABLEBYTESCOUNT(data);
VersionedAtom::SerializeToBuffer(data, maxFrames);
data.ReadFromString(_location);
_size=GETAVAILABLEBYTESCOUNT(data)-start;
*(uint32_t*)(GETIBPOINTER(data)+start) = endianSwap32(_size);
}
示例2: EHTONS
bool AMF0Serializer::WriteShortString(IOBuffer &buffer, string &value, bool writeType) {
if (writeType)
buffer.ReadFromRepeat(AMF0_SHORT_STRING, 1);
uint16_t length = EHTONS((uint16_t) value.length()); //----MARKED-SHORT----
buffer.ReadFromBuffer((uint8_t *) & length, 2);
buffer.ReadFromString(value);
return true;
}
示例3: EHTONL
bool AMF0Serializer::WriteLongString(IOBuffer &buffer, string &value, bool writeType) {
if (writeType)
buffer.ReadFromRepeat(AMF0_LONG_STRING, 1);
uint32_t length = EHTONL((uint32_t) value.length());
buffer.ReadFromBuffer((uint8_t *) & length, 4);
buffer.ReadFromString(value);
return true;
}
示例4: STR
void MP44HTTPStream::SignalAttachedToInStream() {
//INFO("http mjpg stream attached");
// _pAVProtocol->SendHttpResponseHeader(206, _fileSize, offset);
#if 0
IOBuffer *pBuffer = _pAVProtocol->GetProtocolOutputBuffer();
_pAVProtocol->SetStatusCode(206);
pBuffer->ReadFromString(format("%s\r\n", STR(_pAVProtocol->GetOutputFirstLine())));
pBuffer->ReadFromString(HTTP_HEADERS_SERVER": "HTTP_HEADERS_SERVER_US"\r\n");
pBuffer->ReadFromString(HTTP_HEADERS_X_POWERED_BY": "HTTP_HEADERS_X_POWERED_BY_US"\r\n");
pBuffer->ReadFromString(HTTP_HEADERS_ACCESS_ORIGIN": *\r\n");
//FIXME: fix keep-alive issues for rtmp playback
//pBuffer->ReadFromString("Connection: Close\r\n");
pBuffer->ReadFromString("Connection: Keep-Alive\r\n");
pBuffer->ReadFromString("Keep-Alive: timeout=5, max=100\r\n");
pBuffer->ReadFromString("Accept-Ranges: bytes\r\n");
pBuffer->ReadFromString(format("Content-Range: bytes 0-%"PRIu64"/%"PRIu64"\r\n", _fileSize-1, _fileSize));
pBuffer->ReadFromString(HTTP_HEADERS_CONTENT_TYPE": video/mp4\r\n");
pBuffer->ReadFromString(format("%s: %"PRIu64" \r\n\r\n", HTTP_HEADERS_CONTENT_LENGTH, _fileSize));
_pAVProtocol->EnqueueForOutbound();
#endif
}