16 #include <sys/types.h> 59 while ((i = m_pFile->getch()) !=
EOF)
62 if (c ==
'{' && pc !=
'\\')
66 else if (c ==
'}' && pc !=
'\\')
71 m_jsonString.append(1, c);
78 m_jsonString.append(1, c);
83 return (m_jsonString.size() != 0);
91 bool needsComma =
true;
97 if (!OpenNewSaveFile())
105 memcpy(&m_devInfo, dataBuf,
sizeof(
dev_info_t));
109 int nBytes = m_json.WriteDataToFile(m_pFile, *dataHdr, dataBuf, (needsComma ?
",\n" :
NULLPTR));
110 if (!m_pFile->good())
118 if (m_logSize >= m_maxFileSize)
134 if (!OpenNextReadFile())
152 while (!GetNextItemForFile() && OpenNextReadFile()) {}
153 if (m_json.StringJSONToData(m_jsonString, m_dataBuffer.hdr, m_dataBuffer.buf,
_ARRAY_BYTE_COUNT(m_dataBuffer.buf)))
157 memcpy(&m_devInfo, m_dataBuffer.buf,
sizeof(
dev_info_t));
159 return &m_dataBuffer;
167 m_devInfo.serialNumber = serialNumber;
void OnReadData(p_data_t *data)
virtual bool CloseAllFiles()
bool CloseAllFiles() OVERRIDE
virtual bool SaveData(p_data_hdr_t *dataHdr, const uint8_t *dataBuf)
void CloseISLogFile(cISLogFileBase *&logFile)
bool SaveData(p_data_hdr_t *dataHdr, const uint8_t *dataBuf) OVERRIDE
p_data_t * ReadData() OVERRIDE
bool GetNextItemForFile()
#define _ARRAY_BYTE_COUNT(a)
USBInterfaceDescriptor data
p_data_t * ReadDataFromFile()
void SetSerialNumber(uint32_t serialNumber) OVERRIDE