Aller au contenu
Bienvenue sur la nouvelle documentation de CppUtils !

Namespace: CppUtils::Language::CSV

using CppUtils::Language::CSV::Line = std::vector<std::string_view>;
Container::Tree::VariantNode<Type::Token, std::string> parse(std::string_view src, char delimiter=';');
std::vector<std::vector<std::string>> parseTable(std::string_view src, char delimiter=';');
template <class Object, class Mapping>
Object toStruct(const auto& csvLine);
template <class Object, class Mapping>
std::vector<Object> toStructs(const auto& lines, std::size_t dropNFirstLines = 0, std::vector<Object>&& objects={});
template <class Object, class Mapping>
std::string toCSV(const Object& object, std::string_view separator=";");
template <class Object, class Mapping>
std::string toCSV(const std::vector<Object>& objects, std::string_view columnSeparator=";", std::string_view lineSeparator="\n");
template <class Object, class Mapping>
auto toStruct();
template <class Object, class Mapping>
auto toCSV(std::string_view separator=";");
template <class Object, class Mapping>
std::expected<Object, RejectEntry> toStructSafe(const auto& csvLine, std::string_view separator=";", std::size_t lineNumber = 0);
template <class Object, class Mapping>
auto toStructSafe(std::string_view separator=";");
auto routeRejected(std::filesystem::path path, std::string_view separator=";");
auto splitLineView(std::string_view line, std::string_view separator=";");
std::vector<std::string_view> splitLine(std::string_view line, std::string_view separator=";");
std::vector<std::vector<std::string_view>> parseCSV(std::string_view csv, std::string_view columnSeparator=";", std::string_view lineSeparator="\n");
template <class Object, class Mapping>
std::expected<std::vector<Object>, FileSystem::Error> loadFile(const std::filesystem::path& filePath, std::size_t dropNFirstLines = 0, std::string_view columnSeparator=";", std::string_view lineSeparator="\n", std::vector<Object>&& elements={});
auto parseLines(std::string_view separator=";");