Debug text output.
More...
#include <klang.h>
|
| static Text | from (const char *in) |
| | Create a new Text object from a C-string.
|
| |
Definition at line 4209 of file klang.h.
◆ c_str()
◆ capacity()
◆ clear()
| void klang::Console::clear |
( |
| ) |
|
|
inline |
Definition at line 4214 of file klang.h.
4214 {
4216 string[0] = 0;
4217 }
◆ from()
Definition at line 1092 of file klang.h.
1092 {
1093 Text text;
1094 text = in;
1095 return text;
1096 }
◆ getText()
| int klang::Console::getText |
( |
char * | buffer | ) |
|
|
inline |
Definition at line 4250 of file klang.h.
4250 {
4251
4252 std::lock_guard<std::mutex> lock(
_lock);
4253 const int _length =
length;
4254 memcpy(buffer,
string,
length);
4257 return _length;
4258 }
klang::interleaved::buffer< 2 > buffer
◆ hasText()
| bool klang::Console::hasText |
( |
| ) |
const |
|
inline |
◆ operator const char *()
◆ operator!=()
| bool klang::Text< SIZE >::operator!= |
( |
const char * | in | ) |
const |
|
inlineinherited |
Definition at line 1110 of file klang.h.
1110 {
1112 }
bool operator==(const char *in) const
◆ operator+=()
| Console & klang::Console::operator+= |
( |
const char * | in | ) |
|
|
inline |
Definition at line 4235 of file klang.h.
4235 {
4236 std::lock_guard<std::mutex> lock(
_lock);
4237 const int len = std::max(0, std::min(
capacity() -
length, (
int)strlen(in)));
4238 memcpy(&
string[
length], in, len);
4241 memcpy(&
last, in, len);
4243 return *this;
4244 }
static THREAD_LOCAL Text< 16384 > last
◆ operator=() [1/2]
| Console & klang::Console::operator= |
( |
const char * | in | ) |
|
|
inline |
Definition at line 4219 of file klang.h.
4219 {
4220 std::lock_guard<std::mutex> lock(
_lock);
4222 memcpy(
string, in,
length);
4224 return *this;
4225 }
◆ operator=() [2/2]
Definition at line 4227 of file klang.h.
4227 {
4228 std::lock_guard<std::mutex> lock(
_lock);
4230 memcpy(
string, in.string,
length);
4232 return *this;
4233 }
◆ operator==()
| bool klang::Text< SIZE >::operator== |
( |
const char * | in | ) |
const |
|
inlineinherited |
Definition at line 1105 of file klang.h.
1105 {
1106 return strcmp(string, in) == 0;
1107 }
◆ _lock
| std::mutex klang::Console::_lock |
|
inlinestatic |
◆ last
| THREAD_LOCAL Text< 16384 > klang::Console::last |
|
inlinestatic |
◆ length
| int klang::Console::length = 0 |
◆ string