Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / options / abstractoption.cpp
index 6d0bef51708d90ea0e6202e59528a8ae1a3ba1f5..a71ed24353a6867c35c2aceee5935a32e7c19c49 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
  *
  * GROMACS is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include "gromacs/options/abstractoption.h"
+#include "gmxpre.h"
+
+#include "abstractoption.h"
 
 #include "gromacs/options/abstractoptionstorage.h"
 #include "gromacs/options/optionflags.h"
@@ -209,19 +211,44 @@ bool OptionInfo::isRequired() const
     return option().isRequired();
 }
 
+int OptionInfo::minValueCount() const
+{
+    if (option().defaultValueIfSetExists())
+    {
+        return 0;
+    }
+    return option().minValueCount();
+}
+
+int OptionInfo::maxValueCount() const
+{
+    return option().maxValueCount();
+}
+
 const std::string &OptionInfo::name() const
 {
     return option().name();
 }
 
-const std::string &OptionInfo::description() const
+std::string OptionInfo::type() const
 {
-    return option().description();
+    return option().typeString();
 }
 
-const char *OptionInfo::type() const
+std::string OptionInfo::formatDescription() const
 {
-    return option().typeString();
+    std::string description(option().description());
+    std::string extraDescription(option().formatExtraDescription());
+    if (!extraDescription.empty())
+    {
+        description.append(extraDescription);
+    }
+    return description;
+}
+
+std::string OptionInfo::formatDefaultValueIfSet() const
+{
+    return option().formatDefaultValueIfSet();
 }
 
 int OptionInfo::valueCount() const
@@ -234,9 +261,4 @@ std::string OptionInfo::formatValue(int i) const
     return option().formatValue(i);
 }
 
-std::string OptionInfo::formatDefaultValueIfSet() const
-{
-    return option().formatDefaultValueIfSet();
-}
-
 } // namespace gmx