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

A string backed by an external buffer. More...

#include <Fw/Types/ExternalString.hpp>

Inheritance diagram for Fw::ExternalString:
Fw::StringBase Fw::Serializable

Public Member Functions

 ExternalString (const ExternalString &)=delete
 Deleted copy constructor. More...
 
 ExternalString ()
 Constructor (uninitialized buffer) More...
 
 ExternalString (char *bufferPtr, StringBase::SizeType bufferSize)
 Constructor (bufferPtr and bufferSize) More...
 
 ExternalString (char *bufferPtr, StringBase::SizeType bufferSize, const StringBase &sb)
 Constructor (bufferPtr, bufferSize, and StringBase) More...
 
 ExternalString (char *bufferPtr, StringBase::SizeType bufferSize, const char *str)
 Constructor (bufferPtr, bufferSize, and const char*) More...
 
 ~ExternalString ()
 Destructor. More...
 
const char * toChar () const
 
StringBase::SizeType getCapacity () const
 
void setBuffer (char *bufferPtr, StringBase::SizeType bufferSize)
 Set the buffer and initialize it to the empty string. More...
 
ExternalStringoperator= (const ExternalString &src)
 
ExternalStringoperator= (const StringBase &src)
 
ExternalStringoperator= (const char *src)
 
- Public Member Functions inherited from Fw::StringBase
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...
 

Additional Inherited Members

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

A string backed by an external buffer.

Definition at line 17 of file ExternalString.hpp.

Constructor & Destructor Documentation

◆ ExternalString() [1/5]

Fw::ExternalString::ExternalString ( const ExternalString )
delete

Deleted copy constructor.

◆ ExternalString() [2/5]

Fw::ExternalString::ExternalString ( )
inline

Constructor (uninitialized buffer)

Definition at line 27 of file ExternalString.hpp.

◆ ExternalString() [3/5]

Fw::ExternalString::ExternalString ( char *  bufferPtr,
StringBase::SizeType  bufferSize 
)
inline

Constructor (bufferPtr and bufferSize)

Parameters
bufferPtrThe buffer pointer
bufferSizeThe buffer size

Definition at line 30 of file ExternalString.hpp.

◆ ExternalString() [4/5]

Fw::ExternalString::ExternalString ( char *  bufferPtr,
StringBase::SizeType  bufferSize,
const StringBase sb 
)
inline

Constructor (bufferPtr, bufferSize, and StringBase)

Parameters
bufferPtrThe buffer pointer
bufferSizeThe buffer size
sbThe source string

Definition at line 38 of file ExternalString.hpp.

◆ ExternalString() [5/5]

Fw::ExternalString::ExternalString ( char *  bufferPtr,
StringBase::SizeType  bufferSize,
const char *  str 
)
inline

Constructor (bufferPtr, bufferSize, and const char*)

Parameters
bufferPtrThe buffer pointer
bufferSizeThe buffer size
strThe source string

Definition at line 47 of file ExternalString.hpp.

◆ ~ExternalString()

Fw::ExternalString::~ExternalString ( )
inline

Destructor.

Definition at line 56 of file ExternalString.hpp.

Member Function Documentation

◆ getCapacity()

StringBase::SizeType Fw::ExternalString::getCapacity ( ) const
inlinevirtual

Returns the buffer size

Returns
The buffer size

Implements Fw::StringBase.

Definition at line 69 of file ExternalString.hpp.

◆ operator=() [1/3]

ExternalString& Fw::ExternalString::operator= ( const char *  src)
inline

Definition at line 103 of file ExternalString.hpp.

◆ operator=() [2/3]

ExternalString& Fw::ExternalString::operator= ( const ExternalString src)
inline

Definition at line 91 of file ExternalString.hpp.

◆ operator=() [3/3]

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

Definition at line 97 of file ExternalString.hpp.

◆ setBuffer()

void Fw::ExternalString::setBuffer ( char *  bufferPtr,
StringBase::SizeType  bufferSize 
)
inline

Set the buffer and initialize it to the empty string.

Parameters
bufferPtrThe buffer pointer
bufferSizeThe buffer size

Definition at line 77 of file ExternalString.hpp.

◆ toChar()

const char* Fw::ExternalString::toChar ( ) const
inlinevirtual

Gets the char buffer

Returns
The char buffer

Implements Fw::StringBase.

Definition at line 65 of file ExternalString.hpp.


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