/// <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)); }
/// <summary> /// Open a <see cref="Csv"/> from the provided stream. /// </summary> public static Csv Open(Stream fileStream, CsvOptions options) => new Csv(fileStream, options, false);
/// <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);
/// <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);
/// <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);
/// <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);