xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
tracestreambuf.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
diagnostics/trace.hpp
"
6
#include "
object.hpp
"
7
#include <iostream>
8
10
namespace
xtd
{
17
class
tracestreambuf
:
public
object
,
public
std::stringbuf {
18
protected
:
20
23
auto
sync
() ->
xtd::int32
override
{
24
#if TRACE
25
if
(!str().
empty
()) {
26
if
(str() ==
"\n"
)
xtd::diagnostics::trace::write_line
();
27
else
if
(
string
(str()).ends_with(
'\n'
))
xtd::diagnostics::trace::write_line
(
string
(str()).trim_end(
'\n'
));
28
else
xtd::diagnostics::trace::write
(str());
29
str(
""
);
30
}
31
#endif
32
return
0;
33
}
34
35
};
36
}
xtd::diagnostics::trace::write
static auto write(const xtd::string &message) -> void
Writes a message to the trace listeners in the listeners collection.
Definition
trace.hpp:240
xtd::diagnostics::trace::write_line
static auto write_line() -> void
Writes a line terminator to the trace listeners in the listeners collection.
Definition
trace.hpp:326
xtd::object::object
object()=default
Create a new instance of the ultimate base class object.
xtd::tracestreambuf
Provides an std::stringbuf for xtd::diagnostics::trace.
Definition
tracestreambuf.hpp:17
xtd::tracestreambuf::sync
auto sync() -> xtd::int32 override
Synchronizes the buffers with the associated character sequence.
Definition
tracestreambuf.hpp:23
trace.hpp
Contains xtd::diagnostics::trace class.
xtd::int32
std::int32_t int32
Represents a 32-bit signed integer.
Definition
int32.hpp:25
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
xtd::empty
constexpr auto empty() const noexcept -> bool
Returns a value that indicates whether the current xtd::read_only_span <type_t> is empty.
Definition
read_only_span.hpp:201
object.hpp
Contains xtd::object class.
Generated on
for xtd by
Gammasoft
. All rights reserved.