Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
csv2cpp.cc
Go to the documentation of this file.
1 #include "csv2cpp.hh"
2 
3 #include <iomanip>
4 
5 template <>
6 void convertHeader<CPP>(std::ostream& out, const Header& header) {
7  out << "#ifndef __" << header.base << "__\n";
8  out << "#define __" << header.base << "__\n";
9  out << "\n";
10  out << "/**\n";
11  out << " * " << header.description << "\n";
12  out << " * " << header.url << "\n";
13  out << " */\n";
14  out << "\n";
15  out << "/**\n";
16  out << " * " << header.base << "\n";
17  out << " */\n";
18 }
19 
20 template <>
21 void convertCSV<CPP>(std::ostream& out, const CSV& csv) {
22  for (auto i = 0; i < csv.types.size(); i++) {
23  auto number = csv.numbers[i] + ";";
24  out << "static const " << csv.types[i] << " " << std::left << std::setw(32)
25  << csv.names[i] << " = " << std::left << std::setw(10) << number
26  << " //!< " << csv.comments[i] << "\n";
27  }
28  out << "#endif\n";
29 }
void convertCSV< CPP >(std::ostream &out, const CSV &csv)
Definition: csv2cpp.cc:21
void convertHeader< CPP >(std::ostream &out, const Header &header)
Definition: csv2cpp.cc:6
Definition: csv2code.hh:15