F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Fw/Types/StringBase.hpp>
Public Types | |
using | SizeType = NATIVE_UINT_TYPE |
Public Types inherited from Fw::Serializable | |
using | SizeType = NATIVE_UINT_TYPE |
Public Member Functions | |
virtual const CHAR * | toChar () const =0 |
virtual SizeType | getCapacity () const =0 |
return size of buffer More... | |
SizeType | length () const |
Get length of string. More... | |
SizeType | maxLength () const |
Get the maximum length of a string that the buffer can hold (which is capacity - 1) More... | |
SizeType | serializedSize () const |
SizeType | serializedTruncatedSize (FwSizeType maxLength) const |
const CHAR * | operator+= (const CHAR *src) |
Concatenate a CHAR*. More... | |
const StringBase & | operator+= (const StringBase &src) |
Concatenate a StringBase. More... | |
bool | operator== (const StringBase &other) const |
Check for equality with StringBase. More... | |
bool | operator== (const CHAR *other) const |
Check for equality with CHAR*. More... | |
bool | operator!= (const StringBase &other) const |
Inequality with StringBase. More... | |
bool | operator!= (const CHAR *other) const |
Inequality with CHAR*. More... | |
StringBase & | operator= (const CHAR *src) |
Assign CHAR*. More... | |
StringBase & | operator= (const StringBase &src) |
Assign another StringBase. More... | |
void | format (const CHAR *formatString,...) |
write formatted string to buffer More... | |
void | vformat (const CHAR *formatString, va_list args) |
write formatted string to buffer using va_list More... | |
virtual SerializeStatus | serialize (SerializeBufferBase &buffer) const |
serialization function More... | |
virtual SerializeStatus | serialize (SerializeBufferBase &buffer, SizeType maxLen) const |
serialization function More... | |
virtual SerializeStatus | deserialize (SerializeBufferBase &buffer) |
deserialization function More... | |
Static Public Member Functions | |
static constexpr SizeType | STATIC_SERIALIZED_SIZE (SizeType maxLength) |
static constexpr SizeType | BUFFER_SIZE (SizeType maxLength) |
Get the size of a null-terminated string buffer. More... | |
Protected Member Functions | |
StringBase () | |
virtual | ~StringBase () |
void | appendBuff (const CHAR *buff, SizeType size) |
Protected Member Functions inherited from Fw::Serializable | |
Serializable () | |
Default constructor. More... | |
virtual | ~Serializable () |
destructor More... | |
Definition at line 24 of file StringBase.hpp.
Definition at line 26 of file StringBase.hpp.
|
protected |
Definition at line 22 of file StringBase.cpp.
|
protectedvirtual |
Definition at line 24 of file StringBase.cpp.
Definition at line 112 of file StringBase.cpp.
Get the size of a null-terminated string buffer.
maxLength | The maximum string length |
Definition at line 41 of file StringBase.hpp.
|
virtual |
deserialization function
Implements Fw::Serializable.
Definition at line 156 of file StringBase.cpp.
void Fw::StringBase::format | ( | const CHAR * | formatString, |
... | |||
) |
write formatted string to buffer
Definition at line 56 of file StringBase.cpp.
|
pure virtual |
return size of buffer
Implemented in Os::TaskString, Os::QueueString, Fw::StringTemplate< size >, Fw::String, Fw::ObjectName, Fw::InternalInterfaceString, Fw::FileNameString, Fw::ExternalString, Fw::TlmString, Fw::ParamString, Fw::TextLogString, Fw::LogStringArg, and Fw::CmdStringArg.
StringBase::SizeType Fw::StringBase::length | ( | ) | const |
Get length of string.
Definition at line 125 of file StringBase.cpp.
StringBase::SizeType Fw::StringBase::maxLength | ( | ) | const |
Get the maximum length of a string that the buffer can hold (which is capacity - 1)
Definition at line 132 of file StringBase.cpp.
bool Fw::StringBase::operator!= | ( | const CHAR * | other | ) | const |
Inequality with CHAR*.
Definition at line 81 of file StringBase.cpp.
bool Fw::StringBase::operator!= | ( | const StringBase & | other | ) | const |
Inequality with StringBase.
Definition at line 77 of file StringBase.cpp.
Concatenate a CHAR*.
Definition at line 26 of file StringBase.cpp.
const StringBase & Fw::StringBase::operator+= | ( | const StringBase & | src | ) |
Concatenate a StringBase.
Definition at line 31 of file StringBase.cpp.
StringBase & Fw::StringBase::operator= | ( | const CHAR * | src | ) |
Assign CHAR*.
Definition at line 107 of file StringBase.cpp.
StringBase & Fw::StringBase::operator= | ( | const StringBase & | src | ) |
Assign another StringBase.
Definition at line 98 of file StringBase.cpp.
bool Fw::StringBase::operator== | ( | const CHAR * | other | ) | const |
Check for equality with CHAR*.
Definition at line 45 of file StringBase.cpp.
bool Fw::StringBase::operator== | ( | const StringBase & | other | ) | const |
Check for equality with StringBase.
Definition at line 36 of file StringBase.cpp.
|
virtual |
|
virtual |
serialization function
Definition at line 150 of file StringBase.cpp.
StringBase::SizeType Fw::StringBase::serializedSize | ( | ) | const |
Get the dynamic serialized size of a string This is the length of the string plus the size of the stored size
Definition at line 138 of file StringBase.cpp.
StringBase::SizeType Fw::StringBase::serializedTruncatedSize | ( | FwSizeType | maxLength | ) | const |
Get the serialized truncated size of a string This is the minimum of the dynamic serialized size and the max length
maxLength | The max string length |
Definition at line 142 of file StringBase.cpp.
|
inlinestaticconstexpr |
Get the static serialized size of a string This is the max length of the string plus the size of the stored size
maxLength | The maximum string length |
Definition at line 35 of file StringBase.hpp.
|
pure virtual |
void Fw::StringBase::vformat | ( | const CHAR * | formatString, |
va_list | args | ||
) |
write formatted string to buffer using va_list
Definition at line 63 of file StringBase.cpp.