mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-23 17:23:44 +08:00
bump cereal (#29561)
old-commit-hash: e726505918bfbaa4ee75714bd6ea391d7fff7fb8
This commit is contained in:
@@ -253,6 +253,14 @@ std::string dir_name(std::string const &path) {
|
||||
return path.substr(0, pos);
|
||||
}
|
||||
|
||||
bool starts_with(const std::string &s1, const std::string &s2) {
|
||||
return strncmp(s1.c_str(), s2.c_str(), s2.size()) == 0;
|
||||
}
|
||||
|
||||
bool ends_with(const std::string &s1, const std::string &s2) {
|
||||
return strcmp(s1.c_str() + (s1.size() - s2.size()), s2.c_str()) == 0;
|
||||
}
|
||||
|
||||
std::string check_output(const std::string& command) {
|
||||
char buffer[128];
|
||||
std::string result;
|
||||
|
||||
@@ -77,6 +77,8 @@ float getenv(const char* key, float default_val);
|
||||
|
||||
std::string hexdump(const uint8_t* in, const size_t size);
|
||||
std::string dir_name(std::string const& path);
|
||||
bool starts_with(const std::string &s1, const std::string &s2);
|
||||
bool ends_with(const std::string &s1, const std::string &s2);
|
||||
|
||||
// ***** random helpers *****
|
||||
int random_int(int min, int max);
|
||||
|
||||
Reference in New Issue
Block a user