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


C++ CCString::FormatW方法代码示例

本文整理汇总了C++中CCString::FormatW方法的典型用法代码示例。如果您正苦于以下问题:C++ CCString::FormatW方法的具体用法?C++ CCString::FormatW怎么用?C++ CCString::FormatW使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCString的用法示例。


在下文中一共展示了CCString::FormatW方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Encode

/*
    010515 Carl Corcoran
    chKey is the $ or % or whatever that will be inserted.
    wszChars is a string that contains all the characters to be encoded.

    String="The"
    Encode(L'$', L"he");
    Yields: T$68$65
*/
void CCString::Encode(WCHAR chKey, PCWSTR wszChars)
{
    CCString r = "";// Resulting string
    CCString t = "";
    PWSTR wszSrcThis = this->wszString;
    PCWSTR wszSrcChars = wszChars;

    WCHAR ch;

    while(1)
    {
        ch = wszSrcThis[0];
        if(ch == 0) break;

        wszSrcChars = wszChars;

        if(wcschr(wszChars, ch) != 0)
        {
            t.FormatW(L"%c%02.2x", chKey, ch);
            r += t;
        }
        else
        {
            r += ch;
        }

        wszSrcThis ++;
    }

    this->_CreateFromW(r);
}
开发者ID:thenfour,项目名称:LoveLine,代码行数:40,代码来源:CCString.cpp

示例2: _odsf

void _odsf(PCWSTR wszFunction, PCWSTR wszString, va_list argptr)
{
    CCString s;
    CCString s2;

    s.FormatW(L"[ %-20.20s ]  %s", wszFunction, wszString);
    s2.FormatvW(s, argptr);

    OutputDebugStringW(s2);
    OutputDebugStringW(L"\n");

    return;
}
开发者ID:thenfour,项目名称:LoveLine,代码行数:13,代码来源:Global.cpp

示例3: _odsf

void _odsf(PCWSTR wszFunction, PCWSTR wszString)
{
    CCString sMsg;

    sMsg.FormatW(L"[ %-20.20s ]  ", wszFunction);
    sMsg.cat(wszString);

    if(__g_bLogOpened == TRUE)
    {
        __g_Log._AddEntry(sMsg);
    }

    OutputDebugStringW(sMsg);
    OutputDebugStringW(L"\n");
}
开发者ID:thenfour,项目名称:Volumizer,代码行数:15,代码来源:CCDebug.cpp

示例4: SaveControl

HRESULT CMixerControl::SaveControl(XMLDoc* pDoc, XMLEl* pParent)
{
    XMLEl* pThis = 0;
    HRESULT hr;
    CCString sValues;
    CCString sTemp;
    BOOL bFirst;

    if(FAILED(hr = XMLFindControl(pDoc, pParent, 
        m_mc.dwControlID, CCString(m_mc.szName), m_Type, &pThis, TRUE)))
    {
        return hr;
    }

    // Save the values of this control.
    // We just go in order, separating values with a comma.

    bFirst = TRUE;// This will determine if we need to add a comma or not.
    int i = 0;

    switch(m_DataType)
    {
    case MIXDT_CUSTOM:
        {
            sValues.FromBinary(m_pRaw, m_mc.Metrics.cbCustomData);
            pThis->setAttribute(CCString(L"Values"), sValues.variant());
            break;
        }
    case MIXDT_SIGNED:
        {
            MIXERCONTROLDETAILS_SIGNED* p = (MIXERCONTROLDETAILS_SIGNED*)m_pRaw;

            sValues.froml(p[0].lValue, 10);

            for(i=1;i<m_nRawItems;i++)
            {
                sValues.cat(L", ");
                sTemp.froml(p[i].lValue, 10);
                sValues.cat(sTemp);
            }

            pThis->setAttribute(CCString(L"Values"), sValues.variant());

            break;
        }
    case MIXDT_UNSIGNED:
        {
            MIXERCONTROLDETAILS_UNSIGNED* p = (MIXERCONTROLDETAILS_UNSIGNED*)m_pRaw;

            sValues.fromul(p[0].dwValue, 10);

            for(i=1;i<m_nRawItems;i++)
            {
                sValues.cat(L", ");
                sTemp.fromul(p[i].dwValue, 10);
                sValues.cat(sTemp);
            }

            pThis->setAttribute(CCString(L"Values"), sValues.variant());

            break;
        }
    case MIXDT_BOOLEAN:
        {
            MIXERCONTROLDETAILS_BOOLEAN* p = (MIXERCONTROLDETAILS_BOOLEAN*)m_pRaw;

            sValues = (p[0].fValue == TRUE) ? L"TRUE" : L"FALSE";

            for(i=1;i<m_nRawItems;i++)
            {
                sTemp.FormatW(L", %s", (p[i].fValue == TRUE) ? L"TRUE" : L"FALSE");
                sValues.cat(sTemp);
            }

            pThis->setAttribute(CCString(L"Values"), sValues.variant());

            break;
        }
    default:
        {
            //
        }
    }

    SAFE_RELEASE(pThis);

    return hr;
}
开发者ID:thenfour,项目名称:Volumizer,代码行数:88,代码来源:MixerControl.cpp


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