parsing - Proper design to parse file in c++ -


i'm trying parse file , store different fields in variable. however, i'm not sure of proper design this:

should have class parsing , class storage, or should parser used storage hold fields ?

i have keep in mind might need extend parser new fields may appear in file.

edit: has been mentionned question broad. included more details here didn't want influence answers implemented. in current implementation faced issues extended parser, , pointed out shouldn't separate data storage , parser (because of single responsibility principle) me made sense separate them.

it's question of necessity. if problem stay small, put parsing , storage together. you'll have have parsed data somewhere in memory regardless, why not right comes in?

the main reason you'd want separate them if need store in different ways, such database or file, , need sort of interface can deal extensibility.

but think if looks come up.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -