#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
using namespace std;
const int ID_SIZE = 2;//对处理当前文本库中的ID的位数定义,test.txt中使用5个byte。
struct DATA{
vector<string> vctDataList;
};
struct MyData{
string strID;
DATA data;
};
bool fnIsHeadLine(string str)
{
if (str.substr(0,2)!="0x")
{
return false;
}
else
{
if (str.size()>=2+ID_SIZE*3)//0x29,94,01,83,39,至少这么长;
{
for (int i=1; i<=ID_SIZE; i++)
{
string strIdent = str.substr(2+i*3 - 1,1);
if (strIdent == ",")
{
continue;
}
else
{
return false;
#include <fstream>
#include <string>
#include <vector>
#include <map>
using namespace std;
const int ID_SIZE = 2;//对处理当前文本库中的ID的位数定义,test.txt中使用5个byte。
struct DATA{
vector<string> vctDataList;
};
struct MyData{
string strID;
DATA data;
};
bool fnIsHeadLine(string str)
{
if (str.substr(0,2)!="0x")
{
return false;
}
else
{
if (str.size()>=2+ID_SIZE*3)//0x29,94,01,83,39,至少这么长;
{
for (int i=1; i<=ID_SIZE; i++)
{
string strIdent = str.substr(2+i*3 - 1,1);
if (strIdent == ",")
{
continue;
}
else
{
return false;