Пример #1
0
 public GqlEngineState(GqlEngineExecutionState executionState)
 {
     ExecutionState = executionState;
     Variables = new Dictionary<string, Variable> (StringComparer.InvariantCultureIgnoreCase);
     Views = new Dictionary<string, ViewDefinition> (StringComparer.InvariantCultureIgnoreCase);
     AutoSize = 0;
     ColumnDelimiter = "\t";
     Warnings = new List<Exception> ();
 }
Пример #2
0
        public void Initialize(GqlQueryState gqlQueryState)
        {
            this.gqlQueryState = gqlQueryState;
            gqlEngineExecutionState = gqlQueryState.CurrentExecutionState;

            string fileName;
            if (this.fileName.StartsWith ("#")) {
                fileName = Path.Combine (gqlQueryState.TempDirectory, this.fileName);
            } else {
                fileName = Path.Combine (gqlQueryState.CurrentDirectory, this.fileName);
            }
            streamReader = new StreamReader (new AsyncStreamReader (new FileStream (fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 32 * 1024), 32 * 1024));
            record = new ProviderRecord (this, true);
            record.Source = fileName;
            dataString = new DataString ();
            record.Columns [0] = dataString;

            for (long i = 0; i < skip; i++) {
                if (streamReader.ReadLine () == null) {
                    streamReader.Close ();
                    streamReader = null;
                    return;
                }
            }
        }
Пример #3
0
 public void Uninitialize()
 {
     record = null;
     if (streamReader != null) {
         streamReader.Close ();
         streamReader.Dispose ();
     }
     streamReader = null;
     gqlEngineExecutionState = null;
 }