add LineEndings module
This commit is contained in:
1 parent
cdae9e51ae
commit
382d155e40
7 files changed
+58
-51
No files matched your search
+3
-10
@@ -5,18 +5,11 @@
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include "Span.h"
|
||||
#include "LineEndings.h"
|
||||
|
||||
class TextLoader
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
LINE_ENDING_LF,
|
||||
LINE_ENDING_CR,
|
||||
LINE_ENDING_CRLF,
|
||||
LINE_ENDING_COUNT
|
||||
};
|
||||
|
||||
TextLoader();
|
||||
void load_buffer(uint8_t * buffer, size_t size);
|
||||
size_t num_lines()
|
||||
@@ -30,13 +23,13 @@ public:
|
||||
return m_lines->size();
|
||||
}
|
||||
}
|
||||
int get_line_endings() { return m_line_endings; }
|
||||
LineEndings::Type get_line_endings() { return m_line_endings; }
|
||||
auto begin() { return m_lines->begin(); }
|
||||
auto end() { return m_lines->end(); }
|
||||
bool get_eol_at_eof() { return m_eol_at_eof; }
|
||||
|
||||
protected:
|
||||
int m_line_endings;
|
||||
LineEndings::Type m_line_endings;
|
||||
bool m_eol_at_eof;
|
||||
std::shared_ptr<std::list<Span>> m_lines;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user