aboutsummaryrefslogtreecommitdiffstats
path: root/liblangutil/CharStream.h
diff options
context:
space:
mode:
Diffstat (limited to 'liblangutil/CharStream.h')
-rw-r--r--liblangutil/CharStream.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/liblangutil/CharStream.h b/liblangutil/CharStream.h
index 72aacacf..f92beb30 100644
--- a/liblangutil/CharStream.h
+++ b/liblangutil/CharStream.h
@@ -68,7 +68,8 @@ class CharStream
{
public:
CharStream(): m_position(0) {}
- explicit CharStream(std::string const& _source): m_source(_source), m_position(0) {}
+ explicit CharStream(std::string const& _source, std::string const& name):
+ m_source(_source), m_name(name), m_position(0) {}
int position() const { return m_position; }
bool isPastEndOfInput(size_t _charsForward = 0) const { return (m_position + _charsForward) >= m_source.size(); }
@@ -79,7 +80,8 @@ public:
void reset() { m_position = 0; }
- std::string const& source() const { return m_source; }
+ std::string const& source() const noexcept { return m_source; }
+ std::string const& name() const noexcept { return m_name; }
///@{
///@name Error printing helper functions
@@ -91,6 +93,7 @@ public:
private:
std::string m_source;
+ std::string m_name;
size_t m_position;
};