Feb 20, 2024 08:26 AM
(This post was last modified: Feb 20, 2024 08:27 AM by Hackers.)
Simple C++ Env Parser
EnvParser is a simple C++ class for parsing .env files and managing environment variables.
Hi all - if you have not yet seen Klonopin's iniParser, I recommend checking that out here:
https://hackforums.net/showthread.php?tid=6264256
I forked Klonopin's iniParser to create envParser. The functionality for how you use this class is the same for adding, removing, and getting key values out of a .env.
There is 1 known issue with some filesystems not opening ".env" so I have used "demo.env" in the example.
Parses .env files and stores key-value pairs.
Supports setting, removing, and retrieving key-value pairs.
Saves changes to .env files.
Usage:
![[Image: AdPsNQe.png]](https://i.imgur.com/AdPsNQe.png)
Source Code
EnvParser is a simple C++ class for parsing .env files and managing environment variables.
Hi all - if you have not yet seen Klonopin's iniParser, I recommend checking that out here:
https://hackforums.net/showthread.php?tid=6264256
I forked Klonopin's iniParser to create envParser. The functionality for how you use this class is the same for adding, removing, and getting key values out of a .env.
There is 1 known issue with some filesystems not opening ".env" so I have used "demo.env" in the example.
Parses .env files and stores key-value pairs.
Supports setting, removing, and retrieving key-value pairs.
Saves changes to .env files.
Usage:
![[Image: AdPsNQe.png]](https://i.imgur.com/AdPsNQe.png)
Source Code
Code
https://github.com/LNodesL/envParser


![[Image: bannerman2-0.png]](https://i.ibb.co/L5wHzv1/bannerman2-0.png)