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
Doc reviewed 20211111
23
*/
24
/* ------------------------------------------------------------------------------------------------------------------------- */
25
26
/* ------------------------------------------------------------------------------------------------------------------------- */
27
/**
28
A simple container to store the app configuration
29
*/
30
/* ------------------------------------------------------------------------------------------------------------------------- */
31
32
class Config {
33
34
    /**
35
    The directory where the source files are. Coming from the --in parameter
36
    @type {String}
37
    */
38
39
    srcDir;
40
41
    /**
42
    The directory where the documentation files will be installed. Coming from the --out parameter
43
    @type {String}
44
    */
45
46
    docDir;
47
48
    /**
49
    The directory where the app is installed. Coming from the app parameter
50
    @type {String}
51
    */
52
53
    appDir;
54
55
    /**
56
    A flag indicating the validation must be done. Coming from the --validate parameter
57
    @type {boolean}
58
    */
59
60
    validate;
61
62
    /**
63
    A flag indicating that the documentation must be opened in the browser immediately after
64
    the generation. Coming from the --launch parameter
65
    @type {boolean}
66
    */
67
68
    launch;
69
70
    /**
71
    A flag indicating that the source files must not have colors for the js keywords and links for
72
    global variables and types. Coming from the --noSourcesColor parameter
73
    @type {boolean}
74
    */
75
76
    noSourcesColor;
77
78
    /**
79
    The constructor
80
    */
81
82
    constructor ( ) {
83
        this.srcDir = '';
84
        this.docDir = '';
85
        this.appDir = '';
86
        this.validate = false;
87
        this.launch = false;
88
        this.noSourcesColor = false;
89
    }
90
91
}
92
93
/* ------------------------------------------------------------------------------------------------------------------------- */
94
/**
95
The one and only one instance of Config class. Notice that the object will be froozen directly after reading the parameters
96
*/
97
/* ------------------------------------------------------------------------------------------------------------------------- */
98
99
const theConfig = new Config;
100
101
export default theConfig;
102
103
/* --- End of file --------------------------------------------------------------------------------------------------------- */
104