quote_buffer 0.0.5 quote_buffer: ^0.0.5 copied to clipboard
Simplifies adding strings whose content is delimited by escaped quotation marks to Dart's string buffer.
Quote Buffer #
Introduction #
Automated code generation can be used to eliminate the need of writing and maintaining repetitive parts of a software. In order to add a string literal to generated source code, it is required to create strings whose content is delimited by escaped quotation marks.
In the following such strings are called quoted strings. QuoteBuffer simplifies adding quoted strings to a string buffer.
Usage #
QuoteBuffer extends Dart's StringBuffer. It adds the following methods for writing quoted strings to the buffer:
- writeQ(Object obj):
Converts an object to a quoted string.
var buffer = QuoteBuffer(); // Adds:'\'29\'' buffer.writeQ(29);
- writelnQ(Object obj):
Converts an object to a quoted string followed by a newline symbol.
// Adds:'\'name\'\n' buffer.writelnQ('name');
- writeAllQ(Iterable