C++ option/long option implementation

Posted by K Hein on Stack Overflow See other posts from Stack Overflow or by K Hein
Published on 2012-09-30T05:11:57Z Indexed on 2012/09/30 9:37 UTC
Read the original article Hit count: 251

Filed under:
|
|

I am working on a parser for meta programming language using C++ on Linux platform. Right now, I need to implement option/long option for the parser to provide some additional features. Basically, if the user pass in some additional option, the parser needs to store statistics while parsing the text files.

I can think of two ways to implement it. One way is to user global to store options entered by users. Another way is to create a singleton class to store options. So I would like to know if there is any other way to implement it. What is the best/most recommended way of implementing it? Thanks in advance.

Regards,

K.Hein

© Stack Overflow or respective owner

Related posts about c++

Related posts about linux