/// <summary>Adds a new Fixed Length field.</summary>
        /// <param name="fieldName">The name of the field.</param>
        /// <param name="length">The length of the field.</param>
        /// <param name="fieldType">The Type of the field.</param>
        /// <returns>The just created field.</returns>
        public FixedFieldBuilder AddField(string fieldName, int length, string fieldType)
        {
            var fb = new FixedFieldBuilder(fieldName, length, fieldType);

            AddFieldInternal(fb);
            return(fb);
        }
        public FileFixedExtract(AbstractConnection connection, Entity entity, int top = 0) {
            var fileInfo = new FileInfo(connection.File);

            _entity = entity;
            _top = top;
            _fields = _entity.Fields.WithInput().ToArray();
            _fullName = fileInfo.FullName;
            _name = fileInfo.Name;
            _errorMode = connection.ErrorMode;
            int ignoreFirstLines = connection.Start - 1;

            _classBuilder = new FixedLengthClassBuilder("Tfl" + _entity.Alias) {
                IgnoreEmptyLines = true,
                IgnoreFirstLines = ignoreFirstLines
            };
            foreach (var field in _fields) {
                var length = field.Length.Equals("max", IC) ? int.MaxValue : Convert.ToInt32(field.Length.Equals(string.Empty) ? "64" : field.Length);
                var builder = new FixedFieldBuilder(field.Alias, length, typeof(string)) {
                    FieldNullValue = new String(' ', length)
                };
                _classBuilder.AddField(builder);
            }

        }
 /// <summary>Adds a new Fixed Length field.</summary>
 /// <param name="field">The field definition.</param>
 /// <returns>The just added field.</returns>
 public FixedFieldBuilder AddField(FixedFieldBuilder field)
 {
     AddFieldInternal(field);
     return(field);
 }
 /// <summary>Adds a new Fixed Length field.</summary>
 /// <param name="field">The field definition.</param>
 /// <returns>The just added field.</returns>
 public FixedFieldBuilder AddField(FixedFieldBuilder field)
 {
     AddFieldInternal(field);
     return field;
 }
 /// <summary>Adds a new Fixed Length field.</summary>
 /// <param name="fieldName">The name of the field.</param>
 /// <param name="length">The length of the field.</param>
 /// <param name="fieldType">The Type of the field.</param>
 /// <returns>The just created field.</returns>
 public FixedFieldBuilder AddField(string fieldName, int length, string fieldType)
 {
     var fb = new FixedFieldBuilder(fieldName, length, fieldType);
     AddFieldInternal(fb);
     return fb;
 }