MongoDB  2.7.0
startup_options.h
1 /*
2  * Copyright (C) 2013 10gen Inc.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License, version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * As a special exception, the copyright holders give permission to link the
17  * code of portions of this program with the OpenSSL library under certain
18  * conditions as described in each individual source file and distribute
19  * linked combinations including the program with the OpenSSL library. You
20  * must comply with the GNU Affero General Public License in all respects for
21  * all of the code used other than as permitted herein. If you modify file(s)
22  * with this exception, you may extend this exception to your version of the
23  * file(s), but you are not obligated to do so. If you do not wish to do so,
24  * delete this exception statement from your version. If you delete this
25  * exception statement from all source files in the program, then also delete
26  * it in the license file.
27  */
28 
29 #include "mongo/util/options_parser/environment.h"
30 #include "mongo/util/options_parser/option_section.h"
31 
32 namespace mongo {
33 namespace optionenvironment {
34 
35  /*
36  * This structure stores information about all the command line options. The parser will use
37  * this description when it parses the command line, the INI config file, and the JSON config
38  * file. See the OptionSection and OptionDescription classes for more details.
39  *
40  * Example:
41  * MONGO_MODULE_STARTUP_OPTIONS_REGISTER(MongodOptions)(InitializerContext* context) {
42  * return addMongodOptions(&moe::startupOptions);
43  * startupOptions.addOptionChaining("option", "option", moe::String, "description");
44  * return Status::OK();
45  * }
46  */
47  extern OptionSection startupOptions;
48 
49  /*
50  * This structure stores the parsed command line options. After the "defult" group of the
51  * MONGO_INITIALIZERS, this structure should be fully validated from an option perspective. See
52  * the Environment, Constraint, and Value classes for more details.
53  *
54  * Example:
55  * if (startupOptionsParsed.count("option")) {
56  * std::string value;
57  * ret = startupOptionsParsed.get("option", &value);
58  * if (!ret.isOK()) {
59  * return ret;
60  * }
61  * }
62  */
63  extern Environment startupOptionsParsed;
64 
65 } // namespace optionenvironment
66 } // namespace mongo