X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/f22e1c9370866c330b79728a364c8ab1a9f43335..559d32bc2789dc69a7c19598a31f485c6caaff11:/projects/stargazer/plugins/other/smux/types.h diff --git a/projects/stargazer/plugins/other/smux/types.h b/projects/stargazer/plugins/other/smux/types.h index 974d56bf..a121bf7a 100644 --- a/projects/stargazer/plugins/other/smux/types.h +++ b/projects/stargazer/plugins/other/smux/types.h @@ -17,6 +17,18 @@ class OID { OID(const OID & rvalue); ~OID(); + bool addSuffix(const char * suffix, size_t length); + bool addSuffix(const std::string & suffix); + bool addSuffix(const unsigned * suffix, size_t length); + bool addSuffix(const std::vector & suffix); + bool addSuffix(unsigned a, unsigned b); + + OID copyWithSuffix(const char * suffix, size_t length) const; + OID copyWithSuffix(const std::string & suffix) const; + OID copyWithSuffix(const unsigned * suffix, size_t length) const; + OID copyWithSuffix(const std::vector & suffix) const; + OID copyWithSuffix(unsigned a, unsigned b) const; + std::string ToString() const; const std::vector & ToVector() const { return arcs; } void ToOID(OBJECT_IDENTIFIER_t * oid) const; @@ -28,10 +40,18 @@ class OID { bool operator>(const OID & rvalue) const { return !operator==(rvalue) && !operator<(rvalue); } + bool PrefixLess(const OID & rvalue) const; + friend std::ostream & operator<<(std::ostream & stream, const OID & oid); private: std::vector arcs; }; +inline +bool PrefixLess(const OID & a, const OID & b) +{ +return a.PrefixLess(b); +} + #endif