public bool TryGetValue(string text, out int val) { val = default; if (text == null) { return(false); } var systemTab = SharedSymbolTable.GetSystem(1); var st = systemTab.Find(text); if (st.Text != null) { //found it val = st.Sid; return(true); } // for (int i = 0, l = Symbols.SystemSymbolTokens.Length; i < l; i++) // { // var systemToken = Symbols.SystemSymbolTokens[i]; // if (systemToken.Text != text) continue; // val = systemToken.Sid; // return true; // } if (Parents.Length == 0) { return(false); } return(_dict.TryGetValue(text, out val)); }
private void MoveNextUser() { base.HasNext(); // if we're not at the top (datagram) level or the next value is null if (this.CurrentDepth != 0 || this.valueIsNull) { return; } Debug.Assert(this.valueTid != BinaryConstants.TidTypedecl, "valueTid is Typedec1"); if (this.valueTid == BinaryConstants.TidSymbol) { // trying to read a symbol here // $ion_1_0 is read as an IVM only if it is not annotated // we already count the number of annotations if (this.Annotations.Count != 0) { return; } this.LoadOnce(); // just get it straight from the holder, no conversion needed var sid = this.valueVariant.IntValue; if (sid != SystemSymbols.Ion10Sid) { return; } this.SymbolTable = SharedSymbolTable.GetSystem(1); // user don't need to see this symbol so continue here this.moveNextNeeded = true; } else if (this.valueTid == BinaryConstants.TidStruct) { // trying to read the local symbolTable here if (this.hasSymbolTableAnnotation) { this.SymbolTable = ReaderLocalTable.ImportReaderTable(this, this.catalog, false); // user don't need to read the localsymboltable so continue this.moveNextNeeded = true; } } }
public bool TryGetValue(string text, out int val) { if (text == null) { val = 0; return(false); } var systemTab = SharedSymbolTable.GetSystem(1); val = systemTab.FindSymbolId(text); if (val > 0) { return(true); } return(this.dict.TryGetValue(text, out val)); }
protected SystemTreeReader(IIonValue value) { this.systemSymbols = SharedSymbolTable.GetSystem(1); this.current = null; this.eof = false; this.top = 0; if (value.Type() == IonType.Datagram) { this.parent = value; this.next = null; this.iter = value.GetEnumerator(); } else { this.parent = null; this.next = value; } }
protected SystemTreeReader(IIonValue value) { _systemSymbols = SharedSymbolTable.GetSystem(1); _current = null; _eof = false; _top = 0; if (value.Type() == IonType.Datagram) { _parent = value; _next = null; _iter = value.GetEnumerator(); } else { _parent = null; _next = value; } }
protected SystemTextReader(TextStream input) : base(input) { this.systemSymbols = SharedSymbolTable.GetSystem(1); }
internal SystemBinaryReader(Stream input) : this(input, SharedSymbolTable.GetSystem(1)) { }
public override ISymbolTable GetSystemTable() => SharedSymbolTable.GetSystem(1);
public ISymbolTable GetSystemTable() => SharedSymbolTable.GetSystem(1);
internal SystemBinaryReader(Stream input, IReaderRoutine readerRoutine) : this(input, SharedSymbolTable.GetSystem(1), readerRoutine) { }
protected SystemTextReader(TextStream input, IonType parent) : base(input, parent) { _systemSymbols = SharedSymbolTable.GetSystem(1); }