xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
debugstreambuf.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
diagnostics/debug.hpp
"
6
#include "
object.hpp
"
7
#include <iostream>
8
10
namespace
xtd
{
21
class
debugstreambuf
:
public
object
,
public
std::stringbuf {
22
protected
:
24
27
auto
sync
() ->
xtd::int32
override
{
28
#if DEBUG
29
if
(!str().
empty
()) {
30
if
(str() ==
"\n"
)
xtd::diagnostics::debug::write_line
();
31
else
if
(
xtd::string
(str()).ends_with(
'\n'
))
xtd::diagnostics::debug::write_line
(
xtd::string
(str()).trim_end(
'\n'
));
32
else
xtd::diagnostics::debug::write
(str());
33
str(
""
);
34
}
35
#endif
36
return
0;
37
}
38
39
};
40
}
xtd::debugstreambuf
Provides an std::stringbuf for xtd::diagnostics::debug.
Definition
debugstreambuf.hpp:21
xtd::debugstreambuf::sync
auto sync() -> xtd::int32 override
Synchronizes the buffers with the associated character sequence.
Definition
debugstreambuf.hpp:27
xtd::diagnostics::debug::write_line
static auto write_line() -> void
Writes a line terminator to the trace listeners in the listeners collection.
Definition
debug.hpp:344
xtd::diagnostics::debug::write
static auto write(const xtd::string &message) -> void
Writes a message to the trace listeners in the listeners collection.
Definition
debug.hpp:259
xtd::object::object
object()=default
Create a new instance of the ultimate base class object.
debug.hpp
Contains xtd::diagnostics::debug class.
xtd::string
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition
__string_definitions.hpp:43
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.