Esempio n. 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));
        }
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);