2012-05-29 19:52:43 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-06-29 02:44:22 +04:00
|
|
|
|
2014-01-04 19:02:17 +04:00
|
|
|
nsHtml5UTF16Buffer::nsHtml5UTF16Buffer(char16_t* aBuffer, int32_t aEnd)
|
2011-09-28 16:45:17 +04:00
|
|
|
: buffer(aBuffer)
|
|
|
|
, start(0)
|
|
|
|
, end(aEnd)
|
2009-06-29 02:44:22 +04:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsHtml5UTF16Buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsHtml5UTF16Buffer::~nsHtml5UTF16Buffer()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsHtml5UTF16Buffer);
|
|
|
|
}
|
2009-10-12 17:08:04 +04:00
|
|
|
|
2011-09-28 16:45:17 +04:00
|
|
|
void
|
|
|
|
nsHtml5UTF16Buffer::DeleteBuffer()
|
2009-10-12 17:08:04 +04:00
|
|
|
{
|
2011-09-28 16:45:17 +04:00
|
|
|
delete[] buffer;
|
2009-10-12 17:08:04 +04:00
|
|
|
}
|
2011-10-30 00:14:31 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5UTF16Buffer::Swap(nsHtml5UTF16Buffer* aOther)
|
|
|
|
{
|
2014-01-04 19:02:17 +04:00
|
|
|
char16_t* tempBuffer = buffer;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t tempStart = start;
|
|
|
|
int32_t tempEnd = end;
|
2011-10-30 00:14:31 +04:00
|
|
|
buffer = aOther->buffer;
|
|
|
|
start = aOther->start;
|
|
|
|
end = aOther->end;
|
|
|
|
aOther->buffer = tempBuffer;
|
|
|
|
aOther->start = tempStart;
|
|
|
|
aOther->end = tempEnd;
|
|
|
|
}
|