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


C++ CWizStdStringArray类代码示例

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


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

示例1: setUsers

void CWizLoginDialog::setUsers(const QString& strDefault)
{
    CWizStdStringArray usersFolder;
    ::WizEnumFolders(::WizGetDataStorePath(), usersFolder, 0);

    for(CWizStdStringArray::const_iterator it = usersFolder.begin();
        it != usersFolder.end(); it++)
    {
        QString strPath = *it;
        QString strUserId = ::WizFolderNameByPath(strPath);

        QRegExp mailRex("\\b[A-Z0-9._%+-][email protected][A-Z0-9.-]+\\.[A-Z]{2,4}\\b");
        mailRex.setCaseSensitivity(Qt::CaseInsensitive);

        if (!mailRex.exactMatch(strUserId))
            continue;

        if (!QFile::exists(strPath + "data/index.db"))
            continue;

        m_comboUsers->addItem(strUserId);
    }

    // set default user as default login entry.
    int i = m_comboUsers->findText(strDefault);
    if (-1 == i) {
        m_comboUsers->insertItem(0, NULL, strDefault);
        m_comboUsers->setCurrentIndex(0);
    } else {
        m_comboUsers->setCurrentIndex(i);
    }
}
开发者ID:Onekr,项目名称:WizQTClient,代码行数:32,代码来源:wizLoginDialog.cpp

示例2: updateInformation

    void updateInformation(CWizDatabase& db, const WIZDOCUMENTDATA& doc)
    {
        // retrieve document info and reset
        WIZDOCUMENTDATA data;
        if (!db.DocumentFromGUID(doc.strGUID, data)) {
            return;
        }

        //title
        if (m_titleEdit->text() != data.strTitle) {
            m_titleEdit->setText(data.strTitle);
        }

        //tags
        CWizStdStringArray arrayTagGUID;
        db.GetDocumentTags(data.strGUID, arrayTagGUID);

        QString strTagText = arrayTagGUID.empty() ? QString() : QString::number(arrayTagGUID.size());
        m_tagsButton->setText(strTagText);

        QString tagsShortcut = ::WizGetShortcut("EditNoteTags", "Alt+2");
        QString strTagsToolTip = QObject::tr("Tags (%1)").arg(tagsShortcut);
        m_tagsButton->setToolTip(strTagsToolTip);
        m_tagsButton->setShortcut(QKeySequence::fromString(tagsShortcut));

        //attachments
        int nAttachmentCount = db.GetDocumentAttachmentCount(data.strGUID);
        CString strAttachmentText = nAttachmentCount ? WizIntToStr(nAttachmentCount) : CString();
        m_attachmentButton->setText(strAttachmentText);
        QString attachmentShortcut = ::WizGetShortcut("EditNoteAttachments", "Alt+3");
        m_attachmentButton->setToolTip(QObject::tr("Attachments (%1)").arg(attachmentShortcut));
        m_attachmentButton->setShortcut(QKeySequence::fromString(attachmentShortcut));
    }
开发者ID:badwtg1111,项目名称:WizQTClient,代码行数:33,代码来源:wizdocumentview.cpp

示例3: processLog

void CWizKbSync::queryAttachmentInfo(const CString& strGUID, const CString& strName)
{
    Q_EMIT processLog(tr("query attachment info: ") + strName);

    CWizStdStringArray arrayGUID;
    arrayGUID.push_back(strGUID);
    callAttachmentsGetInfo(arrayGUID);
}
开发者ID:luxin6,项目名称:WizQTClient,代码行数:8,代码来源:wizKbSync.cpp

示例4: SQLToDocumentDataArray

