Where Online Learning is simpler!
The C and C++ Include Header Files
cat -n /usr/include/nodejs/src/node_config_file.h
1 #ifndef SRC_NODE_CONFIG_FILE_H_ 2 #define SRC_NODE_CONFIG_FILE_H_ 3 4 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 5 6 #include <map> 7 #include <string> 8 #include <variant> 9 #include "node_internals.h" 10 #include "simdjson.h" 11 #include "util-inl.h" 12 13 namespace node { 14 15 // When trying to parse the configuration file, we can have three possible 16 // results: 17 // - Valid: The file was successfully parsed and the content is valid. 18 // - FileError: There was an error reading the file. 19 // - InvalidContent: The file was read, but the content is invalid. 20 enum ParseResult { Valid, FileError, InvalidContent }; 21 22 // ConfigReader is the class that parses the configuration JSON file. 23 // It reads the file provided by --experimental-config-file and 24 // extracts the flags. 25 class ConfigReader { 26 public: 27 ParseResult ParseConfig(const std::string_view& config_path); 28 29 std::optional<std::string_view> GetDataFromArgs( 30 const std::vector<std::string>& args); 31 32 std::string AssignNodeOptions(); 33 34 size_t GetFlagsSize(); 35 36 private: 37 ParseResult ParseNodeOptions(simdjson::ondemand::object* node_options_object); 38 39 std::vector<std::string> node_options_; 40 }; 41 42 } // namespace node 43 44 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 45 46 #endif // SRC_NODE_CONFIG_FILE_H_