aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/SplitVector.h
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-05-26 15:15:07 +1000
committernyamatongwe <unknown>2012-05-26 15:15:07 +1000
commit00c771cecda620db28cec9e4c50830f542e3a829 (patch)
treeb14ac398aa30f650cf9c38fd43407d13e32384e8 /src/SplitVector.h
parent0af9eecdbfe8e8260ef67316e7208e1385715c73 (diff)
downloadscintilla-mirror-00c771cecda620db28cec9e4c50830f542e3a829.tar.gz
Add GetRangePointer and GetGapPosition methods.
Diffstat (limited to 'src/SplitVector.h')
-rw-r--r--src/SplitVector.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/SplitVector.h b/src/SplitVector.h
index 44d5ddc0e..0ccf6c9f4 100644
--- a/src/SplitVector.h
+++ b/src/SplitVector.h
@@ -261,6 +261,24 @@ public:
body[lengthBody] = 0;
return body;
}
+
+ T *RangePointer(int position, int rangeLength) {
+ if (position < part1Length) {
+ if ((position + rangeLength) > part1Length) {
+ // Range overlaps gap, so move gap to start of range.
+ GapTo(position);
+ return body + position + gapLength;
+ } else {
+ return body + position ;
+ }
+ } else {
+ return body + position + gapLength;
+ }
+ }
+
+ int GapPosition() const {
+ return part1Length;
+ }
};
#endif