31 lines
640 B
C++
31 lines
640 B
C++
#ifndef TEXTLOADER_H
|
|
#define TEXTLOADER_H
|
|
|
|
#include <stdint.h>
|
|
#include <list>
|
|
#include <memory>
|
|
#include "LineEndings.h"
|
|
#include "Encoding.h"
|
|
|
|
class TextLoader
|
|
{
|
|
public:
|
|
TextLoader();
|
|
void load_buffer(uint8_t * buffer, size_t size, size_t * out_size);
|
|
size_t num_lines()
|
|
{
|
|
return m_num_lines;
|
|
}
|
|
LineEndings::Type get_line_endings() { return m_line_endings; }
|
|
Encoding::Type get_encoding() { return m_encoding; }
|
|
bool get_eol_at_eof() { return m_eol_at_eof; }
|
|
|
|
protected:
|
|
LineEndings::Type m_line_endings;
|
|
Encoding::Type m_encoding;
|
|
bool m_eol_at_eof;
|
|
size_t m_num_lines;
|
|
};
|
|
|
|
#endif
|