Expand description
opstr is a library to apply operations to strings.
§Objects
Configurationrepresents how the output shall be represented and which locale shall be used for Unicode operations.LibErroris anenumof all possible error types that can occurArgrepresents one input argument (final content, in the case of stdin/file).Argsis a sequence of them.
§Concepts
- Operations provide a priority. A priority defines how much sense this request made. A priority of 1.0 means “very likely what you looked for” (on the CLI, the result will be shown on the bottom). A priority close to 0.0 means “unlikely helpful” (on the CLI, the result will be printed out first). Results with priority 0.0 make no sense and will be discarded immediately.
§API
list_all_opsreturns the list of supported operationslist_matching_opsreturns the list of possible operations for the provided argumentsmatcher::run_opreturns theOutputafter running the one operation specifiedmatcher::run_matching_opsruns all operations appropriate for the provided arguments and writes the result to stdout & stderr
§Notes
- The CLI output is always valid UTF-8. This might change in the future, but in the current release, this is the case.
Argis either Unicode content (Chars) or an arbitrary byte sequence (Bytes).Bytesis not yet supported.Outputabstracts the type of result of an operation.Configuration.syntaxdefines which formal grammar shall be used for representation. The default representation for humans does not have a specification.
Structs§
- Args
- An ordered container for arguments
- Configuration
- Global application settings (mainly to configure representation)
Enums§
- Arg
- An argument for an operation
- Color
Scheme - Enum
ColorSchemein use to represent the diagnostic message. - LibError
LibErrorrepresents one of all possible error cases possible to occur in this library- Output
- Output is the result of an operation ready for user-friendly representation through the
printmethod
Functions§
- list_
all_ ops - Return the list of all operations as
Output::Associationof (name, description) entries. - list_
color_ schemes - Run all operations appropriate for the provided
Args. Write the result to stdout & stderr, so we return() - list_
matching_ ops - Return the ordered list of appropriate operations as
Output::Associationof (name, description) entries. - run_
matching_ ops - Run all operations appropriate for the provided
Args. Write the result to stdout & stderr, so we return() - run_op
- Return
(op_name, Output)as result of running the specified operationop_namewithArgs