Beispiel #1
0
QString AmfReader::readAmf3String()
{
    auto size = readAmf3Int();
    bool ref = (size & 1) == 0;
    size >>= 1;

    if(ref)
        return readStringRef(size);

    if(size == 0)
        return QString();

    auto str = readUtf8(size);
    addStringRef(str);
    return str;
}
Beispiel #2
0
//
// Extract all strings in double quotes, 
// e.g., push	offset aCcommonclienti ; "CCommonClientInfo::GetVersion() : reg.O"...
//
bool CCSTokenRefMgr::parseStringRef(const CString& str, int dbFileID, int refRawLineNumber)
{
    int firstDoubleQuotePos = str.Find(_T("\""));
    if (firstDoubleQuotePos == -1)
        return true; // no strings

    int secondDoubleQuotePos = str.Find(_T("\""), firstDoubleQuotePos + 1);
    if (secondDoubleQuotePos == -1)
        return true; // no strings

    CString tokenKey = str.Mid(firstDoubleQuotePos + 1, secondDoubleQuotePos - firstDoubleQuotePos - 1);
    if (tokenKey.IsEmpty())
        return true;
    if (!addStringRef((LPCTSTR) tokenKey, dbFileID, refRawLineNumber))
        return false;

    return parseStringRef(str.Mid(secondDoubleQuotePos + 1), dbFileID, refRawLineNumber);
}