Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
csv2python.cc File Reference
#include "csv2python.hh"

Go to the source code of this file.

Functions

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

Function Documentation

◆ convertHeader< PYTHON >()

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

Definition at line 4 of file csv2python.cc.

4 {
5 out << "# -*- coding: utf-8 -*-\n";
6 out << "\"\"\"\n";
7
8 out << header.description << "\n";
9 out << header.url << "\n";
10 out << "\"\"\"\n";
11 out << "\n";
12 out << "# " << header.base << "\n";
13}
std::string description
Definition csv2code.hh:10
std::string base
Definition csv2code.hh:9
std::string url
Definition csv2code.hh:11

◆ convertCSV< PYTHON >()

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

Definition at line 16 of file csv2python.cc.

16 {
17 out << "data = dict(\n";
18 for (auto i = 0; i < csv.types.size(); i++) {
19 out << " " << csv.names[i] << "=" << csv.numbers[i] << ",\n";
20 }
21 out << ")\n";
22}
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