Jpp  master_rocky-37-gf0c5bc59d
the software that should make you happy
Functions
csv2cpp.cc File Reference
#include "csv2cpp.hh"
#include <iomanip>

Go to the source code of this file.

Functions

template<>
void convertHeader< CPP > (std::ostream &out, const Header &header)
 
template<>
void convertCSV< CPP > (std::ostream &out, const CSV &csv)
 

Function Documentation

◆ convertHeader< CPP >()

template<>
void convertHeader< CPP > ( std::ostream &  out,
const Header header 
)

Definition at line 6 of file csv2cpp.cc.

6  {
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 }
std::string description
Definition: csv2code.hh:10
std::string base
Definition: csv2code.hh:9
std::string url
Definition: csv2code.hh:11

◆ convertCSV< CPP >()

template<>
void convertCSV< CPP > ( std::ostream &  out,
const CSV csv 
)

Definition at line 21 of file csv2cpp.cc.

21  {
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 }
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