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

#include <Fw/Types/StringBase.hpp>

Inheritance diagram for Fw::StringBase:
Fw::ConstStringBase 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 Member Functions

const CHARoperator+= (const CHAR *src)
 Concatenate a CHAR*. More...
 
const StringBaseoperator+= (const ConstStringBase &src)
 Concatenate a ConstStringBase. More...
 
const StringBaseoperator+= (const StringBase &src)
 Concatenate a StringBase. More...
 
StringBaseoperator= (const CHAR *src)
 Assign CHAR*. More...
 
StringBaseoperator= (const ConstStringBase &src)
 Assign another ConstStringBase. More...
 
StringBaseoperator= (const StringBase &src)
 Assign another StringBase. More...
 
FormatStatus format (const CHAR *formatString,...)
 write formatted string to buffer More...
 
FormatStatus vformat (const CHAR *formatString, va_list args)
 write formatted string to buffer using va_list More...
 
SerializeStatus deserializeFrom (SerialBufferBase &buffer, Endianness mode=Endianness::BIG) override
 Deserialize the contents of this object from a buffer. More...
 
- Public Member Functions inherited from Fw::ConstStringBase
virtual const CHARtoChar () const =0
 Convert to a C-style char*. More...
 
virtual SizeType getCapacity () const =0
 Return the size of the buffer. More...
 
virtual SizeType length () const
 Get the length of the 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
 
bool operator== (const ConstStringBase &other) const
 Check for equality with ConstStringBase. More...
 
bool operator== (const CHAR *other) const
 Check for equality with CHAR*. More...
 
bool operator!= (const ConstStringBase &other) const
 Inequality with ConstStringBase. More...
 
bool operator!= (const CHAR *other) const
 Inequality with CHAR*. More...
 
SerializeStatus serializeTo (SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
 Serialize the contents of this object to a buffer. More...
 
virtual SerializeStatus serializeTo (SerialBufferBase &buffer, SizeType maxLen, Endianness mode=Endianness::BIG) const
 
 DEPRECATED (SerializeStatus serialize(SerialBufferBase &buffer) const, "Use serializeTo(SerializeBufferBase& buffer) instead")
 
 DEPRECATED (SerializeStatus serialize(SerialBufferBase &buffer, SizeType maxLen) const, "Use serializeTo(SerializeBufferBase& buffer, SizeType maxLen) instead")
 
- Public Member Functions inherited from Fw::Serializable
Serializableoperator= (const Serializable &src)=default
 TODO: this operator should be deleted, this must be done after RawTime is modified though. More...
 
 DEPRECATED (SerializeStatus serialize(SerialBufferBase &buffer) const, "Use serializeTo(SerialBufferBase& buffer) instead")
 
 DEPRECATED (SerializeStatus deserialize(SerialBufferBase &buffer), "Use deserializeFrom(SerialBufferBase& buffer) instead")
 

Protected Member Functions

 StringBase ()
 
virtual ~StringBase ()
 
void appendBuff (const CHAR *buff, SizeType size)
 
- Protected Member Functions inherited from Fw::ConstStringBase
 ConstStringBase ()
 
virtual ~ConstStringBase ()
 
- Protected Member Functions inherited from Fw::Serializable
 Serializable ()
 Default constructor. More...
 
virtual ~Serializable ()
 Virtual destructor. More...
 

Additional Inherited Members

- Public Types inherited from Fw::ConstStringBase
using SizeType = FwSizeType
 
- Public Types inherited from Fw::Serializable
using SizeType = FwSizeType
 
- Static Public Member Functions inherited from Fw::ConstStringBase
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...
 

Detailed Description

Definition at line 27 of file StringBase.hpp.

Constructor & Destructor Documentation

◆ StringBase()

Fw::StringBase::StringBase ( )
protected

Definition at line 21 of file StringBase.cpp.

◆ ~StringBase()

Fw::StringBase::~StringBase ( )
protectedvirtual

Definition at line 23 of file StringBase.cpp.

Member Function Documentation

◆ appendBuff()

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

Definition at line 81 of file StringBase.cpp.

◆ deserializeFrom()

SerializeStatus Fw::StringBase::deserializeFrom ( SerialBufferBase buffer,
Endianness  mode = Endianness::BIG 
)
overridevirtual

Deserialize the contents of this object from a buffer.

This method reads serialized data from the provided buffer and reconstructs the object's data from it. The buffer should contain data in the format produced by serializeTo().

Parameters
bufferReference to the SerialBufferBase from which data will be deserialized
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Reimplemented from Fw::ConstStringBase.

Definition at line 94 of file StringBase.cpp.

◆ format()

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

write formatted string to buffer

Definition at line 39 of file StringBase.cpp.

◆ operator+=() [1/3]

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

Concatenate a CHAR*.

Definition at line 25 of file StringBase.cpp.

◆ operator+=() [2/3]

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

Concatenate a ConstStringBase.

Definition at line 30 of file StringBase.cpp.

◆ operator+=() [3/3]

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

Concatenate a StringBase.

Definition at line 35 of file StringBase.cpp.

◆ operator=() [1/3]

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

Assign CHAR*.

Definition at line 76 of file StringBase.cpp.

◆ operator=() [2/3]

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

Assign another ConstStringBase.

Definition at line 63 of file StringBase.cpp.

◆ operator=() [3/3]

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

Assign another StringBase.

Definition at line 70 of file StringBase.cpp.

◆ vformat()

FormatStatus Fw::StringBase::vformat ( const CHAR formatString,
va_list  args 
)

write formatted string to buffer using va_list

Definition at line 47 of file StringBase.cpp.


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