本文整理汇总了C++中StrPtrLen::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ StrPtrLen::c_str方法的具体用法?C++ StrPtrLen::c_str怎么用?C++ StrPtrLen::c_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrPtrLen
的用法示例。
在下文中一共展示了StrPtrLen::c_str方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractServerVersionNum
void HttpParsingBasicObject::extractServerVersionNum()
{
StrCSumPtrLen serverKey = "Server";
StrPtrLen serverValue;
if (!iParser->getField(serverKey, serverValue)) return;
if (serverValue.length() == 0) return;
// Has Sever header
char *ptr = (char*)serverValue.c_str();
for (int32 i = 0; i < serverValue.length(); i++)
{
if (!PE_isDigit(*ptr))
{
ptr++;
continue;
}
iServerVersionNumber = *ptr++ - '0';
if (PE_isDigit(*ptr) && ++i < serverValue.length())
{
iServerVersionNumber = iServerVersionNumber * 10 + (*ptr - '0');
}
break;
}
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:25,代码来源:pvmf_protocol_engine_common.cpp
示例2: switch
OSCL_EXPORT_REF bool
RTSPOutgoingMessage::compose()
{
// compose the first line
//
switch (msgType)
{
case RTSPResponseMsg:
{
// RTSP version
//
oscl_memcpy(fullRequestBuffer, RTSPVersionString, RTSPVersionString_len);
fullRequestBufferSpace += RTSPVersionString_len;
*(fullRequestBufferSpace++) = ' ';
// Status code
//
oscl_snprintf(fullRequestBufferSpace, RTSP_MAX_FULL_REQUEST_SIZE - 1, "%d", statusCode);
// resync the pointer and size used
fullRequestBufferSizeUsed = oscl_strlen(fullRequestBufferSpace);
fullRequestBufferSpace += fullRequestBufferSizeUsed;
*(fullRequestBufferSpace++) = ' ';
fullRequestBufferSizeUsed += 1 + RTSPVersionString_len + 1;
if (0 != reasonString.length())
{
// user specified his own string
//
oscl_memcpy(fullRequestBufferSpace, reasonString.c_str(),
reasonString.length());
fullRequestBufferSpace += reasonString.length();
fullRequestBufferSizeUsed += reasonString.length();
}
else
{
StrPtrLen realReasonString ;
// user wants the built-in default
//
switch (statusCode)
{
case CodeContinue:
realReasonString = RtspReasonStringContinue;
break;
case CodeOK:
realReasonString = RtspReasonStringOK;
break;
case CodeCreated:
realReasonString = RtspReasonStringCreated;
break;
case CodeLowOnStorageSpace:
realReasonString = RtspReasonStringLowOnStorageSpace;
break;
case CodeMultipleChoices:
realReasonString = RtspReasonStringMultipleChoices;
break;
case CodeMovedPermanently:
realReasonString = RtspReasonStringMovedPermanently;
break;
case CodeMovedTemporarily:
realReasonString = RtspReasonStringMovedTemporarily;
break;
case CodeSeeOther:
realReasonString = RtspReasonStringSeeOther;
break;
case CodeNotModified:
realReasonString = RtspReasonStringNotModified;
break;
case CodeUseProxy:
realReasonString = RtspReasonStringUseProxy;
break;
//.........这里部分代码省略.........
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:101,代码来源:rtsp_par_com_outgoing_message.cpp