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