Clingo
|
Format specification for a field. More...
#include <fstring.hh>
Public Types | |
enum class | Conversion : uint8_t { str = 0 , repr = 1 } |
Enumeration of conversion options. More... | |
enum class | Align : uint8_t { none , left , right , number , center } |
The alignment options. More... | |
enum class | Sign : uint8_t { plus , minus , space } |
The sign options. More... | |
enum class | Grouping : uint8_t { none , comma , underscore } |
Enumeration of grouping options. More... | |
enum class | Type : uint8_t { character , binary , octal , decimal , hex_lower , hex_upper , locale , string } |
Enumeration of type options. More... | |
Public Member Functions | |
FormatSpec ()=default | |
Construct a default format specification. | |
auto | hash () const -> size_t |
Compute the hash of the format specification. | |
Static Public Member Functions | |
static auto | build (SymbolStore &store, std::string_view str) -> std::optional< FormatSpec > |
Parse a format specification from a string. | |
Public Attributes | |
std::vector< std::variant< SharedString, size_t > > | accessors |
The vector of accessors. | |
uint32_t | width = 0 |
The width of the field. | |
std::optional< char > | fill |
The fill character for padding if the field is wider than the content. | |
Type | type = Type::string |
The type of the field. | |
Grouping | grouping = Grouping::none |
The grouping option. | |
Conversion | conversion = Conversion::str |
The conversion option. | |
Align | align = Align::none |
The alignment of the field. | |
Sign | sign = Sign::minus |
The sign option. | |
bool | alternate_form = false |
Whether to use the alternate form. | |
Friends | |
auto | operator== (FormatSpec const &a, FormatSpec const &b) -> bool=default |
Compare two format specifications for equality. | |
auto | operator<=> (FormatSpec const &a, FormatSpec const &b) -> std::strong_ordering=default |
Compare two format specifications. | |
auto | operator<< (std::ostream &out, FormatSpec const &spec) -> std::ostream & |
Output the format specification to a stream. | |
auto | operator<< (Util::OutputBuffer &out, FormatSpec const &spec) -> Util::OutputBuffer & |
Output the format specification to a stream. | |
Format specification for a field.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Enumeration of type options.
|
static |
Parse a format specification from a string.
A format specification has the following syntax:
std::vector<std::variant<SharedString, size_t> > CppClingo::FormatSpec::accessors |
The vector of accessors.
One can for exmaples use [0].name
to refer to g
in the term f(g(1),2)
.