You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
|
#include "iFileEngine.h"
|
|
|
|
|
|
#include "iFileEngine_global.h"
|
|
|
|
|
|
|
|
|
|
|
|
// 专用解析,tryParse
|
|
|
|
|
|
class I_FILE_ENGINE_EXPORT iTryParseHelper
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
iTryParseHelper();
|
|
|
|
|
|
~iTryParseHelper();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
iFileEngineUtils::fprParseResult getRsts();
|
|
|
|
|
|
QString getLastError();
|
|
|
|
|
|
|
|
|
|
|
|
// 尝试对名称和单位的模糊解析
|
|
|
|
|
|
virtual bool tryParse(const VVecVariant& vvec);
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
// 利用倒回两行,try查找标题单位
|
|
|
|
|
|
//
|
|
|
|
|
|
virtual bool tryParseTitleUnit(const VecVariant& vec);
|
|
|
|
|
|
virtual bool tryParseTitle(const VecVariant& vec);
|
|
|
|
|
|
|
|
|
|
|
|
// 判断改行是否全是数字
|
|
|
|
|
|
bool isDigitLine(const VecVariant& vec);
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
iFileEngineUtils::fprParseResult m_oRst;
|
|
|
|
|
|
|
|
|
|
|
|
int m_nDataRowCountPreviewed;//头包含多少行数据,默认为2,外界可传入
|
|
|
|
|
|
int m_nDataLineTryMax; //在try时数据多少条即可认为是数据,默认为3
|
|
|
|
|
|
|
|
|
|
|
|
QString m_sError; //存错误信息
|
|
|
|
|
|
|
|
|
|
|
|
};
|