MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / is_valid_int

Method is_valid_int

modules/gui/gui/src/backend/text_server/ustring.cpp:5072–5096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5070}
5071
5072bool String::is_valid_int() const
5073{
5074 int len = length();
5075
5076 if (len == 0)
5077 {
5078 return false;
5079 }
5080
5081 int from = 0;
5082 if (len != 1 && (operator[](0) == '+' || operator[](0) == '-'))
5083 {
5084 from++;
5085 }
5086
5087 for (int i = from; i < len; i++)
5088 {
5089 if (!is_digit(operator[](i)))
5090 {
5091 return false; // no start with number plz
5092 }
5093 }
5094
5095 return true;
5096}
5097
5098bool String::is_valid_hex_number(bool p_with_prefix) const
5099{

Callers 2

parse_urlMethod · 0.80
is_valid_ip_addressMethod · 0.80

Calls 2

is_digitFunction · 0.85
lengthFunction · 0.50

Tested by

no test coverage detected