mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
There is no need to explicitly allow copy constructor and copy assignment, and some of these functions should be marked as const. PR-URL: https://github.com/nodejs/node/pull/52973 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
#ifndef SRC_NODE_DOTENV_H_
|
|
#define SRC_NODE_DOTENV_H_
|
|
|
|
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#include "util-inl.h"
|
|
#include "v8.h"
|
|
|
|
#include <map>
|
|
|
|
namespace node {
|
|
|
|
class Dotenv {
|
|
public:
|
|
enum ParseResult { Valid, FileError, InvalidContent };
|
|
|
|
Dotenv() = default;
|
|
Dotenv(const Dotenv& d) = delete;
|
|
Dotenv(Dotenv&& d) noexcept = default;
|
|
Dotenv& operator=(Dotenv&& d) noexcept = default;
|
|
Dotenv& operator=(const Dotenv& d) = delete;
|
|
~Dotenv() = default;
|
|
|
|
void ParseContent(const std::string_view content);
|
|
ParseResult ParsePath(const std::string_view path);
|
|
void AssignNodeOptionsIfAvailable(std::string* node_options) const;
|
|
void SetEnvironment(Environment* env);
|
|
v8::Local<v8::Object> ToObject(Environment* env) const;
|
|
|
|
static std::vector<std::string> GetPathFromArgs(
|
|
const std::vector<std::string>& args);
|
|
|
|
private:
|
|
std::map<std::string, std::string> store_;
|
|
};
|
|
|
|
} // namespace node
|
|
|
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#endif // SRC_NODE_DOTENV_H_
|