Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
csv2julia.cc
Go to the documentation of this file.
1#include "csv2julia.hh"
2
3template <>
4void convertHeader<JULIA>(std::ostream& out, const Header& header) {
5 out << "\"\"\"\n";
6 out << "# " << header.description << "\n";
7 out << header.url << "\n";
8 out << "\"\"\"\n";
9 out << "\n";
10 std::string BASE = header.base;
11 for (auto& c : BASE) {
12 c = toupper(c);
13 }
14 out << "module " << BASE << "\n";
15}
16
17template <>
18void convertCSV<JULIA>(std::ostream& out, const CSV& csv) {
19 for (auto i = 0; i < csv.types.size(); i++) {
20 out << " const " << csv.names[i] << " = " << csv.numbers[i] << "\n";
21 }
22 out << "end\n";
23}
void convertHeader< JULIA >(std::ostream &out, const Header &header)
Definition csv2julia.cc:4
void convertCSV< JULIA >(std::ostream &out, const CSV &csv)
Definition csv2julia.cc:18
std::vector< std::string > numbers
Definition csv2code.hh:18
std::vector< std::string > types
Definition csv2code.hh:16
std::vector< std::string > names
Definition csv2code.hh:17
std::string description
Definition csv2code.hh:10
std::string base
Definition csv2code.hh:9
std::string url
Definition csv2code.hh:11