Melon
A C++ library designed for RadishOS.
Toggle main menu visibility
Loading...
Searching...
No Matches
Print.hpp
1
#pragma once
2
3
#include "String.hpp"
4
#include "Fmt.hpp"
5
6
#include <stdio.h>
7
9
namespace
Melon::Print
10
{
14
template
<
typename
... ARGS>
15
void
print
(
const
String::String
&str, ARGS &&...args)
16
{
17
String::String
formatted;
18
Typing::USize
idx = 0;
19
Fmt::formatArgs
(formatted, str, idx,
static_cast<
ARGS &&
>
(args)...);
20
printf(
"%s"
, formatted.
raw
());
21
}
22
26
template
<
typename
... ARGS>
27
void
println
(
const
String::String
&str, ARGS &&...args)
28
{
29
print
(str,
static_cast<
ARGS &&
>
(args)...);
30
print
(
"\n"
);
31
}
32
}
// namespace Melon::Print
Melon::String::String
A dynamic string.
Definition
String.hpp:11
Melon::String::String::raw
const char * raw(this const String &self)
Gets a raw buffer which contains the string characters.
Definition
String.cpp:42
Melon::Fmt::formatArgs
constexpr void formatArgs(String::String &out, const String::String &fmt, Typing::USize &idx, T &&arg, ARGS &&...args)
Format a string.
Definition
Fmt.hpp:69
Melon::Print
Contains functions to display text.
Definition
Print.hpp:10
Melon::Print::println
void println(const String::String &str, ARGS &&...args)
Print a newline-terminated formatted string to the standard output stream.
Definition
Print.hpp:27
Melon::Print::print
void print(const String::String &str, ARGS &&...args)
Print a formatted string to the standard output stream.
Definition
Print.hpp:15
Melon::Typing::USize
size_t USize
Biggest unsigned type.
Definition
Typing.hpp:38
Include
Print.hpp
Generated by
1.18.0