I want to save some data as a text file, the first txt file will contain header information, the other text file will save data streamed from sensors, so with the help from the internet I created the following "datalogger.cpp" file
Qt Code:
#include "datalogger.h" #include <QDebug> #include <iostream> #include <QFile> { } DataLogger::~DataLogger(){ } void DataLogger::save(DataStream &input){ saveAsText(input); } void DataLogger::saveAsText(DataStream &input){ outHeader << "[CAPTURE SETTINGS]\n" << "Filename: " << SettingsSingleton::instance().getFileName() << ".txt \n" << "Source: " << SettingsSingleton::instance().getSource() << "\n" outFileHeader.close(); } for (int i ; i<input.size();i++){ const EcgStreamObject tmp=input.at(i); out << tmp.toText() << endl; //"\n"; } outFile.close(); } }To copy to clipboard, switch view to plain text mode
I have my "DataStream" input variable that I want to pass to the method and save as a ".txt" file, however I do no know how to call the method "void DataLogger::save(DataStream &input)" from a different ".cpp" file where the DataStream variable is located.
I am extremely new to c++ please it as simple as possible please.
Thank you in advance
Bookmarks