
#ifndef __WFX_UTIL_COMMANDPARAMS_H__
#define __WFX_UTIL_COMMANDPARAMS_H__

#include <WFX/WFXIncludes.h>
#include <WFX/lang/Singleton.h>

namespace WFX {

    namespace util {
    
        /**
         * Helper class that manages commandline parameters
         * params begining with a single dash are options e.g. -t
         * params begining with two dashes are options, the next non-dash param is the value e.g. --test 14
         * all other params are "files"
         */
        class CommandParams : public WFX::lang::Singleton<CommandParams> {
            public:
                /** Ctor/Dtor */
                CommandParams(Int argc, Char *argv[]);
                CommandParams();
                ~CommandParams();

                /** init */
                void init(Int argc, Char *argv[]);

                /** returns number of file parameters */
                UInt getFileCount();
                /** returns the file parameter indicated by id */
                std::string getFile(UInt id);
                /** returns whether an option was given */
                bool hasOption(const std::string& o);
                /** returns whether a value was given */
                bool hasValue(std::string o);
                /** returns the value for the given option */
                std::string getValue(const std::string& o);

                void printDebug();
            protected:
                /** Options */
                std::map<std::string, bool> Options;
                std::map<std::string, std::string> Values;
                std::vector<std::string> Files;
                
            private:
        };

    }
   
}


#endif //include guard

