22inline int tokenize_string_if_double(
const std::string line, std::vector<std::string>& result)
39 std::ifstream infile(column_file);
40 Nom liste_temps(
""), liste_vals(
"");
45 for (
int l = 1; std::getline(infile, line); l++)
46 if (!(line.rfind(
"#", 0) == 0))
49 std::vector<std::string> result;
50 if (!tokenize_string_if_double(line, result))
52 Cerr <<
"The file " << column_file <<
" contains non double values at line " << l <<
" !" << finl;
55 const int nb_col_lues = (int)result.size();
56 if (nb_col_lues != (nb_comp + 1))
58 Cerr <<
"The file " << column_file <<
" should contain " << nb_comp + 1 <<
" columns but " << nb_col_lues <<
" have been detected on line " << l << finl;
61 liste_temps +=
Nom(
" ") + result[0];
62 for (
int n = 0; n < nb_comp; n++)
63 liste_vals +=
Nom(
" ") + result[1 + n];
67 Nom chaine_tabulee(
" { ");
68 chaine_tabulee +=
Nom(nb_val) + liste_temps + liste_vals +
Nom(
" }");
69 Cerr <<
"Creation from " << column_file <<
" of the field" << finl;
70 Cerr <<
"Champ_front_Tabule " << chaine_tabulee << finl;
72 return chaine_tabulee;