detect file encoding when loading it

This commit is contained in:
josh committed 2016-08-11 20:11:13 -04:00
1 parent c4253078a9
commit 490505faa1
4 files changed
+10

No files matched your search

+3
View File
@@ -6,6 +6,7 @@
#include <memory>
#include "Span.h"
#include "LineEndings.h"
#include "Encoding.h"
class TextLoader
{
@@ -24,12 +25,14 @@ public:
}
}
LineEndings::Type get_line_endings() { return m_line_endings; }
Encoding::Type get_encoding() { return m_encoding; }
auto begin() { return m_lines->begin(); }
auto end() { return m_lines->end(); }
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;
std::shared_ptr<std::list<Span>> m_lines;
};