Macaulay2 Engine
Loading...
Searching...
No Matches

◆ readInteger_long()

long readInteger_long ( const std::string_view & str,
size_t & begin_loc,
size_t end_loc )

Definition at line 44 of file BasicPolyListParser.cpp.

45{
46 // if str[0] is a digit, find the value, and increment str past the number.
47 // if it is not: return 1, leave str unchanged.
48 if (not isdigit(str[begin_loc])) return 1;
49 long result = 0;
50 size_t loc = begin_loc;
51 while (loc < end_loc and isdigit(str[loc]))
52 {
53 result = 10 * result + (str[loc] - '0');
54 loc++;
55 }
56
57 begin_loc = loc;
58 return result;
59}
VALGRIND_MAKE_MEM_DEFINED & result(result)

References result().

Referenced by parseBasicPoly().