2012-05-29 15:52:43 +00: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-28 22:44:22 +00:00
|
|
|
|
2014-01-04 15:02:17 +00:00
|
|
|
nsHtml5UTF16Buffer::nsHtml5UTF16Buffer(char16_t* aBuffer, int32_t aEnd)
|
2011-09-28 12:45:17 +00:00
|
|
|
: buffer(aBuffer)
|
|
|
|
, start(0)
|
|
|
|
, end(aEnd)
|
2009-06-28 22:44:22 +00:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsHtml5UTF16Buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsHtml5UTF16Buffer::~nsHtml5UTF16Buffer()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsHtml5UTF16Buffer);
|
|
|
|
}
|
2009-10-12 13:08:04 +00:00
|
|
|
|
2011-09-28 12:45:17 +00:00
|
|
|
void
|
|
|
|
nsHtml5UTF16Buffer::DeleteBuffer()
|
2009-10-12 13:08:04 +00:00
|
|
|
{
|
2011-09-28 12:45:17 +00:00
|
|
|
delete[] buffer;
|
2009-10-12 13:08:04 +00:00
|
|
|
}
|
2011-10-29 20:14:31 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5UTF16Buffer::Swap(nsHtml5UTF16Buffer* aOther)
|
|
|
|
{
|
2014-01-04 15:02:17 +00:00
|
|
|
char16_t* tempBuffer = buffer;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t tempStart = start;
|
|
|
|
int32_t tempEnd = end;
|
2011-10-29 20:14:31 +00:00
|
|
|
buffer = aOther->buffer;
|
|
|
|
start = aOther->start;
|
|
|
|
end = aOther->end;
|
|
|
|
aOther->buffer = tempBuffer;
|
|
|
|
aOther->start = tempStart;
|
|
|
|
aOther->end = tempEnd;
|
|
|
|
}
|