Changeset View
Changeset View
Standalone View
Standalone View
src/buffer/katetextblock.h
Show All 15 Lines | |||||
16 | * along with this library; see the file COPYING.LIB. If not, write to | 16 | * along with this library; see the file COPYING.LIB. If not, write to | ||
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef KATE_TEXTBLOCK_H | 21 | #ifndef KATE_TEXTBLOCK_H | ||
22 | #define KATE_TEXTBLOCK_H | 22 | #define KATE_TEXTBLOCK_H | ||
23 | 23 | | |||
24 | #include <unordered_set> | ||||
25 | | ||||
24 | #include <QVector> | 26 | #include <QVector> | ||
25 | #include <QSet> | 27 | #include <QSet> | ||
26 | 28 | | |||
27 | #include <ktexteditor_export.h> | 29 | #include <ktexteditor_export.h> | ||
28 | #include <ktexteditor/cursor.h> | 30 | #include <ktexteditor/cursor.h> | ||
29 | #include "katetextline.h" | 31 | #include "katetextline.h" | ||
30 | 32 | | |||
31 | namespace Kate | 33 | namespace Kate | ||
▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Line(s) | 47 | public: | |||
201 | } | 203 | } | ||
202 | 204 | | |||
203 | /** | 205 | /** | ||
204 | * Remove cursor from this block. | 206 | * Remove cursor from this block. | ||
205 | * @param cursor cursor to remove | 207 | * @param cursor cursor to remove | ||
206 | */ | 208 | */ | ||
207 | void removeCursor(Kate::TextCursor *cursor) | 209 | void removeCursor(Kate::TextCursor *cursor) | ||
208 | { | 210 | { | ||
209 | m_cursors.remove(cursor); | 211 | m_cursors.erase(cursor); | ||
210 | } | 212 | } | ||
211 | 213 | | |||
212 | /** | 214 | /** | ||
213 | * Update a range from this block. | 215 | * Update a range from this block. | ||
214 | * Will move the range to right set, either cached for one-line ranges or not. | 216 | * Will move the range to right set, either cached for one-line ranges or not. | ||
215 | * @param range range to update | 217 | * @param range range to update | ||
216 | */ | 218 | */ | ||
217 | void updateRange(TextRange *range); | 219 | void updateRange(TextRange *range); | ||
Show All 23 Lines | |||||
241 | private: | 243 | private: | ||
242 | /** | 244 | /** | ||
243 | * parent text buffer | 245 | * parent text buffer | ||
244 | */ | 246 | */ | ||
245 | TextBuffer *m_buffer; | 247 | TextBuffer *m_buffer; | ||
246 | 248 | | |||
247 | /** | 249 | /** | ||
248 | * Lines contained in this buffer. These are shared pointers. | 250 | * Lines contained in this buffer. These are shared pointers. | ||
251 | * We need no sharing, use STL. | ||||
249 | */ | 252 | */ | ||
250 | QVector<Kate::TextLine> m_lines; | 253 | std::vector<Kate::TextLine> m_lines; | ||
251 | 254 | | |||
252 | /** | 255 | /** | ||
253 | * Startline of this block | 256 | * Startline of this block | ||
254 | */ | 257 | */ | ||
255 | int m_startLine; | 258 | int m_startLine; | ||
256 | 259 | | |||
257 | /** | 260 | /** | ||
258 | * Set of cursors for this block. | 261 | * Set of cursors for this block. | ||
262 | * We need no sharing, use STL. | ||||
259 | */ | 263 | */ | ||
260 | QSet<TextCursor *> m_cursors; | 264 | std::unordered_set<TextCursor *> m_cursors; | ||
261 | 265 | | |||
262 | /** | 266 | /** | ||
263 | * Contains for each line-offset the ranges that were cached into it. | 267 | * Contains for each line-offset the ranges that were cached into it. | ||
264 | * These ranges are fully contained by the line. | 268 | * These ranges are fully contained by the line. | ||
265 | */ | 269 | */ | ||
266 | QVector<QSet<TextRange *> > m_cachedRangesForLine; | 270 | QVector<QSet<TextRange *> > m_cachedRangesForLine; | ||
267 | 271 | | |||
268 | /** | 272 | /** | ||
Show All 13 Lines |