Exemple #1
0
        /// <summary>
        /// Open a <see cref="Csv"/> from the input string.
        /// </summary>
        public static Csv FromString(string value, CsvOptions options)
        {
            var encoding = options.Encoding ?? Encoding.UTF8;

            return(new Csv(new MemoryStream(encoding.GetBytes(value)), options, true));
        }
Exemple #2
0
 /// <summary>
 /// Open a <see cref="Csv"/> from the provided stream.
 /// </summary>
 public static Csv Open(Stream fileStream, CsvOptions options) => new Csv(fileStream, options, false);
Exemple #3
0
 /// <summary>
 /// Open a <see cref="Csv"/> from the provided bytes.
 /// </summary>
 public static Csv Open(byte[] fileBytes, char separator = ',', bool hasHeaderRow = false) => new Csv(new MemoryStream(fileBytes), CsvOptions.WithSeparator(separator, hasHeaderRow), true);
Exemple #4
0
 /// <summary>
 /// Open a <see cref="Csv"/> from the provided stream.
 /// </summary>
 public static Csv Open(Stream fileStream, char separator = ',', bool hasHeaderRow = false) => new Csv(fileStream, CsvOptions.WithSeparator(separator, hasHeaderRow), false);
Exemple #5
0
 /// <summary>
 /// Open a <see cref="Csv"/> from a file at the given path.
 /// </summary>
 public static Csv Open(string filename, CsvOptions options) => new Csv(File.OpenRead(filename), options, true);
Exemple #6
0
 /// <summary>
 /// Open a <see cref="Csv"/> from a file at the given path.
 /// </summary>
 public static Csv Open(string filename, char separator = ',', bool hasHeaderRow = false) => new Csv(File.OpenRead(filename), CsvOptions.WithSeparator(separator, hasHeaderRow), true);