X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fbinding%2Flow-can-hat.hpp;h=1662ce04fb72ecc9ff2f7437958c3a470bb9b202;hb=refs%2Ftags%2Fhalibut%2F8.0.2;hp=e21b9cd065e2a99d568370c513f45aa357c341d5;hpb=105d083165b263851edfcd3ffb7f64acb888d14b;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/binding/low-can-hat.hpp b/low-can-binding/binding/low-can-hat.hpp index e21b9cd0..1662ce04 100644 --- a/low-can-binding/binding/low-can-hat.hpp +++ b/low-can-binding/binding/low-can-hat.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -31,3 +32,12 @@ class low_can_subscription_t; void on_no_clients(std::shared_ptr can_subscription, std::map >& s); void on_no_clients(std::shared_ptr can_subscription, uint32_t pid, std::map >& s); int read_message(sd_event_source *s, int fd, uint32_t revents, void *userdata); + +inline bool caseInsCharCompareN(char a, char b) { + return(toupper(a) == toupper(b)); +} + +inline bool caseInsCompare(const std::string& s1, const std::string& s2) { + return((s1.size() == s2.size()) && + equal(s1.begin(), s1.end(), s2.begin(), caseInsCharCompareN)); +}