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.
AppFlow/FITK_Interface/FITKInterfaceIO/FITKAbstractTextReader.h

124 lines
3.2 KiB
C

/**
*
* @file FITKAbstractTextReader.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*
*/
#ifndef _FITKABSTRACTTEXTREADER_H__
#define _FITKABSTRACTTEXTREADER_H__
#include "FITKAbstractIO.h"
#include <QStringList>
namespace Interface
{
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
class FITKInterfaceIOAPI FITKAbstractTextReader :public FITKAbstractIO
{
public:
explicit FITKAbstractTextReader() = default;
virtual ~FITKAbstractTextReader() = default;
/**
* @brief
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
bool loadFile();
/**
* @brief
* @return QString
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
virtual QString readLine();
/**
* @brief
* param p -1 0-100
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
void sendCurrentPercent(int p = -1);
/**
* @brief 退
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
virtual void backLine();
/**
* @brief
* @return QString
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
virtual QString nextLine();
/**
* @brief
* @return QString
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
virtual QString previousLine();
/**
* @brief
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
bool atEnd();
/**
* @brief 1
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
int getCurrentLineNum();
/**
* @brief
* @return QString
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
QString getCurrentLine();
protected:
/**
* @brief index
* @param[i] index
* @return QString
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
QString getLine(int index);
private:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
int _currentLine{ 0 };
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
int _totalLine{ -1 };
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-29
*/
QByteArrayList _totalContext{};
};
}
#endif