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


C++ StrPtrLen::c_str方法代码示例

本文整理汇总了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


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