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


C++ JSONElement::addProperty方法代码示例

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


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

示例1: CreateFilesArray

JSONElement clTernServer::CreateFilesArray(IEditor* editor, bool forDelete)
{
    const wxString fileContent = editor->GetCtrl()->GetText();
    JSONElement files = JSONElement::createArray("files");

    JSONElement file = JSONElement::createObject();
    files.arrayAppend(file);

    wxString filename;
    if(!m_workingDirectory.IsEmpty()) {
        wxFileName fn(editor->GetFileName());
        fn.MakeRelativeTo(m_workingDirectory);
        filename = fn.GetFullPath();
    } else {
        filename = editor->GetFileName().GetFullName();
    }

    if(forDelete) {
        file.addProperty("type", wxString("delete"));
        file.addProperty("name", filename);

    } else {
        file.addProperty("type", wxString("full"));
        file.addProperty("name", filename);
        file.addProperty("text", fileContent);
    }
    return files;
}
开发者ID:anatooly,项目名称:codelite,代码行数:28,代码来源:clTernServer.cpp

示例2: PostFindDefinitionRequest

bool clTernServer::PostFindDefinitionRequest(IEditor* editor)
{
    // Sanity
    if(m_workerThread) return false;        // another request is in progress
    if(m_port == wxNOT_FOUND) return false; // don't know tern's port
    ++m_recycleCount;

    wxStyledTextCtrl* ctrl = editor->GetCtrl();

    // Prepare the request
    JSONRoot root(cJSON_Object);
    JSONElement query = JSONElement::createObject("query");
    root.toElement().append(query);
    query.addProperty("type", wxString("definition"));
    query.addProperty("file", wxString("#0"));
    query.append(CreateLocation(ctrl));

    // Creae the files array
    JSONElement files = CreateFilesArray(editor);
    root.toElement().append(files);

    clTernWorkerThread::Request* req = new clTernWorkerThread::Request;
    req->jsonRequest = root.toElement().FormatRawString();
    req->filename = editor->GetFileName().GetFullPath();
    req->type = clTernWorkerThread::kFindDefinition;

    // Create the worker thread and start the request
    m_workerThread = new clTernWorkerThread(this);
    m_workerThread->Start();
    m_workerThread->Add(req);
    return true;
}
开发者ID:anatooly,项目名称:codelite,代码行数:32,代码来源:clTernServer.cpp

示例3: PostResetCommand

bool clTernServer::PostResetCommand(bool forgetFiles)
{
    // Sanity
    if(m_workerThread) return false;        // another request is in progress
    if(m_port == wxNOT_FOUND) return false; // don't know tern's port
    ++m_recycleCount;

    // Prepare the request
    JSONRoot root(cJSON_Object);
    JSONElement query = JSONElement::createObject("query");
    root.toElement().append(query);
    query.addProperty("type", wxString("reset"));
    if(forgetFiles) {
        query.addProperty("forgetFiles", true);
    }

    clTernWorkerThread::Request* req = new clTernWorkerThread::Request;
    req->jsonRequest = root.toElement().FormatRawString();
    req->type = clTernWorkerThread::kReset;

    // Create the worker thread and start the request
    m_workerThread = new clTernWorkerThread(this);
    m_workerThread->Start();
    m_workerThread->Add(req);
    return true;
}
开发者ID:anatooly,项目名称:codelite,代码行数:26,代码来源:clTernServer.cpp

示例4: ToJSON

JSONElement AbbreviationJSONEntry::ToJSON() const
{
    JSONElement ele = JSONElement::createObject(GetName());
    ele.addProperty("entries", m_entries);
    ele.addProperty("autoInsert", m_autoInsert);
    return ele;
}
开发者ID:05storm26,项目名称:codelite,代码行数:7,代码来源:abbreviationentry.cpp

示例5: ToJSON

JSONElement DiffConfig::ToJSON() const
{
    JSONElement element = JSONElement::createObject(GetName());
    element.addProperty("m_flags",      m_flags);
    element.addProperty("m_viewFlags",  m_viewFlags);
    return element;
}
开发者ID:05storm26,项目名称:codelite,代码行数:7,代码来源:DiffConfig.cpp

示例6: ToJSON

void PHPProject::ToJSON(JSONElement& pro) const
{
    pro.addProperty("m_name", m_name);
    pro.addProperty("m_isActive", m_isActive);
    pro.addProperty("m_importFileSpec", m_importFileSpec);
    pro.addProperty("m_excludeFolders", m_excludeFolders);
    pro.append(m_settings.ToJSON());
}
开发者ID:05storm26,项目名称:codelite,代码行数:8,代码来源:php_project.cpp

示例7: ToJSON

JSONElement znConfigItem::ToJSON() const
{
    JSONElement element = JSONElement::createObject(GetName());
    element.addProperty("m_highlightColour", m_highlightColour);
    element.addProperty("m_enabled", m_enabled);
    element.addProperty("m_zoomFactor", m_zoomFactor);
    return element;
}
开发者ID:05storm26,项目名称:codelite,代码行数:8,代码来源:zn_config_item.cpp

示例8: ToJSON

JSONElement clDockerSettings::ToJSON() const
{
    JSONElement json = JSONElement::createObject(GetName());
    json.addProperty("docker", m_docker.GetFullPath());
    json.addProperty("docker-compose", m_dockerCompose.GetFullPath());
    json.addProperty("flags", m_flags);
    return json;
}
开发者ID:jiapei100,项目名称:codelite,代码行数:8,代码来源:clDockerSettings.cpp

