2 using System.Collections.Generic;
5 namespace Lextm.SharpSnmpLib.Mib
18 private NumType _type;
19 private int _decimalPoints = 0;
24 if (str.StartsWith(
"d"))
27 if (str.StartsWith(
"d-"))
29 _decimalPoints = Convert.ToInt32(str.Substring(2));
32 else if (str.StartsWith(
"o"))
36 else if (str.StartsWith(
"h"))
40 else if (str.StartsWith(
"b"))
47 foreach (
char c
in str)
60 internal object Decode(
int i)
65 if (_decimalPoints == 0)
71 return i / Math.Pow(10.0, _decimalPoints);
74 return System.Convert.ToString(i, 16);
76 return System.Convert.ToString(i, 8);
78 return System.Convert.ToString(i, 2);
override string ToString()