Skip to content

Is it possible to convert raw string value of enum to enum? #1611

Answered by stephenberry
StormLord07 asked this question in Q&A
Discussion options

You must be logged in to vote

So, you're getting your enum from your database as a non-quoted string and want to get it into an enum value again. You could add quotes to make it a valid JSON string and then glz::read will work. Or, you could use a library like simple_enum, which also has support for working with Glaze.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@StormLord07
Comment options

Comment options

You must be logged in to vote
1 reply
@StormLord07
Comment options

Comment options

You must be logged in to vote
2 replies
@StormLord07
Comment options

@stephenberry
Comment options

Answer selected by StormLord07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants