diff --git a/src/csv/CMakeLists.txt b/src/csv/CMakeLists.txt index c682f51..38e27b5 100644 --- a/src/csv/CMakeLists.txt +++ b/src/csv/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(csv STATIC + csv.hh read-csv.cc read-csv.hh ) diff --git a/src/csv/csv.hh b/src/csv/csv.hh new file mode 100644 index 0000000..bb84782 --- /dev/null +++ b/src/csv/csv.hh @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + +namespace kraken::csv { + +/// Represent a raw CSV line as a vector of strings. +using csv_line_type = std::vector; + +/// Represent a raw CSV file as a vector of raw CSV lines +using csv_type = std::vector; + +} // namespace kraken::csv diff --git a/src/csv/read-csv.hh b/src/csv/read-csv.hh index a1ceab8..674da6a 100644 --- a/src/csv/read-csv.hh +++ b/src/csv/read-csv.hh @@ -1,8 +1,8 @@ #pragma once #include -#include -#include + +#include "csv/csv.hh" namespace kraken::csv { @@ -14,12 +14,6 @@ enum class CsvHeader { KEEP, }; -/// Represent a raw CSV line as a vector of strings. -using csv_line_type = std::vector; - -/// Represent a raw CSV file as a vector of raw CSV lines -using csv_type = std::vector; - /// Parse a CSV file from an input-stream, return a vector of parsed lines. csv_type read_csv(std::istream& input, CsvHeader header = CsvHeader::SKIP);