Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JComLib.WriteManager"/> class for the
 /// given IO device, record index and format string.
 /// </summary>
 /// <param name="iodevice">The device to read from</param>
 /// <param name="record">The index of the record to write (for direct access)</param>
 /// <param name="formatString">Format string</param>
 public WriteManager(int iodevice, int record, string formatString)
 {
     _file = IOFile.Get(iodevice);
     if (_file == null) {
         _file = new IOFile(iodevice);
         _file.Open();
     }
     if (record >= 1) {
         _file.RecordIndex = record;
     }
     _file.IsFormatted = !string.IsNullOrEmpty(formatString);
     _format = new FormatManager(formatString);
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JComLib.WriteManager"/> class using
 /// a specified format string.
 /// </summary>
 /// <param name="formatStringArray">Format string</param>
 public WriteManager(FixedString[] formatStringArray)
 {
     StringBuilder str = new StringBuilder();
     foreach (FixedString formatString in formatStringArray) {
         str.Append(formatString);
     }
     _format = new FormatManager(str.ToString());
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JComLib.WriteManager"/> class using
 /// a specified format string.
 /// </summary>
 /// <param name="formatString">Format string</param>
 public WriteManager(string formatString)
 {
     _format = new FormatManager(formatString);
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JComLib.ReadManager"/> class for the
 /// given IO device, record index and format string.
 /// </summary>
 /// <param name="iodevice">The device to read from</param>
 /// <param name="record">The index of the record to read (for direct access)</param>
 /// <param name="formatString">Format string</param>
 public ReadManager(int iodevice, int record, string formatString)
 {
     _file = IOFile.Get(iodevice);
     if (_file == null) {
         _file = new IOFile(iodevice);
         _file.Open();
     }
     if (record >= 1) {
         _file.RecordIndex = record;
     }
     if (formatString == "*") {
         formatString = string.Empty;
         _file.IsFormatted = true;
     } else {
         _file.IsFormatted = !string.IsNullOrEmpty(formatString);
     }
     _format = new FormatManager(formatString);
     _format.BlanksAsZero = (_file.Blank == 'Z');
     _readIndex = -1;
 }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JComLib.ReadManager"/> class using
 /// the input string as the source.
 /// </summary>
 /// <param name="line">Input string to use</param>
 /// <param name="formatString">Format string</param>
 public ReadManager(string line, string formatString)
 {
     _line = line;
     _format = new FormatManager(formatString);
 }