F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
StringBase.hpp
Go to the documentation of this file.
1 
13 #ifndef FW_STRING_BASE_HPP
14 #define FW_STRING_BASE_HPP
15 
16 #include <Fw/FPrimeBasicTypes.hpp>
19 #include <Fw/Types/format.hpp>
20 #include <cstdarg>
21 #ifdef BUILD_UT
22 #include <iostream>
23 #endif
24 
25 namespace Fw {
26 
27 class StringBase : public ConstStringBase {
28  public:
29  const CHAR* operator+=(const CHAR* src);
30  const StringBase& operator+=(const ConstStringBase& src);
31  const StringBase& operator+=(const StringBase& src);
32 
33  StringBase& operator=(const CHAR* src);
34  StringBase& operator=(const ConstStringBase& src);
35  StringBase& operator=(const StringBase& src);
36 
37  FormatStatus format(const CHAR* formatString, ...);
38  FormatStatus vformat(const CHAR* formatString, va_list args);
39 
41 
42 #if FW_SERIALIZABLE_TO_STRING || BUILD_UT
43  void toString(StringBase& text) const override;
44 #endif
45 
46  protected:
47  StringBase();
48  virtual ~StringBase();
49 
50  void appendBuff(const CHAR* buff, SizeType size);
51 
52  private:
53  StringBase(const StringBase& src) = delete;
54 };
55 
56 } // namespace Fw
57 
58 #endif
SerializeStatus deserializeFrom(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) override
Deserialize the contents of this object from a buffer.
Definition: StringBase.cpp:94
const CHAR * operator+=(const CHAR *src)
Concatenate a CHAR*.
Definition: StringBase.cpp:25
FormatStatus vformat(const CHAR *formatString, va_list args)
write formatted string to buffer using va_list
Definition: StringBase.cpp:47
char CHAR
Definition: BasicTypes.h:59
Declares F Prime read-only string base class.
SerializeStatus
forward declaration for string
virtual ~StringBase()
Definition: StringBase.cpp:23
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
A read-only abstract superclass for StringBase.
void appendBuff(const CHAR *buff, SizeType size)
Definition: StringBase.cpp:81
StringBase & operator=(const CHAR *src)
Assign CHAR*.
Definition: StringBase.cpp:76
Implementation of malloc based allocator.
Endianness
Big endian serialization.
FormatStatus
status of string format calls
Definition: format.hpp:18