bool CWizIndexBase::SQLToDocumentDataArray(const CString& strSQL, CWizDocumentDataArray& arrayDocument)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        CWizStdStringArray arrayGUID;
        std::map<CString, int> mapDocumentIndex;
        while (!query.eof())
        {
            WIZDOCUMENTDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(documentDOCUMENT_GUID);
            data.strTitle = query.getStringField(documentDOCUMENT_TITLE);
            data.strLocation = query.getStringField(documentDOCUMENT_LOCATION);
            data.strName = query.getStringField(documentDOCUMENT_NAME);
            data.strSEO = query.getStringField(documentDOCUMENT_SEO);
            data.strURL = query.getStringField(documentDOCUMENT_URL);
            data.strAuthor = query.getStringField(documentDOCUMENT_AUTHOR);
            data.strKeywords = query.getStringField(documentDOCUMENT_KEYWORDS);
            data.strType = query.getStringField(documentDOCUMENT_TYPE);
            data.strOwner = query.getStringField(documentDOCUMENT_OWNER);
            data.strFileType = query.getStringField(documentDOCUMENT_FILE_TYPE);
            data.strStyleGUID = query.getStringField(documentSTYLE_GUID);
            data.tCreated = query.getTimeField(documentDT_CREATED);
            data.tModified = query.getTimeField(documentDT_MODIFIED);
            data.tAccessed = query.getTimeField(documentDT_ACCESSED);
            data.nIconIndex = query.getIntField(documentDOCUMENT_ICON_INDEX);
            data.nSync = query.getIntField(documentDOCUMENT_SYNC);
            data.nProtected = query.getIntField(documentDOCUMENT_PROTECT);
            data.nReadCount = query.getIntField(documentDOCUMENT_READ_COUNT);
            data.nAttachmentCount = query.getIntField(documentDOCUMENT_ATTACHEMENT_COUNT);
            data.nIndexed = query.getIntField(documentDOCUMENT_INDEXED);
            data.tInfoModified = query.getTimeField(documentDT_INFO_MODIFIED);
            data.strInfoMD5 = query.getStringField(documentDOCUMENT_INFO_MD5);
            data.tDataModified = query.getTimeField(documentDT_DATA_MODIFIED);
            data.strDataMD5 = query.getStringField(documentDOCUMENT_DATA_MD5);
            data.tParamModified = query.getTimeField(documentDT_PARAM_MODIFIED);
            data.strParamMD5 = query.getStringField(documentDOCUMENT_PARAM_MD5);
            data.nVersion = query.getInt64Field(documentVersion);

            arrayGUID.push_back(data.strGUID);
            arrayDocument.push_back(data);
            mapDocumentIndex[data.strGUID] = int(arrayDocument.size() - 1);
            query.nextRow();
        }

        if (!arrayGUID.empty()) {
            InitDocumentExFields(arrayDocument, arrayGUID, mapDocumentIndex);
        }

        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
开发者ID:flyfire,项目名称:WizQTClient,代码行数:57,代码来源:wizIndexBase.cpp

示例5: setStringArray

bool WizXmlRpcArrayValue::setStringArray(const CWizStdStringArray& arrayData)
{
    CWizStdStringArray::const_iterator it;
    for (it = arrayData.begin(); it != arrayData.end(); it++)
	{
		add(new WizXmlRpcStringValue(*it));
    }

    return true;
}
开发者ID:JamesLinus,项目名称:WizQTClient,代码行数:10,代码来源:WizXmlRpc.cpp

示例6: SetStringArray

BOOL CWizXmlRpcArrayValue::SetStringArray(const CWizStdStringArray& arrayData)
{
	for (CWizStdStringArray::const_iterator it = arrayData.begin();
		it != arrayData.end();
		it++)
	{
		Add(new CWizXmlRpcStringValue(*it));
    }

	return TRUE;
}
开发者ID:dwdcth,项目名称:WizQTClient,代码行数:11,代码来源:wizxmlrpc.cpp

示例7: CWizCategoryViewAllFoldersItem

void CWizFolderView::initFolders()
{
    CWizCategoryViewAllFoldersItem* pAllFoldersItem = new CWizCategoryViewAllFoldersItem(m_app, tr("Note Folders"), m_dbMgr.db().kbGUID());
    addTopLevelItem(pAllFoldersItem);

    CWizStdStringArray arrayAllLocation;
    m_dbMgr.db().GetAllLocations(arrayAllLocation);

    // folder cache
    CWizStdStringArray arrayExtLocation;
    m_dbMgr.db().GetExtraFolder(arrayExtLocation);

    if (!arrayExtLocation.empty()) {
        for (CWizStdStringArray::const_iterator it = arrayExtLocation.begin();
             it != arrayExtLocation.end();
             it++) {
            if (-1 == ::WizFindInArray(arrayAllLocation, *it)) {
                arrayAllLocation.push_back(*it);
            }
        }
    }

    if (arrayAllLocation.empty()) {
        arrayAllLocation.push_back(m_dbMgr.db().GetDefaultNoteLocation());
    }

    initFolders(pAllFoldersItem, "", arrayAllLocation);

    pAllFoldersItem->setExpanded(true);
    pAllFoldersItem->sortChildren(0, Qt::AscendingOrder);
}
开发者ID:AlanForeverAi,项目名称:WizQTClient,代码行数:31,代码来源:wizFolderView.cpp

