Skip to content

Commit

Permalink
Simplify and fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
okalachev committed Feb 28, 2025
1 parent 75127eb commit 51fa5a6
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions gazebo/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@ class __FlashStringHelper;
// https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/
class String: public std::string {
public:
String(const char *str = "") : std::string(str ? str : "") {}
long toInt() const { return atol(this->c_str()); }
float toFloat() const { return atof(this->c_str()); }
bool isEmpty() const { return this->empty(); }
void toCharArray(char *buf, unsigned int bufsize, unsigned int index = 0) const {
strlcpy(buf, this->c_str() + index, bufsize);
}
void trim() {
this->erase(0, this->find_first_not_of(" \t\n\r"));
this->erase(this->find_last_not_of(" \t\n\r") + 1);
}
};

class Print;
Expand Down

0 comments on commit 51fa5a6

Please sign in to comment.