31 return isdigit (*i) || (*i ==
'-' && isdigit (i[1]));
43 while (isdigit (*++i)) ;
78 const char* d_a = NULL;
79 const char* d_b = NULL;
81 for (;*a && *b; ++a, ++b) {
88 while (*d_a ==
'0') {
if (d_a[1] && isdigit (d_a[1])) { ++d_a; }
else {
break; } }
89 while (*d_b ==
'0') {
if (d_b[1] && isdigit (d_b[1])) { ++d_b; }
else {
break; } }
112 if (*a) {
return false; }
113 if (*b) {
return true; }
120 const char* d_a = NULL;
121 const char* d_b = NULL;
123 for (;*a && *b; ++a, ++b) {
124 if (isdigit (*a) && isdigit (*b) && !d_a) {
129 const int ia =
atoi (d_a);
130 const int ib =
atoi (d_b);
132 return ia < ib ? -1 : 1;
142 if (*a ==
'_' && *b ==
' ') {
145 if (*b ==
'_' && *a ==
' ') {
149 return ' ' < *b ? -1 : 1;
150 }
else if (*b ==
'_') {
151 return *a <
' ' ? -1 : 1;
154 return *a < *b ? -1 : 1;
158 const int ia =
atoi (d_a);
159 const int ib =
atoi (d_b);
161 return ia < ib ? -1 : 1;
168 if (*a) {
return 1; }
169 if (*b) {
return -1; }
bool naturally_less(const char *a, const char *b)
int atoi(const std::string &)
int natcmp(const char *a, const char *b)
int64_t order_of_magnitude(const char *i)
bool numerically_less(const char *a, const char *b)
bool is_integer(const char *i)