Go to the source code of this file.
Functions | |
struct | FormatStructTemplate (T) |
typedef | FormatStructTemplate (char) FormatStruct |
class | FormatClassTemplate (T) |
typedef | FormatClassTemplate (char) Format |
Variables | |
module mango convert | Format |
import std | stdarg |
import mango convert | Type |
import mango convert mango convert | Integer |
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for damages of any kind arising from the use of this software.
Permission is hereby granted to anyone to use this software for any purpose, including commercial applications, and to alter it and/or redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment within documentation of said product would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any distribution of the source.
4. Derivative works are permitted, but they must carry this notice in full and credit the original source.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Definition in file Format.d.
|
Functions for styled, readable, output. See parse() for the list of format specifiers. Default styles for supported styles. This is used to format discrete values, or those provided without a specified format-string. Configure this Format with an output handler, a workspace area, and a floating point handler. The latter is optional. Throw an error General purpose va_arg format routine, used by a number of classes and structs to emit printf() styled text. This implementation simply converts its arguments into the appropriate internal style, and invokes the standard Mango style-formatter for each. Note that this can handle arrays of type in addition to the usual char[] ~ e.g. one can print an array of integers just as easily as a single integer. See parse() for the list of format specifiers. Emit a single formatted argument. Format may be null Emit a single formatted argument. Note that emit() can handle type-arrays in addition to the usual char[]; e.g. one can print an array of integers just as easily as a single integer. To support this, a new style flag has been introduced to terminate the format string at the point of use. That is, the rest of the format string is considered to be part of the current format specifier, and will be repeated for each array element. For example, the format string " %@x," has a preceeding space, a trailing comma, and the array flag '@'. This will output an array of numeric values (char, byte, short, int, long, float, double, real, pointer) as a set of formatted hexadecimal strings. See parse() for the list of format specifiers. internal method to map data styles Clear the current state. This is typically used internally only. Emit some spaces. This was originally an inner method, but that caused the code size to inexplicably increase by a large amount. A regular private function does not have that effect. Emit a field, surrounded by optional prefix and postfix strings, and optionally padded with spaces. Emit an integer field Emit a floating-point field test for a digit Parse a format specifier into its constituent flags and values. Syntax follows the traditional printf() approach, as follows: [flags][width][.precision]style Where 'style' is one of: s : string format c : character format d : signed format u : unsigned format x : hexadecimal format X : uppercase hexadecimal format e : scientific notation f : floating point format g : 'e' or 'f', based upon width Note that there are no variants on the format styles ~ long, int, short, and byte differences are all handled internally. The 'flags' supported: space : prefix negative integer with one space; pad any style when combined with a width specifier
The 'width' should be specified for either zero or space padding, and may be used with all formatting styles. A 'precision' can be used to stipulate the number of decimal-places, or a slice of a text string. Note that the Format package supports array-output in addition to the usual printf() output. Definition at line 55 of file Format.d. References FormatStructTemplate(), Integer, IntegerTemplate(), and type(). Referenced by FormatClassTemplate(), FormatStructTemplate(), and MutableStringTemplate(). |
|
Functions for styled, readable, output. See Format.parse() for the list of format specifiers. |
|
Definition at line 666 of file Format.d. References Format, FormatClassTemplate(), and FormatStructTemplate(). Referenced by BufferFormatTemplate(), and FormatClassTemplate(). |
|
|
|
|
|
|
|
|
|
|