From: Marco Costalba Date: Mon, 1 Sep 2008 14:03:01 +0000 (+0200) Subject: Preserve options order when printed X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=35010b4938a3425ad56f97e1eae3834cb99d7326;hp=6c64f68ccf18a4ee1d4429abbef5fb4c0e216504 Preserve options order when printed Use a vector instead of a map so that options are printed according to their original order. Signed-off-by: Marco Costalba --- diff --git a/src/ucioption.cpp b/src/ucioption.cpp index d700e6d1..37c0d40f 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -22,7 +22,6 @@ //// #include -#include #include #include #include @@ -53,23 +52,22 @@ namespace { typedef std::vector ComboValues; - struct OptionValue + struct Option { - std::string defaultValue, currentValue; + std::string name, defaultValue, currentValue; OptionType type; int minValue, maxValue; ComboValues comboValues; - // Helper to convert a bool or an int in a std::string + // Helper to convert a bool or an int to a std::string template std::string stringify(const T& v); - OptionValue(); // this is needed to use a std::map - OptionValue(const char* defaultValue, OptionType = STRING); - OptionValue(bool defaultValue); - OptionValue(int defaultValue, int minValue, int maxValue); + Option(const char* name, const char* defaultValue, OptionType = STRING); + Option(const char* name, bool defaultValue); + Option(const char* name, int defaultValue, int minValue, int maxValue); }; - typedef std::map Options; + typedef std::vector