#pragma once
|
|
#include <vector>
|
#include <string>
|
|
class CakParser
|
{
|
public:
|
CakParser(void)
|
{
|
m_pSrcText = NULL;
|
};
|
virtual ~CakParser(void){};
|
|
void process(const char* pText, const char* pToken = " \r\n\t,^");
|
|
const char* getTokStr(int nIndex);
|
bool getTokStr(int nTokIndex, char* pBuf, int nLen);
|
|
int getTokNum(){return (int)m_vecTokPos.size();};
|
|
int getTokPos(int nIndex){return m_vecTokPos[nIndex];};
|
int getTokLen(int nIndex){return m_vecTokLen[nIndex];};
|
|
|
protected:
|
const char* m_pSrcText;
|
std::vector<int> m_vecTokPos;
|
std::vector<int> m_vecTokLen;
|
std::string m_strTokBuffer;
|
};
|
|
struct _akCellData
|
{
|
int nRow, nCol;
|
|
std::string m_strText;
|
|
|
};
|
|
struct _akCell_Row
|
{
|
std::vector<_akCellData> m_vecGridCellData;
|
};
|
|
class CakTextMatrix
|
{
|
public:
|
CakTextMatrix(void);
|
virtual ~CakTextMatrix(void);
|
|
|
public:
|
bool ImportFile(char* pFileName); //ÆÄÀÏ¿¡¼ Àд ¹æ½Ä ÅÂÇö[2018/4/18]
|
bool ImportText(char* pText); //¿©·¯ÁÙÀÇ µ¥ÀÌÅ͸¦ Çѹø¿¡ ¹Þ´Â ¹æ½Ä. ÅÂÇö[2018/4/18]
|
|
bool ExportFile(char* pFileName, char* pDevideFlag=",");
|
bool ExportFileInterval(char* pFileName, char* pIntervalRef);
|
|
void setDevideFlag(char* pFlag = " \r\n\t,^");
|
void setIntervalRef(char* pIntervalRef);
|
public:
|
bool AddRowData(char* pTextData);
|
bool printLine(int nRowIndex, char* pBuf, int nLen, char* pDevideFlag=",");
|
bool printLineInterval(int nRowIndex, char* pBuf, int nLen);
|
|
public:
|
void setRowCount(int nNum=10, bool bIncrease = false);
|
void setColCount(int nNum=10, bool bIncrease = false);
|
int getRowCount(){return m_nRowsNum;};
|
int getColCount(){return m_nColsNum;};
|
|
int getRowIndex(char* pTitle);
|
int getColIndex(char* pTitle);
|
|
public:
|
void setItemText(int nRow, int nCol, const char* pText);
|
const char* getItemText(int nRow, int nCol);
|
|
public:
|
virtual void printOut();//µ¥ÀÌÅÍ ³»¿ë Trace¿¡ Ãâ·Â
|
|
protected:
|
void makeCellItemArray(); //µ¥ÀÌÅÍ¿¡ ºü¸£°Ô Á¢±ÙÇϱâ À§ÇÑ Àüó¸® ÅÂÇö[2017/12/6]
|
|
|
protected:
|
std::string m_strDevideFlag;
|
std::vector<_akCell_Row> m_vecCellData_Row; //¼¿ÀÇ ½ÇÁ¦ Á¤º¸¸¦ °ü¸®
|
std::vector<_akCellData*> m_vecCellItem; //ºü¸£°Ô Á¢±ÙÇϱâ À§Çؼ NxNÇüÅÂÀÇ Cell ÀÚ·áÀÇ Æ÷ÀÎÆ®¸¸ °ü¸®
|
int m_nRowsNum, m_nColsNum;
|
|
int m_nIntervalLength;
|
std::vector<int> m_vecIntervalPos;
|
|
};
|