mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/50588 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
38 lines
889 B
C++
38 lines
889 B
C++
#ifndef SRC_NODE_DOTENV_H_
|
|
#define SRC_NODE_DOTENV_H_
|
|
|
|
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#include "util-inl.h"
|
|
|
|
#include <map>
|
|
|
|
namespace node {
|
|
|
|
class Dotenv {
|
|
public:
|
|
Dotenv() = default;
|
|
Dotenv(const Dotenv& d) = default;
|
|
Dotenv(Dotenv&& d) noexcept = default;
|
|
Dotenv& operator=(Dotenv&& d) noexcept = default;
|
|
Dotenv& operator=(const Dotenv& d) = default;
|
|
~Dotenv() = default;
|
|
|
|
bool ParsePath(const std::string_view path);
|
|
void AssignNodeOptionsIfAvailable(std::string* node_options);
|
|
void SetEnvironment(Environment* env);
|
|
|
|
static std::vector<std::string> GetPathFromArgs(
|
|
const std::vector<std::string>& args);
|
|
|
|
private:
|
|
void ParseLine(const std::string_view line);
|
|
std::map<std::string, std::string> store_;
|
|
};
|
|
|
|
} // namespace node
|
|
|
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#endif // SRC_NODE_DOTENV_H_
|