+std::string OI2String(OBJECT_IDENTIFIER_t * oi)
+{
+std::string res;
+
+int arcs[1024];
+int count = OBJECT_IDENTIFIER_get_arcs(oi, arcs, sizeof(arcs[0]), 1024);
+
+if (count > 1024)
+ return "";
+
+for (int i = 0; i < count; ++i)
+ {
+ res += ".";
+ std::string arc;
+ strprintf(&arc, "%d", arcs[i]);
+ res += arc;
+ }
+
+return res;
+}
+
+bool String2OI(const std::string & str, OBJECT_IDENTIFIER_t * oi)
+{
+size_t left = 0, pos = 0, arcPos = 0;
+int arcs[1024];
+pos = str.find_first_of('.', left);
+if (pos == 0)
+ {
+ left = 1;
+ pos = str.find_first_of('.', left);
+ }
+while (pos != std::string::npos)
+ {
+ int arc = 0;
+ if (str2x(str.substr(left, left - pos), arc))
+ {
+ return false;
+ }
+ arcs[arcPos++] = arc;
+ left = pos + 1;
+ pos = str.find_first_of('.', left);
+ }
+if (left < str.length())
+ {
+ int arc = 0;
+ if (str2x(str.substr(left, left - pos), arc))
+ {
+ return false;
+ }
+ arcs[arcPos++] = arc;
+ }
+printfd(__FILE__, "String2OI() - arcPos: %d\n", arcPos);
+OBJECT_IDENTIFIER_set_arcs(oi, arcs, sizeof(arcs[0]), arcPos);
+return true;
+}
+