]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/smux/types.h
Introduced logger for plugins.
[stg.git] / projects / stargazer / plugins / other / smux / types.h
index 7d7adac2f6e70e5ebed0be7019b2d13c5244feae..5498d2ebce3e6350b2b4f513425e824e66b2f01b 100644 (file)
@@ -3,9 +3,9 @@
 
 #include <string>
 #include <vector>
-#include <istream>
+#include <iostream>
 
-#include "asn1/OBJECT_IDENTIFIER.h"
+#include "stg/OBJECT_IDENTIFIER.h"
 
 class OID {
     public:
@@ -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<unsigned> & 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<unsigned> & suffix) const;
+        OID copyWithSuffix(unsigned a, unsigned b) const;
+
         std::string ToString() const;
         const std::vector<unsigned> & 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<unsigned> arcs;
 };
 
+inline
+bool PrefixLess(const OID & a, const OID & b)
+{
+return a.PrefixLess(b);
+}
+
 #endif