summaryrefslogtreecommitdiff
path: root/include/lib/ArduinoJson/Polyfills/isInteger.hpp
blob: 8049079a72c8a3752338c5e3ed34f23e3b2d5acd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2018
// MIT License

#pragma once

#include "./ctype.hpp"

namespace ArduinoJson {
namespace Internals {

inline bool isInteger(const char* s) {
  if (!s || !*s) return false;
  if (issign(*s)) s++;
  while (isdigit(*s)) s++;
  return *s == '\0';
}
}  // namespace Internals
}  // namespace ArduinoJson