Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add additional utils for working with envfiles #346

Open
leha-bot opened this issue Feb 7, 2025 · 2 comments
Open

Feature request: add additional utils for working with envfiles #346

leha-bot opened this issue Feb 7, 2025 · 2 comments

Comments

@leha-bot
Copy link

leha-bot commented Feb 7, 2025

The .env files are pretty neat way to pass-through some key-value pairs into program environment variables and some internal configs.
It would be great if reflect-cpp would support some load-like functionality for .env files and serializing/deserializing from/to struct, but there would be some conceptual differences comparing to yaml/json/another hierarchical formats,

Also it possilbly should add new processor UpperSnakeCaseToSnakeCase and reversed.

@liuzicheng1987
Copy link
Contributor

liuzicheng1987 commented Feb 7, 2025

Hi @leha-bot ,

Maybe we could wrap around this library:

https://github.com/ph3at/libenvpp

I assume by upper snake case you mean this: UPPER_SNAKE_CASE?

I don't even think you would need a special processor for that, we could just introduce UpperCase and LowerCase processors.

@leha-bot
Copy link
Author

leha-bot commented Feb 7, 2025

I actually thought about wrapping this library, as it is pretty neat for work with envs, but, AFAIK, it couldn't parse .env files

I saw the (seems long-abandoned) library https://github.com/adeharo9/cpp-dotenv/ with parser (it uses ANTLR parser)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants