本文整理汇总了C++中JSONElement::append方法的典型用法代码示例。如果您正苦于以下问题:C++ JSONElement::append方法的具体用法?C++ JSONElement::append怎么用?C++ JSONElement::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSONElement
的用法示例。
在下文中一共展示了JSONElement::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTernProjectFile
wxString WebToolsConfig::GetTernProjectFile() const
{
JSONRoot root(cJSON_Object);
JSONElement libs = JSONElement::createArray("libs");
root.toElement().append(libs);
if(m_jsFlags & kJSLibraryBrowser) libs.arrayAppend("browser");
if(m_jsFlags & kJSLibraryChai) libs.arrayAppend("chai");
if(m_jsFlags & kJSLibraryEcma5) libs.arrayAppend("ecma5");
if(m_jsFlags & kJSLibraryEcma6) libs.arrayAppend("ecma6");
if(m_jsFlags & kJSLibraryJQuery) libs.arrayAppend("jquery");
if(m_jsFlags & kJSLibraryUnderscore) libs.arrayAppend("underscore");
JSONElement plugins = JSONElement::createObject("plugins");
root.toElement().append(plugins);
if(m_jsFlags & kJSPluginNode) {
JSONElement node = JSONElement::createObject("node");
plugins.append(node);
}
if(m_jsFlags & kJSPluginStrings) {
JSONElement complete_strings = JSONElement::createObject("complete_strings");
plugins.append(complete_strings);
}
if(m_jsFlags & kJSPluginAngular) {
JSONElement angular = JSONElement::createObject("angular");
plugins.append(angular);
}
return root.toElement().format();
}
示例2: 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;
}
示例3: root
clKeyboardBindingConfig& clKeyboardBindingConfig::Save()
{
JSONRoot root(cJSON_Object);
JSONElement mainObj = root.toElement();
JSONElement menuArr = JSONElement::createArray("menus");
mainObj.append(menuArr);
for(MenuItemDataMap_t::iterator iter = m_bindings.begin(); iter != m_bindings.end(); ++iter) {
JSONElement binding = JSONElement::createObject();
binding.addProperty("description", iter->second.action);
binding.addProperty("accelerator", iter->second.accel);
binding.addProperty("resourceID", iter->second.resourceID);
binding.addProperty("parentMenu", iter->second.parentMenu);
menuArr.arrayAppend(binding);
}
#if 0
JSONElement globalsArr = JSONElement::createArray("globals");
mainObj.append(globalsArr);
for(MenuItemDataMap_t::iterator iter = m_globalBindings.begin(); iter != m_globalBindings.end();
++iter) {
JSONElement binding = JSONElement::createObject();
binding.addProperty("description", iter->second.action);
binding.addProperty("accelerator", iter->second.accel);
binding.addProperty("resourceID", iter->second.resourceID);
binding.addProperty("parentMenu", iter->second.parentMenu);
globalsArr.arrayAppend(binding);
}
#endif
wxFileName fn(clStandardPaths::Get().GetUserDataDir(), "keybindings.conf");
fn.AppendDir("config");
root.save(fn);
return *this;
}
示例4: ToJSON
JSONElement SFTPSettings::ToJSON() const
{
JSONElement element = JSONElement::createObject(GetName());
element.addProperty("sshClient", m_sshClient);
JSONElement arrAccounts = JSONElement::createArray("accounts");
element.append(arrAccounts);
for(size_t i=0; i<m_accounts.size(); ++i) {
arrAccounts.append( m_accounts.at(i).ToJSON() );
}
return element;
}
示例5: ToJSON
JSONElement LLDBBacktrace::ToJSON() const
{
JSONElement json = JSONElement::createObject();
json.addProperty("m_threadId", m_threadId);
JSONElement arr = JSONElement::createArray("m_callstack");
json.append( arr );
for(size_t i=0; i<m_callstack.size(); ++i) {
arr.append( m_callstack.at(i).ToJSON() );
}
return json;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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());
}
示例9: Lookup
void NodeJSDebugger::Lookup(const std::vector<int>& handles, eNodeJSContext context)
{
JSONElement request = JSONElement::createObject();
request.addProperty("type", "request");
request.addProperty("command", "lookup");
JSONElement args = JSONElement::createObject("arguments");
request.append(args);
JSONElement arrHandles = JSONElement::createArray("handles");
args.append(arrHandles);
for(size_t i = 0; i < handles.size(); ++i) {
arrHandles.arrayAppend(JSONElement("", handles.at(i), cJSON_Number));
}
// Write the command
m_socket->WriteRequest(request, new NodeJSLookupHandler(context));
}
示例10: ToJSON
JSONElement PluginInfoArray::ToJSON() const
{
JSONElement el = JSONElement::createObject(GetName());
el.addProperty("disabledPlugins", m_disabledPlugins);
JSONElement arr = JSONElement::createArray("installed-plugins");
PluginInfo::PluginMap_t::const_iterator iter = m_plugins.begin();
for( ; iter != m_plugins.end(); ++iter ) {
arr.arrayAppend( iter->second.ToJSON() );
}
el.append(arr);
return el;
}
示例11: ToJSON
JSONElement PHPWorkspace::ToJSON(JSONElement& e) const
{
JSONElement metadata = JSONElement::createObject("metadata");
e.append(metadata);
metadata.addProperty("version", PHP_WORKSPACE_VERSION);
metadata.addProperty("ide", PHP_WORKSPACE_IDE);
metadata.addProperty("type", wxString("php"));
// Store the list of files
JSONElement projectsArr = JSONElement::createArray("projects");
e.append(projectsArr);
PHPProject::Map_t::const_iterator iter = m_projects.begin();
for(; iter != m_projects.end(); ++iter) {
wxFileName projectFile = iter->second->GetFilename();
projectFile.MakeRelativeTo(m_workspaceFile.GetPath());
projectsArr.arrayAppend(projectFile.GetFullPath(wxPATH_UNIX));
}
return e;
}
示例12: OnEvalExpression
void NodeJSDebugger::OnEvalExpression(clDebugEvent& event)
{
event.Skip();
// Build the request
JSONElement request = JSONElement::createObject();
request.addProperty("type", "request");
request.addProperty("command", "evaluate");
JSONElement args = JSONElement::createObject("arguments");
request.append(args);
args.addProperty("expression", event.GetString());
// Write the command
m_socket->WriteRequest(request, new NodeJSEvaluateExprHandler(event.GetString(), kNodeJSContextConsole));
}
示例13: ToJSON
JSONElement PHPFolder::ToJSON() const
{
JSONElement json = JSONElement::createObject("");
json.addProperty("m_name", m_name);
json.addProperty("m_files", m_files);
JSONElement arr = JSONElement::createArray("children");
json.append(arr);
PHPFolder::List_t::const_iterator iter = m_children.begin();
for(; iter != m_children.end(); ++iter) {
arr.arrayAppend((*iter)->ToJSON());
}
return json;
}
示例14: ToJSON
JSONElement DbExplorerSettings::ToJSON() const
{
JSONElement element = JSONElement::createObject(GetName());
element.addProperty("m_recentFiles", m_recentFiles);
element.addProperty("m_sqlHistory", m_sqlHistory);
// add the connections array
JSONElement arrConnections = JSONElement::createArray("connections");
element.append(arrConnections);
DbConnectionInfoVec::const_iterator iter = m_connections.begin();
for(; iter != m_connections.end(); ++iter) {
arrConnections.arrayAppend( iter->ToJSON() );
}
return element;
}
示例15: ToJSON
JSONElement LLDBBreakpoint::ToJSON() const
{
JSONElement json = JSONElement::createObject();
json.addProperty("m_id", m_id);
json.addProperty("m_type", m_type);
json.addProperty("m_name", m_name);
json.addProperty("m_filename", m_filename);
json.addProperty("m_lineNumber", m_lineNumber);
JSONElement arr = JSONElement::createArray("m_children");
json.append( arr );
for(size_t i=0; i<m_children.size(); ++i) {
arr.arrayAppend( m_children.at(i)->ToJSON() );
}
return json;
}