aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CellBuffer.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-21 08:43:03 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-21 08:43:03 +1000
commit8634c0958c532e7d219e649353e1f1a74d52da1b (patch)
tree91352944c8b5c727a385426431d2e62f3301f6ad /src/CellBuffer.cxx
parentf00008fa5a49722171c5b288f988a64443122115 (diff)
downloadscintilla-mirror-8634c0958c532e7d219e649353e1f1a74d52da1b.tar.gz
Tighten definition of regular expression iterators so they are noexcept and
define all the standard member functions. This cascades to all methods called by the iterators, affecting Document, CellBuffer, Partitioning, SplitVector and UTF-8 and DBCS functions. Other trivial functions declared noexcept.
Diffstat (limited to 'src/CellBuffer.cxx')
-rw-r--r--src/CellBuffer.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 177aa60e8..58ab3b3f4 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -35,9 +35,9 @@ public:
virtual void InsertLine(Sci::Line line, Sci::Position position, bool lineStart) = 0;
virtual void SetLineStart(Sci::Line line, Sci::Position position) = 0;
virtual void RemoveLine(Sci::Line line) = 0;
- virtual Sci::Line Lines() const = 0;
- virtual Sci::Line LineFromPosition(Sci::Position pos) const = 0;
- virtual Sci::Position LineStart(Sci::Line line) const = 0;
+ virtual Sci::Line Lines() const noexcept = 0;
+ virtual Sci::Line LineFromPosition(Sci::Position pos) const noexcept = 0;
+ virtual Sci::Position LineStart(Sci::Line line) const noexcept = 0;
virtual ~ILineVector() {}
};
@@ -84,13 +84,13 @@ public:
perLine->RemoveLine(line);
}
}
- Sci::Line Lines() const override {
+ Sci::Line Lines() const noexcept override {
return static_cast<Sci::Line>(starts.Partitions());
}
- Sci::Line LineFromPosition(Sci::Position pos) const override {
+ Sci::Line LineFromPosition(Sci::Position pos) const noexcept override {
return static_cast<Sci::Line>(starts.PartitionFromPosition(static_cast<POS>(pos)));
}
- Sci::Position LineStart(Sci::Line line) const override {
+ Sci::Position LineStart(Sci::Line line) const noexcept override {
return starts.PositionFromPartition(static_cast<POS>(line));
}
};
@@ -377,11 +377,11 @@ CellBuffer::CellBuffer(bool hasStyles_, bool largeDocument_) :
CellBuffer::~CellBuffer() {
}
-char CellBuffer::CharAt(Sci::Position position) const {
+char CellBuffer::CharAt(Sci::Position position) const noexcept {
return substance.ValueAt(position);
}
-unsigned char CellBuffer::UCharAt(Sci::Position position) const {
+unsigned char CellBuffer::UCharAt(Sci::Position position) const noexcept {
return static_cast<unsigned char>(substance.ValueAt(position));
}
@@ -398,7 +398,7 @@ void CellBuffer::GetCharRange(char *buffer, Sci::Position position, Sci::Positio
substance.GetRange(buffer, position, lengthRetrieve);
}
-char CellBuffer::StyleAt(Sci::Position position) const {
+char CellBuffer::StyleAt(Sci::Position position) const noexcept {
return hasStyles ? style.ValueAt(position) : 0;
}
@@ -496,7 +496,7 @@ const char *CellBuffer::DeleteChars(Sci::Position position, Sci::Position delete
return data;
}
-Sci::Position CellBuffer::Length() const {
+Sci::Position CellBuffer::Length() const noexcept {
return substance.Length();
}
@@ -537,11 +537,11 @@ void CellBuffer::SetPerLine(PerLine *pl) {
plv->SetPerLine(pl);
}
-Sci::Line CellBuffer::Lines() const {
+Sci::Line CellBuffer::Lines() const noexcept {
return plv->Lines();
}
-Sci::Position CellBuffer::LineStart(Sci::Line line) const {
+Sci::Position CellBuffer::LineStart(Sci::Line line) const noexcept {
if (line < 0)
return 0;
else if (line >= Lines())
@@ -550,7 +550,7 @@ Sci::Position CellBuffer::LineStart(Sci::Line line) const {
return plv->LineStart(line);
}
-Sci::Line CellBuffer::LineFromPosition(Sci::Position pos) const {
+Sci::Line CellBuffer::LineFromPosition(Sci::Position pos) const noexcept {
return plv->LineFromPosition(pos);
}