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


C++ plString::GetSize方法代码示例

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


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

示例1: SetPassword

bool pfMacPasswordStore::SetPassword(const plString& username, const plString& password)
{
    plString service = GetServerDisplayName();

    return SecKeychainAddGenericPassword(nullptr,
                                         service.GetSize(),
                                         service.c_str(),
                                         username.GetSize(),
                                         username.c_str(),
                                         password.GetSize(),
                                         password.c_str(),
                                         nullptr) == errSecSuccess;
}
开发者ID:Drakesinger,项目名称:Plasma,代码行数:13,代码来源:pfPasswordStore_Mac.cpp

示例2: GetPassword

/*****************************************************************************
 ** pfMacPasswordStore                                                      **
 *****************************************************************************/
const plString pfMacPasswordStore::GetPassword(const plString& username)
{
    plString service = GetServerDisplayName();

    void* passwd = nullptr;
    uint32_t passwd_len = 0;

    if (SecKeychainFindGenericPassword(nullptr,
                                       service.GetSize(),
                                       service.c_str(),
                                       username.GetSize(),
                                       username.c_str(),
                                       &passwd_len,
                                       &passwd,
                                       nullptr) != errSecSuccess)
    {
        return plString::Null;
    }

    plString ret(reinterpret_cast<const char*>(passwd), size_t(passwd_len));

    SecKeychainItemFreeContent(nullptr, passwd);

    return ret;
}
开发者ID:Drakesinger,项目名称:Plasma,代码行数:28,代码来源:pfPasswordStore_Mac.cpp

示例3: WriteSafeStringLong

uint32_t hsStream::WriteSafeStringLong(const plString &string)
{
    uint32_t len = string.GetSize();
    WriteLE32(len);
    if (len > 0)
    {   
        const char *buffp = string.c_str();
        uint32_t i;
        for (i = 0; i < len; i++)
        {
            WriteByte(~buffp[i]);
        }
        return i;
    }
    else
        return 0;
}
开发者ID:branan,项目名称:Plasma,代码行数:17,代码来源:hsStream.cpp

示例4: WriteSafeString

uint32_t hsStream::WriteSafeString(const plString &string)
{
    int len = string.GetSize();
    hsAssert(len<0xf000, plString::Format("string len of %d is too long for WriteSafeString %s, use WriteSafeStringLong",
        len, string.c_str()).c_str() );

    WriteLE16(len | 0xf000);
    if (len > 0)
    {
        uint32_t i;
        const char *buffp = string.c_str();
        for (i = 0; i < len; i++)
        {
            WriteByte(~buffp[i]);
        }
        return i;
    }
    else
        return 0;
}
开发者ID:branan,项目名称:Plasma,代码行数:20,代码来源:hsStream.cpp

示例5: StoreHash

static void StoreHash(const plString& username, const plString& password, LoginDialogParam *pLoginParam)
{
    //  Hash username and password before sending over the 'net.
    //  -- Legacy compatibility: @gametap (and other usernames with domains in them) need
    //     to be hashed differently.
    std::vector<plString> match = username.RESearch("[^@][email protected]([^.]+\\.)*([^.]+)\\.[^.]+");
    if (match.empty() || match[2].CompareI("gametap") == 0) {
        //  Plain Usernames...
        plSHA1Checksum shasum(password.GetSize(), reinterpret_cast<const uint8_t*>(password.c_str()));
        uint32_t* dest = reinterpret_cast<uint32_t*>(pLoginParam->namePassHash);
        const uint32_t* from = reinterpret_cast<const uint32_t*>(shasum.GetValue());

        dest[0] = hsToBE32(from[0]);
        dest[1] = hsToBE32(from[1]);
        dest[2] = hsToBE32(from[2]);
        dest[3] = hsToBE32(from[3]);
        dest[4] = hsToBE32(from[4]);
    }
    else {
        //  Domain-based Usernames...
        CryptHashPassword(username, password, pLoginParam->namePassHash);
    }
}
开发者ID:Drakesinger,项目名称:Plasma,代码行数:23,代码来源:winmain.cpp

示例6: MsgReceive

bool plAutoProfileImp::MsgReceive(plMessage* msg)
{
    plEvalMsg* evalMsg = plEvalMsg::ConvertNoRef(msg);
    if (evalMsg)
    {
        if (fStatusMessage.GetSize() > 0)
            plDebugText::Instance().DrawString(10, 10, fStatusMessage.c_str());
    }

    plAgeLoadedMsg* ageLoaded = plAgeLoadedMsg::ConvertNoRef(msg);
    if (ageLoaded)
    {
        if (!ageLoaded->fLoaded)
        {
            fLinkTime = hsTimer::GetTicks();
            hsStatusMessage("Age unloaded");
        }
        return true;
    }

    plInitialAgeStateLoadedMsg* ageStateLoaded = plInitialAgeStateLoadedMsg::ConvertNoRef(msg);
    if (ageStateLoaded)
    {
        if (fNextAge > 0)
        {
            fLinkTime = hsTimer::GetTicks() - fLinkTime;
            float ms = hsTimer::GetMilliSeconds<float>(fLinkTime);

            hsStatusMessageF("Age %s finished load, took %.1f ms",
                fAges[fNextAge-1].c_str(),
                ms);

            plStatusLog::AddLineS("agetimings.log", "Age %s took %.1f ms",
                fAges[fNextAge-1].c_str(),
                ms);
        }

        fStatusMessage = "Age loaded.  Preparing to profile.";

        // Age is loaded, start profiling in 5 seconds (to make sure the avatar is linked in all the way)
        plTimerCallbackMsg* timerMsg = new plTimerCallbackMsg(GetKey());
        plgTimerCallbackMgr::NewTimer(5, timerMsg);
        return true;
    }

    plTimerCallbackMsg* timerMsg = plTimerCallbackMsg::ConvertNoRef(msg);
    if (timerMsg)
    {
        INextProfile();
        return true;
    }

    // When the first age starts to load, register the stupid avatar customization variable
    // so the calibration screen won't pop up and ruin everything.  I'm sure I could try
    // and do this earlier, but I'm not sure when that player folder is set so screw it, it works here.
    plAgeBeginLoadingMsg* ageBeginLoadingMsg = plAgeBeginLoadingMsg::ConvertNoRef(msg);
    if (ageBeginLoadingMsg)
    {
        plgDispatch::Dispatch()->UnRegisterForExactType(plAgeBeginLoadingMsg::Index(), GetKey());
        VaultAddChronicleEntryAndWait("InitialAvCursomizationsDone", 0, "1");
        return true;
    }

    return false;
}
开发者ID:Drakesinger,项目名称:Plasma,代码行数:65,代码来源:plAutoProfile.cpp


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