// *************************************************************************** // bamtools_options.h (c) 2010 Derek Barnett, Erik Garrison // Marth Lab, Department of Biology, Boston College // --------------------------------------------------------------------------- // Last modified: 10 October 2011 // --------------------------------------------------------------------------- // Parses command line arguments and creates a help menu // --------------------------------------------------------------------------- // Modified from: // The Mosaik suite's command line parser class: COptions // (c) 2006 - 2009 Michael Str�mberg // Marth Lab, Department of Biology, Boston College // Re-licensed under MIT License with author's permission. // // * Modified slightly to fit BamTools, otherwise code is same. // * (BamTools namespace, added stdin/stdout) (DB) // *************************************************************************** #ifndef BAMTOOLS_OPTIONS_H #define BAMTOOLS_OPTIONS_H #include "utils/bamtools_variant.h" #include "utils/utils_global.h" #include #include #include #ifndef WIN32 #include #endif namespace BamTools { #define ARGUMENT_LENGTH 35 #define DESC_LENGTH_FIRST_ROW 30 #define DESC_LENGTH 42 #define MAX_LINE_LENGTH 78 #ifdef WIN32 #define snprintf _snprintf typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #define strtoui64 _strtoui64 #else #define strtoui64 strtoull #endif struct UTILS_EXPORT Option { // data members std::string Argument; std::string ValueDescription; std::string Description; bool StoreValue; bool HasDefaultValue; Variant DefaultValue; // constructor Option(void) : StoreValue(true) , HasDefaultValue(false) { } }; struct UTILS_EXPORT OptionValue { // data members bool* pFoundArgument; void* pValue; std::string ValueTypeDescription; bool UseVector; bool StoreValue; bool IsRequired; Variant VariantValue; // constructor OptionValue(void) : pFoundArgument(NULL) , pValue(NULL) , UseVector(false) , StoreValue(true) , IsRequired(false) { } }; struct UTILS_EXPORT OptionGroup { std::string Name; std::vector