File : Config.js

1
/*
2
Copyright - 2021 - wwwouaiebe - Contact: https://www.ouaie.be/
3
4
This  program is free software;
5
you can redistribute it and/or modify it under the terms of the
6
GNU General Public License as published by the Free Software Foundation;
7
either version 3 of the License, or any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
*/
18
/*
19
Changes:
20
    - v1.0.0:
21
        - created
22
    - v1.2.0:
23
        - Issue ♯4 : Add an option to avoid the HTML files generation
24
Doc reviewed 20211111
25
*/
26
/* ------------------------------------------------------------------------------------------------------------------------- */
27
28
/* ------------------------------------------------------------------------------------------------------------------------- */
29
/**
30
A simple container to store the app configuration
31
*/
32
/* ------------------------------------------------------------------------------------------------------------------------- */
33
34
class Config {
35
36
    /**
37
    The directory where the source files are. Coming from the --in parameter
38
    @type {String}
39
    */
40
41
    srcDir;
42
43
    /**
44
    The directory where the documentation files will be installed. Coming from the --out parameter
45
    @type {String}
46
    */
47
48
    docDir;
49
50
    /**
51
    The directory where the app is installed. Coming from the app parameter
52
    @type {String}
53
    */
54
55
    appDir;
56
57
    /**
58
    A flag indicating the validation must be done. Coming from the --validate parameter
59
    @type {boolean}
60
    */
61
62
    validate;
63
64
    /**
65
    A flag indicating the HTML files must not be created. Coming from the --noFiles parameter
66
    @type {boolean}
67
    */
68
69
    noFiles;
70
71
    /**
72
    A flag indicating that the documentation must be opened in the browser immediately after
73
    the generation. Coming from the --launch parameter
74
    @type {boolean}
75
    */
76
77
    launch;
78
79
    /**
80
    A flag indicating that the source files must not have colors for the js keywords and links for
81
    global variables and types. Coming from the --noSourcesColor parameter
82
    @type {boolean}
83
    */
84
85
    noSourcesColor;
86
87
    /**
88
    The constructor
89
    */
90
91
    constructor ( ) {
92
        this.srcDir = '';
93
        this.docDir = '';
94
        this.appDir = '';
95
        this.validate = false;
96
        this.noFiles = false;
97
        this.launch = false;
98
        this.noSourcesColor = false;
99
    }
100
101
}
102
103
/* ------------------------------------------------------------------------------------------------------------------------- */
104
/**
105
The one and only one instance of Config class. Notice that the object will be froozen directly after reading the parameters
106
*/
107
/* ------------------------------------------------------------------------------------------------------------------------- */
108
109
const theConfig = new Config;
110
111
export default theConfig;
112
113
/* --- End of file --------------------------------------------------------------------------------------------------------- */
114