F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
FileNameString.hpp
Go to the documentation of this file.
1// ======================================================================
2// @file FileNameString.hpp
3// @author F Prime
4// @brief A string sized to store a file name
5// ======================================================================
6
7#ifndef FW_FILE_NAME_STRING_HPP
8#define FW_FILE_NAME_STRING_HPP
9
10#include <FpConfig.hpp>
11
12#include "Fw/Cfg/SerIds.hpp"
15
16namespace Fw {
17
18class FileNameString final : public StringBase {
19 public:
20 enum {
24 };
25
26 FileNameString() : StringBase() { *this = ""; }
27
28 explicit FileNameString(const FileNameString& src) : StringBase() { *this = src; }
29
30 explicit FileNameString(const StringBase& src) : StringBase() { *this = src; }
31
32 explicit FileNameString(const char* src) : StringBase() { *this = src; }
33
35
37 (void)StringBase::operator=(src);
38 return *this;
39 }
40
42 (void)StringBase::operator=(src);
43 return *this;
44 }
45
46 FileNameString& operator=(const char* src) {
47 (void)StringBase::operator=(src);
48 return *this;
49 }
50
51 const char* toChar() const { return this->m_buf; }
52
53 StringBase::SizeType getCapacity() const { return sizeof this->m_buf; }
54
55 private:
56 char m_buf[BUFFER_SIZE(STRING_SIZE)];
57};
58} // namespace Fw
59
60#endif
C++-compatible configuration header for fprime configuration.
@ FileNameStringSize
Definitions for ISF type serial IDs.
Declares F Prime string base class.
const char * toChar() const
FileNameString(const char *src)
FileNameString & operator=(const char *src)
FileNameString(const FileNameString &src)
FileNameString & operator=(const StringBase &src)
FileNameString & operator=(const FileNameString &src)
FileNameString(const StringBase &src)
StringBase::SizeType getCapacity() const
return size of buffer
NATIVE_UINT_TYPE SizeType
static constexpr SizeType STATIC_SERIALIZED_SIZE(SizeType maxLength)
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
@ FW_TYPEID_FILE_NAME_STRING
FileName string Buffer type id.
Definition SerIds.hpp:61