public void OpenIndex(long indexId, IndexFileInfo ci) { IndexFile ixf; IxDict.TryGetValue(indexId, out ixf); if (ixf == null) { var stream = Database.OpenFile(FileType.Index, indexId); IxDict[indexId] = new IndexFile(stream, ci, Database, indexId); } }
public int LookupJumpId(string name) { int result; if (JumpLookup.TryGetValue(name, out result)) { return(result); } return(-1); }
public int Lookup(string name) // Gets the number of a local variable, -1 if not declared. { int result; if (LocalVarLookup.TryGetValue(name, out result)) { return(result); } return(-1); }
public IndexPage GetPage( long pageId ) { IndexPage p; PageMap.TryGetValue( pageId, out p ); if ( p == null ) { var data = ReadPage( pageId ); p = ( 1 & data[0] ) == 0 ? new IndexPage( Inf, data, Database ) : new PageParent( Inf, data, Database ); p.PageId = pageId; p.Saved = true; PageMap[ pageId ] = p; p.CheckPage(); } return p; }
Schema GetSchema( string name, bool mustExist, Exec e ) { Schema result; SchemaDict.TryGetValue( name, out result ); if ( result != null ) return result; int id = ReadSchemaId( name ); if ( id < 0 ) { if ( mustExist) e.Error( "Schema not found: " + name ); return null; } result = new Schema( name, id ); SchemaDict[ name ] = result; return result; }
byte [] GetBuffer( long bufferNum ) { byte [] result; if ( Buffers.TryGetValue( bufferNum, out result ) ) return result; result = new byte[ BufferSize ]; Buffers[ bufferNum ] = result; long pos = bufferNum << BufferShift; if ( BaseStream.Position != pos ) BaseStream.Position = pos; int i = 0; while ( i < BufferSize ) { int got = BaseStream.Read( result, i, BufferSize - i ); if ( got == 0 ) break; i += got; } return result; }
public TableExpression GetCachedTable( string name ) { TableExpression result; TableDict.TryGetValue( name, out result ); return result; }