MCPcopy Create free account
hub / github.com/Kitware/CMake / GetNumericArgument

Function GetNumericArgument

Source/cmGeneratorExpressionNode.cxx:789–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787
788template <typename IndexType>
789bool GetNumericArgument(std::string const& arg, IndexType& value)
790{
791 try {
792 std::size_t pos;
793
794 if (sizeof(IndexType) == sizeof(long)) {
795 value = std::stol(arg, &pos);
796 } else {
797 value = std::stoll(arg, &pos);
798 }
799
800 if (pos != arg.length()) {
801 // this is not a number
802 return false;
803 }
804 } catch (std::invalid_argument const&) {
805 return false;
806 }
807
808 return true;
809}
810
811template <typename IndexType>
812bool GetNumericArguments(

Callers 2

GetNumericArgumentsFunction · 0.85
EvaluateMethod · 0.85

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…