textreader.cpp

来自「把html转成txt 把html转成txt」· C++ 代码 · 共 72 行

CPP
72
字号
#include <string>#include <algorithm>#include <vector>#include <iostream>#include "ReaderInterface.h"#include "TextReader.h"#include "WriterInterface.h"#include "UnicodeCharacter.h"#include "HtmlCharacterMap.h"namespace DoxEngine{  TextReader::TextReader(std::istream& newStream, WriterInterface& newWriter, DebugLog& newLog)	:stream(newStream), writer(newWriter), log(newLog)  {  }  bool TextReader::processData(void)  {    char character;	  stream.get(character);    if (!stream.good())      return false;    switch(character)    {      case '\r':        // Ignore      break;      case '\n':        writer.writeBreak(LineBreak);      break;      default:        writer.writeChar(UnicodeCharacter(character));      break;    }    return stream.good();  }  int TextReader::getPercentComplete(void)  {    return 0;  }  TextReader::~TextReader()  {  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?