示例8: GetKeys

void CWizSettings::GetKeys(const QString& strSection, CWizStdStringArray& arrayAction)
{
    beginGroup(strSection);
    QStringList sl = childKeys();
    endGroup();
    arrayAction.assign(sl.begin(), sl.end());
}
开发者ID:liuyd07,项目名称:WizQTClient,代码行数:7,代码来源:wizsettings.cpp

示例9: note2Mime

QString note2Mime(const CWizDocumentDataArray& arrayDocument)
{
    CWizStdStringArray arrayGUID;

    for (CWizDocumentDataArray::const_iterator it = arrayDocument.begin();
         it != arrayDocument.end();
         it++)
    {
        const WIZDOCUMENTDATA& data = *it;
        arrayGUID.push_back(data.strKbGUID + ":" + data.strGUID);
    }

    CString strMime;
    ::WizStringArrayToText(arrayGUID, strMime, ";");

    return strMime;
}
开发者ID:Onekr,项目名称:WizQTClient,代码行数:17,代码来源:wizDocumentListView.cpp

示例10: WizHtml2Zip

bool WizHtml2Zip(const QString& strHtml, const CWizStdStringArray& arrayResource, \
                 const QString& strMetaText, const QString& strZipFileName)
{
    CWizZipFile zip;
    if (!zip.open(strZipFileName))
        return false;

    QString strHtmlText = strHtml;
    if (strHtmlText.left(2) != " <!")
    {
        strHtmlText = "<!DOCTYPE html>" + strHtmlText;
    }
    CString strIndexFileName = Utils::PathResolve::tempPath() + WizIntToStr(GetTickCount()) + ".html";
    //if (!::WizSaveUnicodeTextToUnicodeFile(strIndexFileName, strHtml))
    if (!::WizSaveUnicodeTextToUtf8File(strIndexFileName, strHtmlText))
        return false;

    CString strMetaFileName = Utils::PathResolve::tempPath() + WizIntToStr(GetTickCount()) + ".xml";
    if (!::WizSaveUnicodeTextToUtf8File(strMetaFileName, strMetaText))
        return false;

    if (!zip.compressFile(strIndexFileName, "index.html"))
        return false;

    int failed = 0;

    if (!zip.compressFile(strMetaFileName, "meta.xml"))
        failed++;

    for (CWizStdStringArray::const_iterator it = arrayResource.begin();
        it != arrayResource.end();
        it++)
    {
        CString strFileName = *it;
        CString strNameInZip = "index_files/" + Utils::Misc::extractFileName(strFileName);
        if (!zip.compressFile(strFileName, strNameInZip))
        {
            failed++;
        }
    }

    return zip.close();
}
开发者ID:AlvaroSacari,项目名称:WizQTClient,代码行数:43,代码来源:wizhtml2zip.cpp

示例11: initFolders

void CWizFolderView::initFolders(QTreeWidgetItem* pParent,
                                 const QString& strParentLocation,
                                 const CWizStdStringArray& arrayAllLocation)
{
    CWizStdStringArray arrayLocation;
    CWizDatabase::GetChildLocations(arrayAllLocation, strParentLocation, arrayLocation);

    CWizStdStringArray::const_iterator it;
    for (it = arrayLocation.begin(); it != arrayLocation.end(); it++) {
        QString strLocation = *it;

        if (m_dbMgr.db().IsInDeletedItems(strLocation))
            continue;

        CWizCategoryViewFolderItem* pFolderItem = new CWizCategoryViewFolderItem(m_app, strLocation, m_dbMgr.db().kbGUID());
        pParent->addChild(pFolderItem);

        initFolders(pFolderItem, strLocation, arrayAllLocation);
    }
}
开发者ID:runforprogram,项目名称:WizQTClient,代码行数:20,代码来源:wizFolderView.cpp

