当前位置: 首页>>代码示例>>C++>>正文


C++ IOBuffer::ReadFromString方法代码示例

本文整理汇总了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);
}
开发者ID:OpenQCam,项目名称:qcam,代码行数:7,代码来源:atomurl.cpp

示例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;
}
开发者ID:Undev,项目名称:crtmpserver,代码行数:11,代码来源:amf0serializer.cpp

示例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;
}
开发者ID:Undev,项目名称:crtmpserver,代码行数:11,代码来源:amf0serializer.cpp

示例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
}
开发者ID:OpenQCam,项目名称:qcam,代码行数:23,代码来源:mp44httpstream.cpp


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