xtd 0.2.0
__print.hpp
Go to the documentation of this file.
1
4
5#pragma once
7#if !defined(__XTD_CORE_INTERNAL__)
8#error "Do not include this file: Internal use only"
9#endif
11
12#include <cstdio>
13#include <ostream>
14#include "../io/io_exception.hpp"
15#include "../environment.hpp"
16#include "../null_pointer_exception.hpp"
17
19inline void __xtd_print_with_file_write__(bool new_line, FILE* file, xtd::string&& s) {
21 if (new_line) s += xtd::environment::new_line();
22 if (fwrite(s.c_str(), 1, s.length(), file) != s.length())
24}
25
26inline void __xtd_print_with_ostream_write__(bool new_line, std::ostream& os, xtd::string&& s) {
28 if (new_line) s += xtd::environment::new_line();
29 os.write(s.c_str(), s.length());
30}
Represents text as a sequence of character units.
Definition basic_string.hpp:71
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
@ null_pointer
The pointer is null.
@ io
I/O erreror occurs.
@ s
The S key.