1 using System.Collections.Generic; 2 3 namespace Lextm.SharpSnmpLib.Mib.Elements.Types 4 { 5 public class OctetStringType : BaseType 6 { 7 private ValueRanges _size; 8 OctetStringType(IModule module, string name, ISymbolEnumerator symbols)9 public OctetStringType(IModule module, string name, ISymbolEnumerator symbols) 10 : base(module, name) 11 { 12 Symbol current = symbols.NextNonEOLSymbol(); 13 if (current == Symbol.OpenParentheses) 14 { 15 symbols.PutBack(current); 16 _size = Lexer.DecodeRanges(symbols); 17 current.Assert(_size.IsSizeDeclaration, "SIZE keyword is required for ranges of octet string!"); 18 } 19 else 20 { 21 symbols.PutBack(current); 22 _size = new ValueRanges(isSizeDecl: true); 23 } 24 } 25 26 public ValueRanges Size 27 { 28 get { return _size; } 29 } 30 } 31 } 32