Хочу получить файл:
fileConfiguration.cfg
Station name,1,2001
14,6A,8D
1,ток ф А,,,A,1.290489E-01,0,0,-32767,32767,3000.00000000,1.00000000,P
2,ток В,,,A,5.139708E-02,0,0,-32767,32767,3000.00000000,1.00000000,P
Помогите довести это до ума.
1. Как описать реализацию void writesecondline (std::ostream &file, InfAnalogChanel const &iac);
function.h
class Station // 1-я строка
{
public:
std::string station_name;
std::string rec_dew;
std::string year;
};
void writefirstline(std::string station_name,std::string rec_dew,std::string year); //функция записи 1-й строки
class InfaboutChanell // 2-я строка
{
public:
int chanellcount;
int analogChanell;
int discretChanell;
};
void writecountCh(int chanellcount,int analogChanell, int discretChanell); //функция записи 2-й строки
class InfAnalogChane l// 3-я строка
{
public:
int id;
std::string chanell_id;
std::string ph;
std::string ccmb;
std::string UU;
double a;
double b;
double skew;
double min;
double max;
double Primery;
double Secondary;
std::string SP;
};
void writesecondline (std::ostream &file, InfAnalogChanel const &iac); //функция записи 3-й строки
function1.cpp
void writefirstline(std::string station_name,std::string rec_dew,std::string year){
ofstream file("fileConfiguration.cfg");
file<<station_name<<","<<rec_dew<<","<<year<<"\n";
}
void writecountCh(int chanellcount,int analogChanell, int discretChanell){
ofstream file("fileConfiguration.cfg");
file<<chanellcount<<","<<analogChanell<<"A"<<","<<discretChanell<<"D"<<"\n";
}
void writesecondline(std::ostream &file, InfAnalogChanel const &iac){
ofstream efile("fileConfiguration.cfg");
}
main.cpp
writefirstline("Station name","1","2001");
writecountCh(14, 6, 8);
InfAnalogChanel a = {1,"ток ф А",,,"A",1.290489E-01,0,0,-32767,32767,3000.00000000,1.00000000,"P"};
InfAnalogChanel b = {2,"ток В",,,"A",5.139708E-02,0,0,-32767,32767,3000.00000000,1.00000000,"P"};
ofstream efile("fileConfiguration.cfg");
writesecondline(efile, a);
writesecondline(efile, b);