#include <nsScannerString.h>
The buffer list itself is reference counted. This allows the buffer list to be shared by multiple nsScannerSubstring objects. The reference counting is not threadsafe, which is not at all a requirement.
When a nsScannerSubstring releases its reference to a buffer list, it decrements the usage count of the first buffer in the buffer list that it was referencing. It informs the buffer list that it can discard buffers starting at that prefix. The buffer list will do so if the usage count of that buffer is 0 and if it is the first buffer in the list. It will continue to prune buffers starting from the front of the buffer list until it finds a buffer that has a usage count that is non-zero.
Public Member Functions | |
| nsScannerBufferList (Buffer *buf) | |
| void | AddRef () |
| void | Release () |
| void | Append (Buffer *buf) |
| void | InsertAfter (Buffer *buf, Buffer *prev) |
| void | SplitBuffer (const Position &) |
| void | DiscardUnreferencedPrefix (Buffer *) |
| Buffer * | Head () |
| const Buffer * | Head () const |
| Buffer * | Tail () |
| const Buffer * | Tail () const |
Static Public Member Functions | |
| static Buffer * | AllocBufferFromString (const nsAString &) |
| nsScannerBufferList | |
| static Buffer * | AllocBuffer (PRUint32 capacity) |
Friends | |
| class | nsScannerSubstring |
Classes | |
| class | Buffer |
| Buffer objects are directly followed by a data segment. More... | |
| class | Position |
| Position objects serve as lightweight pointers into a buffer list. More... | |
| nsScannerBufferList::nsScannerBufferList | ( | Buffer * | buf | ) | [inline] |
| nsScannerBufferList::Buffer * nsScannerBufferList::AllocBufferFromString | ( | const nsAString & | aString | ) | [static] |
| nsScannerBufferList::Buffer * nsScannerBufferList::AllocBuffer | ( | PRUint32 | capacity | ) | [static] |
| void nsScannerBufferList::AddRef | ( | void | ) | [inline] |
| void nsScannerBufferList::Release | ( | void | ) | [inline] |
| void nsScannerBufferList::Append | ( | Buffer * | buf | ) | [inline] |
| void nsScannerBufferList::DiscardUnreferencedPrefix | ( | Buffer * | aBuf | ) |
| Buffer* nsScannerBufferList::Head | ( | ) | [inline] |
| Buffer* nsScannerBufferList::Tail | ( | ) | [inline] |
friend class nsScannerSubstring [friend] |
1.5.6