/src/mozilla-central/parser/html/nsHtml5UTF16BufferCppSupplement.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | | |
5 | | nsHtml5UTF16Buffer::nsHtml5UTF16Buffer(char16_t* aBuffer, int32_t aEnd) |
6 | | : buffer(aBuffer) |
7 | | , start(0) |
8 | | , end(aEnd) |
9 | 0 | { |
10 | 0 | MOZ_COUNT_CTOR(nsHtml5UTF16Buffer); |
11 | 0 | } |
12 | | |
13 | | nsHtml5UTF16Buffer::~nsHtml5UTF16Buffer() |
14 | 0 | { |
15 | 0 | MOZ_COUNT_DTOR(nsHtml5UTF16Buffer); |
16 | 0 | } |
17 | | |
18 | | void |
19 | | nsHtml5UTF16Buffer::DeleteBuffer() |
20 | 0 | { |
21 | 0 | delete[] buffer; |
22 | 0 | } |
23 | | |
24 | | void |
25 | | nsHtml5UTF16Buffer::Swap(nsHtml5UTF16Buffer* aOther) |
26 | 0 | { |
27 | 0 | char16_t* tempBuffer = buffer; |
28 | 0 | int32_t tempStart = start; |
29 | 0 | int32_t tempEnd = end; |
30 | 0 | buffer = aOther->buffer; |
31 | 0 | start = aOther->start; |
32 | 0 | end = aOther->end; |
33 | 0 | aOther->buffer = tempBuffer; |
34 | 0 | aOther->start = tempStart; |
35 | 0 | aOther->end = tempEnd; |
36 | 0 | } |