示例9: ToJSON

JSONElement SSHWorkspaceSettings::ToJSON() const
{
    JSONElement json = JSONElement::createObject(GetName());
    json.addProperty("m_account", m_account);
    json.addProperty("m_remoteFolder", m_remoteFolder);
    json.addProperty("m_remoteUploadEnabled", m_remoteUploadEnabled);
    return json;
}
开发者ID:lpc1996,项目名称:codelite,代码行数:8,代码来源:ssh_workspace_settings.cpp

示例10: ToJSON

JSONElement PluginInfo::ToJSON() const
{
    JSONElement e = JSONElement::createObject();
    e.addProperty("name", name);
    e.addProperty("author", author);
    e.addProperty("description", description);
    e.addProperty("version", version);
    return e;
}
开发者ID:05storm26,项目名称:codelite,代码行数:9,代码来源:plugindata.cpp

示例11: ToJSON

JSONElement LLDBSettings::ToJSON() const
{
    JSONElement json = JSONElement::createObject();
    json.addProperty("m_maxArrayElements", m_arrItems);
    json.addProperty("m_maxCallstackFrames", m_stackFrames);
    json.addProperty("m_flags", m_flags);
    json.addProperty("m_types", m_types);
    return json;
}
开发者ID:linweixin,项目名称:codelite,代码行数:9,代码来源:LLDBSettings.cpp

示例12:

JSONElement LLDBBacktrace::Entry::ToJSON() const
{
    JSONElement json = JSONElement::createObject();
    json.addProperty("id", id);
    json.addProperty("line", line);
    json.addProperty("filename", filename);
    json.addProperty("functionName", functionName);
    json.addProperty("address", address);
    return json;
}
开发者ID:qioixiy,项目名称:codelite,代码行数:10,代码来源:LLDBBacktrace.cpp

示例13: ToJSON

JSONElement GitEntry::ToJSON() const
{
    JSONElement json = JSONElement::createObject(GetName());
    json.addProperty("m_entries", m_entries);
    if(m_colourTrackedFile.IsOk()) {
        json.addProperty("m_colourTrackedFile", m_colourTrackedFile.GetAsString(wxC2S_HTML_SYNTAX));
    }

    if(m_colourDiffFile.IsOk()) {
        json.addProperty("m_colourDiffFile", m_colourDiffFile.GetAsString(wxC2S_HTML_SYNTAX));
    }

    json.addProperty("m_pathGIT", m_pathGIT);
    json.addProperty("m_pathGITK", m_pathGITK);
    json.addProperty("m_flags", m_flags);
    json.addProperty("m_gitDiffDlgSashPos", m_gitDiffDlgSashPos);
    json.addProperty("m_gitConsoleSashPos", m_gitConsoleSashPos);
    json.addProperty("m_gitCommitDlgHSashPos", m_gitCommitDlgHSashPos);
    json.addProperty("m_gitCommitDlgVSashPos", m_gitCommitDlgVSashPos);
    json.addProperty("m_recentCommits", m_recentCommits);
    
    // Add the git commands array
    JSONElement arrCommands = JSONElement::createArray("Commands");
    json.append(arrCommands);
    GitCommandsEntriesMap_t::const_iterator iter = m_commandsMap.begin();
    for(; iter != m_commandsMap.end(); ++iter) {
        iter->second.ToJSON(arrCommands);
    }
    return json;
}
开发者ID:05storm26,项目名称:codelite,代码行数:30,代码来源:gitentry.cpp

示例14: ToJSON

JSONElement LLDBReply::ToJSON() const
{
    JSONElement json = JSONElement::createObject();
    json.addProperty("m_replyType", m_replyType);
    json.addProperty("m_stopResaon", m_interruptResaon);
    json.addProperty("m_line", m_line);
    json.addProperty("m_filename", m_filename);
    json.addProperty("m_lldbId", m_lldbId);
    json.addProperty("m_expression", m_expression);
    json.addProperty("m_debugSessionType", m_debugSessionType);
    json.addProperty("m_text", m_text);
    JSONElement bparr = JSONElement::createArray("m_breakpoints");
    json.append(bparr);
    for(size_t i = 0; i < m_breakpoints.size(); ++i) {
        bparr.arrayAppend(m_breakpoints.at(i)->ToJSON());
    }

    JSONElement localsArr = JSONElement::createArray("m_locals");
    json.append(localsArr);
    for(size_t i = 0; i < m_variables.size(); ++i) {
        localsArr.arrayAppend(m_variables.at(i)->ToJSON());
    }

    json.addProperty("m_backtrace", m_backtrace.ToJSON());
    json.append(LLDBThread::ToJSON(m_threads, "m_threads"));
    return json;
}
开发者ID:292388900,项目名称:codelite,代码行数:27,代码来源:LLDBReply.cpp

示例15: ToJSON

JSONElement DbConnectionInfo::ToJSON() const
{
    JSONElement element = JSONElement::createObject(GetName());
    element.addProperty("m_connectionName",  m_connectionName );
    element.addProperty("m_connectionType",  m_connectionType );
    element.addProperty("m_defaultDatabase", m_defaultDatabase);
    element.addProperty("m_password"       , m_password       );
    element.addProperty("m_server"         , m_server         );
    element.addProperty("m_port"           , m_port           );
    element.addProperty("m_username"       , m_username       );
    return element;
}
开发者ID:292388900,项目名称:codelite,代码行数:12,代码来源:db_explorer_settings.cpp


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