| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/gavinlwz/esp32_https_server/master/src/util.cpp | [Back] [Original] |
#include "util.hpp"
namespace httpsserver {
int parseInt(std::string s) {
int i = 0; // value
int m = 1; // multiplier
// Check sign
size_t x = 0;
if (s[0]=='-') {
x = 1;
} else if (s[0]=='+') {
x = 1;
}
// Convert by base 10
for(; x < s.size(); x++) {
char c = s[x];
if (c >= '0' && c= 0; x--) {
char v = (i%10);
c[x] = '0' + v;
i = (i-v)/10;
}
return std::string(c);
}
}
| Web Proxy Viewer | New URL | Original Page |