diff options
Diffstat (limited to 'proto_lib/utilities.cpp')
-rw-r--r-- | proto_lib/utilities.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/proto_lib/utilities.cpp b/proto_lib/utilities.cpp index 64f69bb..b54e45a 100644 --- a/proto_lib/utilities.cpp +++ b/proto_lib/utilities.cpp @@ -81,4 +81,30 @@ const unsigned char *to_internal_type(packet_type t) return type; } +#ifdef DEBUG +bool service_s::cmd::operator==(const cmd& c) +{ + if(c.command != command) + return false; + if(c.description != description) + return false; + return true; +} + +bool service_s::operator==(service_s& s) +{ + if(s.service != service) + return false; + for(std::list<service_s::cmd>::iterator i = s.cmds.begin(), end = s.cmds.end(); i != end; ++i) + { + if(std::find(cmds.begin(), cmds.end(), *i) == cmds.end()) + return false; + } + return true; +} +bool service_s::operator!=(service_s& s) +{ + return !(*this == s); +} +#endif }; |