While a snip belongs to a buffer, the buffer may store extra information about a snip in some specialized way. When the snip is to be encoded, this extra information needs to be put into a buffer data object so that the extra information can be encoded as well. In an editor buffer, extra information can be associated with ranges of items, as well as snips.
Just as a snip must be associated with a snip class to be decoded (see Snip Classes), a buffer data object needs a buffer data class for decoding. Every buffer data class object should be added to the global buffer data class list, wx:the-buffer-data-class-list.
To store and load information about a snip or region in a buffer:
When deriving the new wx:buffer-data-class% class, pick a new unique name to identify the encoded data. All names beginning with ``wx'' are reserved for internal use. By tagging extra data with a unique name, the normal buffer content can be safely decoded in a buffer that does not support the extra data.