Exemplo 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));
        }
Exemplo 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);
Exemplo 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);
Exemplo 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);
Exemplo 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);
Exemplo 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);