示例12: getUserPasswordPairs

void WelcomeDialog::getUserPasswordPairs()
{
    CWizStdStringArray usersFolder;
    ::WizEnumFolders(::WizGetDataStorePath(), usersFolder, 0);

    for(CWizStdStringArray::const_iterator iter = usersFolder.begin();
        iter != usersFolder.end();
        iter++)
    {
        QString strPath = *iter;
        QString strUserId = ::WizFolderNameByPath(strPath);

        if (strUserId.indexOf("@") == -1) {
            continue;
        }

        CWizUserSettings userSettings(strUserId);
        m_users.insert(strUserId, userSettings.password());
    }
}
开发者ID:badwtg1111,项目名称:WizQTClient,代码行数:20,代码来源:wizwelcomedialog.cpp

示例13: ParamArrayToStringArray

BOOL WIZDOCUMENTDATAEX::ParamArrayToStringArray(CWizStdStringArray& params) const
{
    for (std::deque<WIZDOCUMENTPARAMDATA>::const_iterator it = arrayParam.begin();
    it != arrayParam.end();
    it++)
    {
        params.push_back(it->strName + _T("=") + it->strValue);
    }

    return TRUE;
}
开发者ID:badwtg1111,项目名称:WizQTClient,代码行数:11,代码来源:wizobject.cpp

示例14: while

BOOL CWizKMDatabaseServer::document_downloadFullListEx(const CWizStdStringArray& arrayDocumentGUID, std::deque<WIZDOCUMENTDATAEX>& arrayRet)
{
    int nCountPerPage = 30;
    //
    CWizStdStringArray::const_iterator it = arrayDocumentGUID.begin();
    //
    while (1)
    {
        //
        CWizStdStringArray subArray;
        //
        for (;
            it != arrayDocumentGUID.end(); )
        {
            subArray.push_back(*it);
            it++;
            //
            if (subArray.size() == nCountPerPage)
                break;
        }
        //
        std::deque<WIZDOCUMENTDATAEX> subRet;
        if (!document_downloadFullList(subArray, subRet))
            return FALSE;
        //
        arrayRet.insert(arrayRet.end(), subRet.begin(), subRet.end());
        //
        if (it == arrayDocumentGUID.end())
            break;
    }
    //
    return TRUE;
}
开发者ID:Onekr,项目名称:WizQTClient,代码行数:33,代码来源:wizkmxmlrpc.cpp

示例15: createWebEngineProfile

QWebEngineProfile* createWebEngineProfile(const WizWebEngineViewInjectObjects& objects, QObject* parent)
{
    if (objects.empty())
        return nullptr;
    //
    QWebEngineProfile *profile = new QWebEngineProfile("WizNoteWebEngineProfile", parent);
    //
    QString jsWebChannelFileName = Utils::WizPathResolve::resourcesPath() + "files/webengine/wizwebchannel.js";
    QString jsWebChannel;
    WizLoadUnicodeTextFromFile(jsWebChannelFileName, jsWebChannel);
    //
    QString initFileName = Utils::WizPathResolve::resourcesPath() + "files/webengine/wizwebengineviewinit.js";
    QString jsInit;
    WizLoadUnicodeTextFromFile(initFileName, jsInit);
    //
    CWizStdStringArray names;
    for (auto inject : objects) {
        names.push_back("\"" + inject.name + "\"");
    }
    //
    CString objectNames;
    WizStringArrayToText(names, objectNames, ", ");
    //
    jsInit.replace("__objectNames__", objectNames);
    //
    QString jsAll = jsWebChannel + "\n" + jsInit;
    //
    {
        QWebEngineScript script;
        script.setSourceCode(jsAll);
        script.setName("qwebchannel.js");
        script.setWorldId(QWebEngineScript::MainWorld);
        script.setInjectionPoint(QWebEngineScript::DocumentCreation);
        script.setRunsOnSubFrames(true);
        profile->scripts()->insert(script);
    }
    //
    return profile;
}
开发者ID:WizTeam,项目名称:WizQTClient,代码行数:39,代码来源:WizWebEngineView.cpp


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