using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Collections.Concurrent;
using System.Threading.Tasks;
namespace Tango.CSV
{
///
/// Represents a source.
///
public class CsvSource
{
public readonly TextReader TextReader;
///
/// Performs an implicit conversion from to .
///
/// The CSV file.
///
/// The result of the conversion.
///
public static implicit operator CsvSource(CsvFile csvFile)
{
return new CsvSource(csvFile);
}
///
/// Performs an implicit conversion from to .
///
/// The path.
///
/// The result of the conversion.
///
public static implicit operator CsvSource(string path)
{
return new CsvSource(path);
}
///
/// Performs an implicit conversion from to .
///
/// The text reader.
///
/// The result of the conversion.
///
public static implicit operator CsvSource(TextReader textReader)
{
return new CsvSource(textReader);
}
///
/// Initializes a new instance of the class.
///
/// The text reader.
public CsvSource(TextReader textReader)
{
this.TextReader = textReader;
}
///
/// Initializes a new instance of the class.
///
/// The stream.
public CsvSource(Stream stream)
{
this.TextReader = new StreamReader(stream);
}
///
/// Initializes a new instance of the class.
///
/// The path.
public CsvSource(string path)
{
this.TextReader = new StreamReader(path);
}
///
/// Initializes a new instance of the class.
///
/// The CSV file.
public CsvSource(CsvFile csvFile)
{
this.TextReader = new StreamReader(csvFile.BaseStream);
}
}
}