Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-08-23 17:41:05 +0300
committerAnna Henningsen <anna@addaleax.net>2018-09-01 01:13:20 +0300
commite812be4a55915575fc1afce739848026a48b781e (patch)
tree2d654c5ef1a58ec22de69158305785b1556d06f6 /src/util.h
parent403df7c8a15a9714038c73e90371bed0d37437fa (diff)
src: make CLI options programatically accesible
Provide `internalBinding('options')` with some utilities around making the options parser and current options values programatically accessible. PR-URL: https://github.com/nodejs/node/pull/22490 Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index a9fce79ebea..057346a2d04 100644
--- a/src/util.h
+++ b/src/util.h
@@ -34,9 +34,10 @@
#include <stdlib.h>
#include <string.h>
-#include <string>
#include <functional> // std::function
#include <set>
+#include <string>
+#include <unordered_map>
namespace node {
@@ -479,6 +480,15 @@ using DeleteFnPtr = typename FunctionDeleter<T, function>::Pointer;
std::set<std::string> ParseCommaSeparatedSet(const std::string& in);
+inline v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
+ const std::string& str);
+template <typename T>
+inline v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
+ const std::vector<T>& vec);
+template <typename T, typename U>
+inline v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
+ const std::unordered_map<T, U>& map);
+
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS