#ifndef FRAMEFILEIO_H #define FRAMEFILEIO_H //Class full of static methods that load and save canbus frames to/from various file formats #include "config.h" #include #include #include #include #include #include #include #include #include "can_structs.h" #include "utility.h" class FrameFileIO: public QObject { Q_OBJECT public: FrameFileIO(); //these present a GUI to the user and allow them to pick the file to load/save //The QString returns the filename that was selected and so is really a sort of return value //The QVector is used as either the target for loading or the source for saving. //These routines call the below loading/saving functions so no need to use them directly if you don't want. static bool loadFrameFile(QString &, QVector*); static bool saveFrameFile(QString &, const QVector*); //These do the actual loading and saving and can be used directly if you'd prefer static bool autoDetectLoadFile(QString, QVector*); static bool loadCRTDFile(QString, QVector*); static bool loadNativeCSVFile(QString, QVector*); static bool loadGenericCSVFile(QString, QVector*); static bool loadLogFile(QString, QVector*); static bool loadMicrochipFile(QString, QVector*); static bool loadTraceFile(QString, QVector*); static bool loadIXXATFile(QString, QVector*); static bool loadCANDOFile(QString, QVector*); static bool loadVehicleSpyFile(QString, QVector*); static bool loadCanDumpFile(QString, QVector*); static bool loadLawicelFile(QString, QVector*); static bool loadPCANFile(QString, QVector*); static bool loadKvaserFile(QString, QVector*, bool); static bool loadCanalyzerASC(QString, QVector*); static bool loadCanalyzerBLF(QString, QVector*); static bool loadCARBUSAnalyzerFile(QString filename, QVector* frames); static bool loadCANHackerFile(QString filename, QVector* frames); static bool loadCabanaFile(QString filename, QVector* frames); static bool loadCANOpenFile(QString filename, QVector* frames); static bool loadTeslaAPFile(QString filename, QVector* frames); static bool loadCLX000File(QString filename, QVector* frames); static bool loadCANServerFile(QString filename, QVector* frames); static bool loadWiresharkFile(QString filename, QVector* frames); static bool loadWiresharkSocketCANFile(QString filename, QVector* frames); //functions that pre-scan a file to try to figure out if they could read it. Used to automatically determine //file type and load it. static bool isCRTDFile(QString); static bool isNativeCSVFile(QString); static bool isGenericCSVFile(QString); static bool isLogFile(QString); static bool isMicrochipFile(QString); static bool isTraceFile(QString); static bool isIXXATFile(QString); static bool isCANDOFile(QString); static bool isVehicleSpyFile(QString); static bool isCanDumpFile(QString); static bool isLawicelFile(QString); static bool isPCANFile(QString); static bool isKvaserFile(QString); static bool isCanalyzerASC(QString); static bool isCanalyzerBLF(QString); static bool isCARBUSAnalyzerFile(QString filename); static bool isCANHackerFile(QString filename); static bool isCabanaFile(QString filename); static bool isCANOpenFile(QString filename); static bool isTeslaAPFile(QString filename); static bool isCLX000File(QString filename); static bool isCANServerFile(QString filename); static bool isWiresharkFile(QString filename); static bool isWiresharkSocketCANFile(QString filename); static bool saveCRTDFile(QString, const QVector*); static bool saveNativeCSVFile(QString, const QVector*); static bool saveGenericCSVFile(QString, const QVector*); static bool saveLogFile(QString, const QVector*); static bool saveMicrochipFile(QString, const QVector*); static bool saveTraceFile(QString, const QVector*); static bool saveIXXATFile(QString, const QVector*); static bool saveCANDOFile(QString, const QVector*); static bool saveVehicleSpyFile(QString, const QVector*); static bool saveCanDumpFile(QString filename, const QVector * frames); static bool saveCabanaFile(QString filename, const QVector* frames); static bool saveCanalyzerASC(QString filename, const QVector* frames); static bool saveCARBUSAnalzyer(QString filename, const QVector* frames); static bool openContinuousNative(); static bool closeContinuousNative(); static bool writeContinuousNative(const QVector*, int); static bool flushContinuousNative(); private: static QFile continuousFile; }; #endif // FRAMEFILEIO_H