Formatted text I/O and display builtins. More...
#include <iostream>#include <memory_resource>#include <string>#include <nk/value/value.hpp>#include <nk/value/span.hpp>Go to the source code of this file.
Functions | |
| Value | nk::builtin::sprintf (const Value &fmt, Span< const Value > args, std::pmr::memory_resource *mr=nullptr) |
| Formats data into a character array or string according to format specifier fmt (sprintf(fmt, ...)). | |
| std::string | nk::builtin::sprintf (const std::string &fmt, Span< const Value > args, std::pmr::memory_resource *mr=nullptr) |
| Formats data into a C++ string according to format string fmt. | |
| std::string | nk::builtin::dispFormat (const Value &a) |
| Formats Value for terminal display via disp. | |
| void | nk::builtin::disp (const Value &v, std::ostream &os=std::cout) |
| Displays value to the standard output or specified stream (disp(v)). | |
| int | nk::builtin::fprintf (std::ostream &os, const std::string &fmt, Span< const Value > args, std::pmr::memory_resource *mr=nullptr) |
| Formats and writes data to an output stream (fprintf(os, fmt, ...)). | |
| Value | nk::builtin::sscanf (const std::string &str, const std::string &fmt, std::pmr::memory_resource *mr=nullptr) |
| Reads formatted data from a string according to format specifier fmt (sscanf(str, fmt)). | |
| void | nk::builtin::sscanf (Span< const Value > args, size_t nargout, Span< Value > outs, std::pmr::memory_resource *mr=nullptr) |
| Reads formatted data from a string with multi-output support ([A, count, errmsg, nextindex] = sscanf(...)). | |
Formatted text I/O and display builtins.
Provides clean, engine-free C++ API for formatted string generation (sprintf), stream printing (fprintf, disp), and text parsing (sscanf, textscan).
Definition in file iofun.hpp.