本文整理汇总了C++中StrPtrLen::PrintStr方法的典型用法代码示例。如果您正苦于以下问题:C++ StrPtrLen::PrintStr方法的具体用法?C++ StrPtrLen::PrintStr怎么用?C++ StrPtrLen::PrintStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrPtrLen
的用法示例。
在下文中一共展示了StrPtrLen::PrintStr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintLine
void SDPContainer::PrintLine(SInt32 lineIndex)
{
StrPtrLen *printLinePtr = GetLine(lineIndex);
if (printLinePtr)
{ printLinePtr->PrintStr();
qtss_printf("\n");
}
}
示例2: ReadRequest
//.........这里部分代码省略.........
// See if this is an interleaved data packet
if ('$' == *(fRequest.Ptr))
{
if (fRequest.Len < 4)
continue;
UInt16* dataLenP = (UInt16*)fRequest.Ptr;
UInt32 interleavedPacketLen = ntohs(dataLenP[1]) + 4;
if (interleavedPacketLen > fRequest.Len)
continue;
//put back any data that is not part of the header
fRetreatBytes += fRequest.Len - interleavedPacketLen;
fRequest.Len = interleavedPacketLen;
fRequestPtr = &fRequest;
fIsDataPacket = true;
return QTSS_RequestArrived;
}
fIsDataPacket = false;
if (fPrintRTSP)
{
DateBuffer theDate;
DateTranslator::UpdateDateBuffer(&theDate, 0); // get the current GMT date and time
qtss_printf("\n\n#C->S:\n#time: ms=%lu date=%s\n", (UInt32) OS::StartTimeMilli_Int(), theDate.GetDateBuffer());
if (fSocket != NULL)
{
UInt16 serverPort = fSocket->GetLocalPort();
UInt16 clientPort = fSocket->GetRemotePort();
StrPtrLen* theLocalAddrStr = fSocket->GetLocalAddrStr();
StrPtrLen* theRemoteAddrStr = fSocket->GetRemoteAddrStr();
if (theLocalAddrStr != NULL)
{ qtss_printf("#server: ip="); theLocalAddrStr->PrintStr(); qtss_printf(" port=%u\n" , serverPort );
}
else
{ qtss_printf("#server: ip=NULL port=%u\n" , serverPort );
}
if (theRemoteAddrStr != NULL)
{ qtss_printf("#client: ip="); theRemoteAddrStr->PrintStr(); qtss_printf(" port=%u\n" , clientPort );
}
else
{ qtss_printf("#client: ip=NULL port=%u\n" , clientPort );
}
}
StrPtrLen str(fRequest);
str.PrintStrEOL("\n\r\n", "\n");// print the request but stop on \n\r\n and add a \n afterwards.
}
//use a StringParser object to search for a double EOL, which signifies the end of
//the header.
Bool16 weAreDone = false;
StringParser headerParser(&fRequest);
UInt16 lcount = 0;
while (headerParser.GetThruEOL(NULL))
{
lcount++;
if (headerParser.ExpectEOL())
{
//The legal end-of-header sequences are \r\r, \r\n\r\n, & \n\n. NOT \r\n\r!
//If the packets arrive just a certain way, we could get here with the latter
//combo, and not wait for a final \n.
示例3: ReadRequest
//.........这里部分代码省略.........
fIsDataPacket = true;
return QTSS_RequestArrived;
}
fIsDataPacket = false;
/* 当打印RTSP info时,打印出如下信息:
(空两行)
#C->S;
#time: ms=*** data=Mon,29 July 2009 15:17:17 GTM
#server: ip=172.16.32.37 port=***
或#server: ip=NULL port=***
#client: ip=172.16.39.30 port=***
或#client: ip=NULL port=***
*********fRequest info***************
*/
if (fPrintRTSP)
{
/* 类似RTSPResponseStream::WriteV() */
/* 得到当前的GTM时间,格式为"Mon, 04 Nov 1996 21:42:17 GMT" */
DateBuffer theDate;
DateTranslator::UpdateDateBuffer(&theDate, 0); // get the current GMT date and time
/* OS::StartTimeMilli_Int()表示服务器运行多长时间? */
qtss_printf("\n\n#C->S:\n#time: ms=%lu date=%s\n", (UInt32) OS::StartTimeMilli_Int(), theDate.GetDateBuffer());
/* 假如有TCPSocket存在,就获取并打印其相关信息 */
if (fSocket != NULL)
{
UInt16 serverPort = fSocket->GetLocalPort();
UInt16 clientPort = fSocket->GetRemotePort();
StrPtrLen* theLocalAddrStr = fSocket->GetLocalAddrStr();
StrPtrLen* theRemoteAddrStr = fSocket->GetRemoteAddrStr();
if (theLocalAddrStr != NULL)
{ qtss_printf("#server: ip="); theLocalAddrStr->PrintStr(); qtss_printf(" port=%u\n" , serverPort );
}
else
{ qtss_printf("#server: ip=NULL port=%u\n" , serverPort );
}
if (theRemoteAddrStr != NULL)
{ qtss_printf("#client: ip="); theRemoteAddrStr->PrintStr(); qtss_printf(" port=%u\n" , clientPort );
}
else
{ qtss_printf("#client: ip=NULL port=%u\n" , clientPort );
}
}
/* 打印fRequest字符串 */
StrPtrLen str(fRequest);
str.PrintStrEOL("\n\r\n", "\n");// print the request but stop on \n\r\n and add a \n afterwards.
}
//use a StringParser object to search for a double EOL, which signifies the end of
//the header.
/* 下面要查找client发出的RTSP Request Header的末尾处 */
/* 找到fRequest末端了吗? */
Bool16 weAreDone = false;
StringParser headerParser(&fRequest);
UInt16 lcount = 0;
/* 当遇到eol时,fStartGet指针越过它 */
while (headerParser.GetThruEOL(NULL))
{
lcount++;