summaryrefslogtreecommitdiff
path: root/src/core/common/SourceContextReader.hpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-24 14:43:36 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-24 14:43:36 +0100
commitea2ff3388513949ddb5d3e3c2dca89bceb3d52bc (patch)
tree8b7c3d720801b3e3d45666ec21f3e87404e936e4 /src/core/common/SourceContextReader.hpp
parent7a2fffd5827d0b645f9fb1624d50ccc5b1d583c0 (diff)
parent6cb52deaad36f59738b6b4d203457a7f8d2d13e9 (diff)
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'src/core/common/SourceContextReader.hpp')
-rw-r--r--src/core/common/SourceContextReader.hpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/core/common/SourceContextReader.hpp b/src/core/common/SourceContextReader.hpp
index 35e71b3..cd29880 100644
--- a/src/core/common/SourceContextReader.hpp
+++ b/src/core/common/SourceContextReader.hpp
@@ -82,7 +82,25 @@ public:
* @return a SourceContext instance describing the
*/
SourceContext readContext(CharReader &reader, const SourceRange &range,
- size_t maxContextLength = MAX_MAX_CONTEXT_LENGTH,
+ size_t maxContextLength,
+ const std::string &filename = "");
+
+ /**
+ * Returns the context for the char reader and the given SourceRange.
+ * Returns an invalid source context if either the given range is invalid
+ * or the byte offset described in the SourceRange cannot be reached because
+ * the CharReader cannot be seeked back to this position. Does not limit
+ * the output context.
+ *
+ * @param reader is the CharReader instance from which the context should be
+ * read.
+ * @param range describes the Range within the source file for which the
+ * context should be extraced.
+ * @param filename is the filename that should be stored in the returned
+ * context.
+ * @return a SourceContext instance describing the
+ */
+ SourceContext readContext(CharReader &reader, const SourceRange &range,
const std::string &filename = "");
};
}