mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
This commit is contained in:
parent
23e0d82436
commit
e400f4130a
1564 changed files with 510348 additions and 0 deletions
50
mailnews/mime/emitters/nsMimeRebuffer.cpp
Normal file
50
mailnews/mime/emitters/nsMimeRebuffer.cpp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/. */
|
||||
#include <string.h>
|
||||
#include "nsMimeRebuffer.h"
|
||||
#include "prmem.h"
|
||||
|
||||
MimeRebuffer::MimeRebuffer(void)
|
||||
{
|
||||
}
|
||||
|
||||
MimeRebuffer::~MimeRebuffer(void)
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t
|
||||
MimeRebuffer::GetSize()
|
||||
{
|
||||
return mBuf.Length();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
MimeRebuffer::IncreaseBuffer(const nsACString &addBuf)
|
||||
{
|
||||
mBuf.Append(addBuf);
|
||||
return mBuf.Length();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
MimeRebuffer::ReduceBuffer(uint32_t numBytes)
|
||||
{
|
||||
if (numBytes == 0)
|
||||
return mBuf.Length();
|
||||
|
||||
if (numBytes >= mBuf.Length())
|
||||
{
|
||||
mBuf.Truncate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
mBuf.Cut(0, numBytes);
|
||||
return mBuf.Length();
|
||||
}
|
||||
|
||||
nsACString &
|
||||
MimeRebuffer::GetBuffer()
|
||||
{
|
||||
return mBuf;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue