File: HelpPluginSettings.cpp

package info (click to toggle)
codelite 12.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (56 lines) | stat: -rw-r--r-- 2,240 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "HelpPluginSettings.h"

HelpPluginSettings::HelpPluginSettings()
    : clConfigItem("HelpPlugin")
    , m_cxxDocset("c++,net,boost,qt 4,qt 5,cvcpp,cocos2dx,c,manpages")
    , m_phpDocset("php,wordpress,drupal,zend,laravel,yii,joomla,ee,codeigniter,cakephp,phpunit,symfony,typo3,twig,"
                  "smarty,phpp,html,statamic,mysql,sqlite,mongodb,psql,redis,zend framework 1,zend framework 2")
    , m_htmlDocset(
          "html,svg,css,bootstrap,less,foundation,awesome,statamic,javascript,jquery,jqueryui,jquerym,angularjs,"
          "backbone,marionette,meteor,moo,prototype,ember,lodash,underscore,sencha,extjs,knockout,zepto,"
          "cordova,phonegap,yui")
    , m_cmakeDocset("cmake")
    , m_cssDocset(m_htmlDocset)
    , m_jsDocset(m_htmlDocset)
    , m_javaDocset("java,javafx,grails,groovy,playjava,spring,cvj,processing")
{
}

HelpPluginSettings::~HelpPluginSettings() {}

HelpPluginSettings& HelpPluginSettings::Load()
{
    clConfig conf("help-plugin.conf");
    conf.ReadItem(this);
    return *this;
}

HelpPluginSettings& HelpPluginSettings::Save()
{
    clConfig conf("help-plugin.conf");
    conf.WriteItem(this);
    return *this;
}
void HelpPluginSettings::FromJSON(const JSONElement& json)
{
    m_cxxDocset = json.namedObject("m_cxxDocset").toString(m_cxxDocset);
    m_phpDocset = json.namedObject("m_phpDocset").toString(m_phpDocset);
    m_htmlDocset = json.namedObject("m_htmlDocset").toString(m_htmlDocset);
    m_cmakeDocset = json.namedObject("m_cmakeDocset").toString(m_cmakeDocset);
    m_cssDocset = json.namedObject("m_cssDocset").toString(m_cssDocset);
    m_jsDocset = json.namedObject("m_jsDocset").toString(m_jsDocset);
    m_javaDocset = json.namedObject("m_javaDocset").toString(m_javaDocset);
}

JSONElement HelpPluginSettings::ToJSON() const
{
    JSONElement json = JSONElement::createObject(GetName());
    json.addProperty("m_cxxDocset", m_cxxDocset);
    json.addProperty("m_phpDocset", m_phpDocset);
    json.addProperty("m_htmlDocset", m_htmlDocset);
    json.addProperty("m_cmakeDocset", m_cmakeDocset);
    json.addProperty("m_cssDocset", m_cssDocset);
    json.addProperty("m_jsDocset", m_jsDocset);
    json.addProperty("m_javaDocset", m_javaDocset);
    return json;
}