PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Public Member Functions | List of all members
PropWare::StaticStringBuilder Class Reference

Build a statically-sized string in RAM using the PropWare::Printer interface. More...

#include <PropWare/string/staticstringbuilder.h>

+ Inheritance diagram for PropWare::StaticStringBuilder:
+ Collaboration diagram for PropWare::StaticStringBuilder:

Public Member Functions

 StaticStringBuilder (char buffer[])
 Wrap an already allocated character array with extra functionality. More...
 
void put_char (const char c)
 Print a single character. More...
 
void puts (const char string[])
 Send a null-terminated character array. Though this method could be created using put_char, some objects (such as PropWare::UART), have optimized methods for sending a string and PrintCapable::puts can utilize them. More...
 
const charto_string () const
 Retrieve the internal string address.
 
uint16_t get_size () const
 Determine the number of characters in the string.
 
void clear ()
 Remove all characters from the string.
 

Detailed Description

Build a statically-sized string in RAM using the PropWare::Printer interface.

Examples
StringBuilder_Demo.cpp.

Definition at line 36 of file staticstringbuilder.h.

Constructor & Destructor Documentation

◆ StaticStringBuilder()

PropWare::StaticStringBuilder::StaticStringBuilder ( char  buffer[])

Wrap an already allocated character array with extra functionality.

Parameters
[in]bufferLocation in memory that can be used for string manipulation

Definition at line 43 of file staticstringbuilder.h.

Member Function Documentation

◆ put_char()

void PropWare::StaticStringBuilder::put_char ( const char  c)
virtual

Print a single character.

Parameters
[in]cIndividual char to be printed

Implements PropWare::PrintCapable.

Definition at line 49 of file staticstringbuilder.h.

◆ puts()

void PropWare::StaticStringBuilder::puts ( const char  string[])
virtual

Send a null-terminated character array. Though this method could be created using put_char, some objects (such as PropWare::UART), have optimized methods for sending a string and PrintCapable::puts can utilize them.

Precondition
string[] must be terminated with a null terminator
Parameters
[in]string[]Array of data words with the final word being 0 - the null terminator

Implements PropWare::PrintCapable.

Definition at line 54 of file staticstringbuilder.h.


The documentation for this class was generated from the following file: