Jpp  master_rocky
the software that should make you happy
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 convertHeader< CPP >(std::ostream &out, const Header &header)
Definition: csv2cpp.cc:6
void convertCSV< CPP >(std::ostream &out, const CSV &csv)
Definition: csv2cpp.cc:21
Definition: csv2code.hh:15
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::vector< std::string > comments
Definition: csv2code.hh:19
std::string description
Definition: csv2code.hh:10
std::string base
Definition: csv2code.hh:9
std::string url
Definition: csv2code.hh:11