Documentation ¶
Index ¶
- Constants
- type Buffer
- func (b *Buffer) AcceptLine(right_delim string)
- func (b *Buffer) AcceptWord()
- func (b *Buffer) Clean()
- func (b *Buffer) ForceAcceptLine(right_delim string)
- func (b *Buffer) ForceWriteString(str string)
- func (b *Buffer) GetPages(tabSize int, fieldSpacing int) [][][][]string
- func (b *Buffer) IsFirstOfLine() bool
- func (b *Buffer) Write(char rune)
- func (b *Buffer) WriteBytes(data []byte) (int, error)
- func (b *Buffer) WriteEmptyLine(right_delim string)
- func (b *Buffer) WriteRune(r rune)
Constants ¶
const ( // NBSP is the non-breaking space rune. NBSP rune = '\u00A0' )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a type that represents a Buffer of a document.
func NewBuffer ¶
func NewBuffer() *Buffer
NewBuffer creates a new buffer.
Returns:
- *Buffer: The new buffer.
func (*Buffer) AcceptLine ¶
AcceptLine is a function that accepts the current line of the formatted string. However, it does not accept the line if the line is empty.
Parameters:
- right_delim: The right delimiter to use for the line.
func (*Buffer) AcceptWord ¶
func (b *Buffer) AcceptWord()
AcceptWord is a function that accepts the current word of the formatted string when the word is not empty.
func (*Buffer) Clean ¶
func (b *Buffer) Clean()
Cleanup implements the object.Cleaner interface method.
func (*Buffer) ForceAcceptLine ¶
AcceptLine is a function that accepts the current line of the formatted string. However, it does not accept the line if the line is empty.
Parameters:
- right_delim: The right delimiter to use for the line.
func (*Buffer) ForceWriteString ¶
ForceWriteString is a function that writes a string to the buffer without checking for special characters. However, it does check for empty strings and will not write them.
Parameters:
- str: The string to write.
func (*Buffer) GetPages ¶
GetPages returns the pages that are in the buffer.
Parameters:
- tabSize: The size of the tab.
- fieldSpacing: The spacing to use for the tab stop.
Returns:
- [][][][]string: The pages of the StdPrinter.
func (*Buffer) IsFirstOfLine ¶
IsFirstOfLine is a function that returns true if the current position is the first position of a line.
Returns:
- bool: True if the current position is the first position of a line.
func (*Buffer) Write ¶
Write is a private function that appends a rune to the buffer while dealing with special characters.
Parameters:
- char: The rune to append.
func (*Buffer) WriteBytes ¶
WriteBytes is a function that writes bytes to the formatted string.
Parameters:
- b: The bytes to write.
Returns:
- int: The number of bytes written.
- error: An error if one occurred.
func (*Buffer) WriteEmptyLine ¶
WriteEmptyLine is a function that accepts the current line regardless of the whether the line is empty or not.
Parameters:
- right_delim: The right delimiter to use for the line.