MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / _parse_number

Function _parse_number

externals/picojson/picojson.h:856–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856template <typename Iter> inline std::string _parse_number(input<Iter> &in) {
857 std::string num_str;
858 while (1) {
859 int ch = in.getc();
860 if (('0' <= ch && ch <= '9') || ch == '+' || ch == '-' || ch == 'e' || ch == 'E') {
861 num_str.push_back(static_cast<char>(ch));
862 } else if (ch == '.') {
863#if PICOJSON_USE_LOCALE
864 num_str += localeconv()->decimal_point;
865#else
866 num_str.push_back('.');
867#endif
868 } else {
869 in.ungetc();
870 break;
871 }
872 }
873 return num_str;
874}
875
876template <typename Context, typename Iter> inline bool _parse(Context &ctx, input<Iter> &in) {
877 in.skip_ws();

Callers 1

_parseFunction · 0.85

Calls 3

getcMethod · 0.80
ungetcMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected