F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Fw::StringBase Class Referenceabstract

#include <Fw/Types/StringBase.hpp>

Inheritance diagram for Fw::StringBase:
Fw::Serializable Fw::CmdStringArg Fw::ExternalString Fw::FileNameString Fw::InternalInterfaceString Fw::LogStringArg Fw::ObjectName Fw::ParamString Fw::String Fw::StringTemplate< size > Fw::TextLogString Fw::TlmString Os::QueueString Os::TaskString

Public Types

using SizeType = NATIVE_UINT_TYPE
 
- Public Types inherited from Fw::Serializable
using SizeType = NATIVE_UINT_TYPE
 

Public Member Functions

virtual const CHARtoChar () 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. More...
 
SizeType serializedSize () const
 
SizeType serializedTruncatedSize (FwSizeType maxLength) const
 
const CHARoperator+= (const CHAR *src)
 Concatenate a CHAR*. More...
 
const StringBaseoperator+= (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...
 
StringBaseoperator= (const CHAR *src)
 Assign CHAR*. More...
 
StringBaseoperator= (const StringBase &src)
 Assign another StringBase. More...
 
void format (const CHAR *formatString,...)
 write formatted string to buffer 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...
 

Detailed Description

Definition at line 23 of file StringBase.hpp.

Member Typedef Documentation

◆ SizeType

Definition at line 25 of file StringBase.hpp.

Constructor & Destructor Documentation

◆ StringBase()

Fw::StringBase::StringBase ( )
protected

Definition at line 22 of file StringBase.cpp.

◆ ~StringBase()

Fw::StringBase::~StringBase ( )
protectedvirtual

Definition at line 24 of file StringBase.cpp.

Member Function Documentation

◆ appendBuff()

void Fw::StringBase::appendBuff ( const CHAR buff,
SizeType  size 
)
protected

Definition at line 103 of file StringBase.cpp.

◆ BUFFER_SIZE()

static constexpr SizeType Fw::StringBase::BUFFER_SIZE ( SizeType  maxLength)
inlinestaticconstexpr

Get the size of a null-terminated string buffer.

Parameters
maxLengthThe maximum string length

Definition at line 40 of file StringBase.hpp.

◆ deserialize()

SerializeStatus Fw::StringBase::deserialize ( SerializeBufferBase buffer)
virtual

deserialization function

Implements Fw::Serializable.

Definition at line 147 of file StringBase.cpp.

◆ format()

void Fw::StringBase::format ( const CHAR formatString,
  ... 
)

write formatted string to buffer

Definition at line 56 of file StringBase.cpp.

◆ getCapacity()

◆ length()

StringBase::SizeType Fw::StringBase::length ( ) const

Get length of string.

Definition at line 116 of file StringBase.cpp.

◆ maxLength()

StringBase::SizeType Fw::StringBase::maxLength ( ) const

Get the maximum length of a string that the buffer can hold.

Definition at line 123 of file StringBase.cpp.

◆ operator!=() [1/2]

bool Fw::StringBase::operator!= ( const CHAR other) const

Inequality with CHAR*.

Definition at line 72 of file StringBase.cpp.

◆ operator!=() [2/2]

bool Fw::StringBase::operator!= ( const StringBase other) const

Inequality with StringBase.

Definition at line 68 of file StringBase.cpp.

◆ operator+=() [1/2]

const CHAR * Fw::StringBase::operator+= ( const CHAR src)

Concatenate a CHAR*.

Definition at line 26 of file StringBase.cpp.

◆ operator+=() [2/2]

const StringBase & Fw::StringBase::operator+= ( const StringBase src)

Concatenate a StringBase.

Definition at line 31 of file StringBase.cpp.

◆ operator=() [1/2]

StringBase & Fw::StringBase::operator= ( const CHAR src)

Assign CHAR*.

Definition at line 98 of file StringBase.cpp.

◆ operator=() [2/2]

StringBase & Fw::StringBase::operator= ( const StringBase src)

Assign another StringBase.

Definition at line 89 of file StringBase.cpp.

◆ operator==() [1/2]

bool Fw::StringBase::operator== ( const CHAR other) const

Check for equality with CHAR*.

Definition at line 45 of file StringBase.cpp.

◆ operator==() [2/2]

bool Fw::StringBase::operator== ( const StringBase other) const

Check for equality with StringBase.

Definition at line 36 of file StringBase.cpp.

◆ serialize() [1/2]

SerializeStatus Fw::StringBase::serialize ( SerializeBufferBase buffer) const
virtual

serialization function

Implements Fw::Serializable.

Definition at line 137 of file StringBase.cpp.

◆ serialize() [2/2]

SerializeStatus Fw::StringBase::serialize ( SerializeBufferBase buffer,
SizeType  maxLen 
) const
virtual

serialization function

Definition at line 141 of file StringBase.cpp.

◆ serializedSize()

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 129 of file StringBase.cpp.

◆ serializedTruncatedSize()

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

Parameters
maxLengthThe max string length

Definition at line 133 of file StringBase.cpp.

◆ STATIC_SERIALIZED_SIZE()

static constexpr SizeType Fw::StringBase::STATIC_SERIALIZED_SIZE ( SizeType  maxLength)
inlinestaticconstexpr

Get the static serialized size of a string This is the max length of the string plus the size of the stored size

Parameters
maxLengthThe maximum string length

Definition at line 34 of file StringBase.hpp.

◆ toChar()


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