Max OS 0.3
Loading...
Searching...
No Matches
MaxOS::StringBuilder Class Reference

Creates a string using a using a combination of parts with the '<<' operator. Simmilar to the logger. More...

#include <string.h>

Public Member Functions

 operator String () const
 Convert to string.
 
StringBuilderoperator<< (char const *str)
 Append C-string to the StringBuilder.
 
StringBuilderoperator<< (String const &other)
 Append String to the StringBuilder.
 
StringBuilderoperator<< (int value)
 Append int to the StringBuilder.
 
StringBuilderoperator<< (uint64_t value)
 Append a hex to the StringBuilder.
 
StringBuilderoperator<< (bool value)
 Append bool to the StringBuilder.
 

Public Attributes

String out
 The output string.
 

Detailed Description

Creates a string using a using a combination of parts with the '<<' operator. Simmilar to the logger.

See also
Logger

Definition at line 97 of file string.h.

Member Function Documentation

◆ operator String()

MaxOS::StringBuilder::operator String ( ) const
inline

Convert to string.

Definition at line 100 of file string.h.

References out.

◆ operator<<() [1/5]

StringBuilder & StringBuilder::operator<< ( bool  value)

Append bool to the StringBuilder.

Parameters
valueThe bool value to append
Returns
The StringBuilder reference

Definition at line 932 of file string.cpp.

932 {
933 out += string(value);
934 return *this;
935}
String out
The output string.
Definition string.h:99
class MaxOS::String string
Typedef for String.

References out.

◆ operator<<() [2/5]

StringBuilder & StringBuilder::operator<< ( char const *  str)

Append C-string to the StringBuilder.

Parameters
strThe C-string to append
Returns
The StringBuilder reference

Definition at line 888 of file string.cpp.

888 {
889 out += string(str);
890 return *this;
891}

References out.

◆ operator<<() [3/5]

StringBuilder & StringBuilder::operator<< ( int  value)

Append int to the StringBuilder.

Parameters
valueThe int value to append
Returns
The StringBuilder reference

Definition at line 910 of file string.cpp.

910 {
911 out += string(value);
912 return *this;
913}

References out.

◆ operator<<() [4/5]

StringBuilder & StringBuilder::operator<< ( String const &  other)

Append String to the StringBuilder.

Parameters
otherThe String to append
Returns
The StringBuilder reference

Definition at line 899 of file string.cpp.

899 {
900 out += other;
901 return *this;
902}

References out.

◆ operator<<() [5/5]

StringBuilder & StringBuilder::operator<< ( uint64_t  value)

Append a hex to the StringBuilder.

Parameters
valueThe hex value to append
Returns
The StringBuilder reference

Definition at line 921 of file string.cpp.

921 {
922 out += string(value);
923 return *this;
924}

References out.

Member Data Documentation

◆ out

String MaxOS::StringBuilder::out

The output string.

Definition at line 99 of file string.h.

Referenced by operator String(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), and MaxOS::tests::Test::run().


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