F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PrmString.cpp
Go to the documentation of this file.
1 #include <Fw/Prm/PrmString.hpp>
3 
4 namespace Fw {
5 
6  ParamString::ParamString(const char* src) : StringBase() {
7  Fw::StringUtils::string_copy(this->m_buf, src, sizeof(this->m_buf));
8  }
9 
11  Fw::StringUtils::string_copy(this->m_buf, src.toChar(), sizeof(this->m_buf));
12  }
13 
15  Fw::StringUtils::string_copy(this->m_buf, src.toChar(), sizeof(this->m_buf));
16  }
17 
19  this->m_buf[0] = 0;
20  }
21 
23  if(this == &other) {
24  return *this;
25  }
26 
27  Fw::StringUtils::string_copy(this->m_buf, other.toChar(), sizeof(this->m_buf));
28  return *this;
29  }
30 
32  if(this == &other) {
33  return *this;
34  }
35 
36  Fw::StringUtils::string_copy(this->m_buf, other.toChar(), sizeof(this->m_buf));
37  return *this;
38  }
39 
40  ParamString& ParamString::operator=(const char* other) {
41  Fw::StringUtils::string_copy(this->m_buf, other, sizeof(this->m_buf));
42  return *this;
43  }
44 
46  }
47 
48  const char* ParamString::toChar() const {
49  return this->m_buf;
50  }
51 
54  }
55 }
PrmString.hpp
Fw::ParamString::operator=
ParamString & operator=(const ParamString &other)
Definition: PrmString.cpp:22
Fw::StringBase
Definition: StringType.hpp:23
FW_PARAM_STRING_MAX_SIZE
#define FW_PARAM_STRING_MAX_SIZE
Max size of parameter string type.
Definition: FpConfig.hpp:272
StringUtils.hpp
Fw::ParamString::toChar
const char * toChar() const
Definition: PrmString.cpp:48
Fw::StringUtils::string_copy
char * string_copy(char *destination, const char *source, U32 num)
copy string with null-termination guaranteed
Definition: StringUtils.cpp:5
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Fw::StringBase::toChar
virtual const CHAR * toChar() const =0
Fw::ParamString::~ParamString
~ParamString()
Definition: PrmString.cpp:45
Fw::ParamString::getCapacity
NATIVE_UINT_TYPE getCapacity() const
return size of buffer
Definition: PrmString.cpp:52
Fw::ParamString::ParamString
ParamString()
Definition: PrmString.cpp:18
Fw::ParamString
Definition: PrmString.hpp:11
Fw
Definition: Buffer.cpp:21