nk
1.0.0
C++ Numerical Computing Runtime
Toggle main menu visibility
Loading...
Searching...
No Matches
iofun.hpp
Go to the documentation of this file.
1
// src/builtin/include/nk/builtin/iofun.hpp
2
//
3
// Pure C++ Formatted input/output and stream printing functions.
4
#pragma once
5
6
#include <iostream>
7
#include <memory_resource>
8
#include <string>
9
#include <nk/value/value.hpp>
10
#include <nk/value/span.hpp>
11
12
namespace
nk::builtin {
13
16
17
24
31
Value
sprintf
(
const
Value
&fmt,
Span<const Value>
args, std::pmr::memory_resource *mr =
nullptr
);
32
39
std::string
sprintf
(
const
std::string &fmt,
Span<const Value>
args, std::pmr::memory_resource *mr =
nullptr
);
40
44
std::string
dispFormat
(
const
Value
&a);
45
49
void
disp
(
const
Value
&v, std::ostream &os = std::cout);
50
58
int
fprintf
(std::ostream &os,
const
std::string &fmt,
Span<const Value>
args, std::pmr::memory_resource *mr =
nullptr
);
59
66
Value
sscanf
(
const
std::string &str,
const
std::string &fmt, std::pmr::memory_resource *mr =
nullptr
);
67
73
void
sscanf
(
Span<const Value>
args,
size_t
nargout,
Span<Value>
outs, std::pmr::memory_resource *mr =
nullptr
);
74
75
77
}
// namespace nk::builtin
nk::Span
Definition
span.hpp:11
nk::Value
Core MATLAB-compatible multidimensional array and scalar value type.
Definition
value.hpp:61
nk::builtin::sprintf
Value 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,...
nk::builtin::sscanf
Value 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)).
nk::builtin::disp
void disp(const Value &v, std::ostream &os=std::cout)
Displays value to the standard output or specified stream (disp(v)).
nk::builtin::fprintf
int 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, ...)).
nk::builtin::dispFormat
std::string dispFormat(const Value &a)
Formats Value for terminal display via disp.
src
builtin
include
nk
builtin
iofun.hpp
Generated by
1.17.0