kraken: csv: move type aliases to 'csv.hh' header
As we need to share it with the CSV writing files.
This commit is contained in:
parent
697f941cb2
commit
0dee0e12dc
|
@ -1,4 +1,5 @@
|
||||||
add_library(csv STATIC
|
add_library(csv STATIC
|
||||||
|
csv.hh
|
||||||
read-csv.cc
|
read-csv.cc
|
||||||
read-csv.hh
|
read-csv.hh
|
||||||
)
|
)
|
||||||
|
|
14
src/csv/csv.hh
Normal file
14
src/csv/csv.hh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace kraken::csv {
|
||||||
|
|
||||||
|
/// Represent a raw CSV line as a vector of strings.
|
||||||
|
using csv_line_type = std::vector<std::string>;
|
||||||
|
|
||||||
|
/// Represent a raw CSV file as a vector of raw CSV lines
|
||||||
|
using csv_type = std::vector<csv_line_type>;
|
||||||
|
|
||||||
|
} // namespace kraken::csv
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
#include "csv/csv.hh"
|
||||||
|
|
||||||
namespace kraken::csv {
|
namespace kraken::csv {
|
||||||
|
|
||||||
|
@ -14,12 +14,6 @@ enum class CsvHeader {
|
||||||
KEEP,
|
KEEP,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Represent a raw CSV line as a vector of strings.
|
|
||||||
using csv_line_type = std::vector<std::string>;
|
|
||||||
|
|
||||||
/// Represent a raw CSV file as a vector of raw CSV lines
|
|
||||||
using csv_type = std::vector<csv_line_type>;
|
|
||||||
|
|
||||||
/// Parse a CSV file from an input-stream, return a vector of parsed lines.
|
/// 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);
|
csv_type read_csv(std::istream& input, CsvHeader header = CsvHeader::SKIP);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue