summaryrefslogtreecommitdiffstats
path: root/scintilla/src/SplitVector.h
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-11-16 12:40:48 +0000
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-11-16 12:40:48 +0000
commitba808322ec6be891930225b30b2705f697ac85cf (patch)
tree233edc74a4d288f4541fb27fa775fb67154e78a6 /scintilla/src/SplitVector.h
parent003bf1ed14a32a70f10efa9910f232160cc8e504 (diff)
downloadnotepad2-mod-ba808322ec6be891930225b30b2705f697ac85cf.zip
notepad2-mod-ba808322ec6be891930225b30b2705f697ac85cf.tar.gz
notepad2-mod-ba808322ec6be891930225b30b2705f697ac85cf.tar.bz2
update scintilla to v2.22
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@196 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/src/SplitVector.h')
-rw-r--r--scintilla/src/SplitVector.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/scintilla/src/SplitVector.h b/scintilla/src/SplitVector.h
index 306d03e..004e814 100644
--- a/scintilla/src/SplitVector.h
+++ b/scintilla/src/SplitVector.h
@@ -238,6 +238,23 @@ public:
DeleteRange(0, lengthBody);
}
+ // Retrieve a range of elemetns into an array
+ void GetRange(T *buffer, int position, int retrieveLength) const {
+ // Split into up to 2 ranges, before and after the split then use memcpy on each.
+ int range1Length = 0;
+ if (position < part1Length) {
+ int part1AfterPosition = part1Length - position;
+ range1Length = retrieveLength;
+ if (range1Length > part1AfterPosition)
+ range1Length = part1AfterPosition;
+ }
+ memcpy(buffer, body + position, range1Length * sizeof(T));
+ buffer += range1Length;
+ position = position + range1Length + gapLength;
+ int range2Length = retrieveLength - range1Length;
+ memcpy(buffer, body + position, range2Length * sizeof(T));
+ }
+
T *BufferPointer() {
RoomFor(1);
GapTo(lengthBody);