MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Textbuf

Method Textbuf

src/textbuf.cpp:403–414  ·  view source on GitHub ↗

* Initialize the textbuffer by supplying it the buffer to write into * and the maximum length of this buffer * @param max_bytes maximum size in bytes, including terminating '\0' * @param max_chars maximum size in chars, including terminating '\0' */

Source from the content-addressed store, hash-verified

401 * @param max_chars maximum size in chars, including terminating '\0'
402 */
403Textbuf::Textbuf(uint16_t max_bytes, uint16_t max_chars)
404 : char_iter(StringIterator::Create())
405{
406 assert(max_bytes != 0);
407 assert(max_chars != 0);
408
409 this->afilter = CS_ALPHANUMERAL;
410 this->max_bytes = max_bytes;
411 this->max_chars = max_chars == UINT16_MAX ? max_bytes : max_chars;
412 this->caret = true;
413 this->DeleteAll();
414}
415
416/**
417 * Copy a string into the textbuffer.

Callers

nothing calls this directly

Calls 1

DeleteAllMethod · 0.95

Tested by

no test coverage detected