QtNovelUI/DesParser/WordsPeak.h

40 lines
660 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <QString>
#include <QTextStream>
#include <QFile>
#include <tuple>
namespace Lex {
class ExStream
{
public:
typedef int n_row;
typedef int n_col;
explicit ExStream();
virtual ~ExStream();
/**
* 初始化文件指向.
*
* \param path 源文件
* \return -2无法打开-1文件不存在0成功
*/
int initSource(const QString &path);
/**
* 在文件文本流中读取一个字符.
*
* \return
*/
std::tuple<n_row, n_col, QChar> read();
private:
QFile * file_target;
QTextStream* text_input;
QString current_line;
int current_row, current_col;
};
}