Public Member Functions | Protected Types | Protected Attributes | List of all members
cMsg Class Reference

Class for short, fixed maximum length text messages. More...

#include <sdhexception.h>

Public Member Functions

const char * c_str () const
 Return the C-string representation of the messag in this object. More...
 
 cMsg ()
 Default constructor, init message to empty string. More...
 
 cMsg (char const *fmt,...) SDH__attribute__((format(printf
 Constructor with printf like format, argument parameters. More...
 
 cMsg (cMsg const &other)
 Copy constructor, copy message content of other object to this object. More...
 

Protected Types

enum  { eMAX_MSG = 512 }
 anonymous enum instead of define macros More...
 

Protected Attributes

char msg [eMAX_MSG]
 

Detailed Description

Class for short, fixed maximum length text messages.

Simple message objects for short, fixed maximum length text messages, but with printf like initialization.

An object of type #SDH::cMsg contains an ASCII-Z string of maximum length eMAX_MSG. It can be initialized with a 'printf-style' format string by the constructor. It is used in the SDHLibrary to further specify the cause of an exception in human readable form.

See #SDH::cSDHLibraryException::cSDHLibraryException() for exemplary use.

Definition at line 77 of file sdhexception.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

anonymous enum instead of define macros

Enumerator
eMAX_MSG 

maximum length in bytes of a message to store

Definition at line 82 of file sdhexception.h.

Constructor & Destructor Documentation

◆ cMsg() [1/3]

USING_NAMESPACE_SDH cMsg::cMsg ( )

Default constructor, init message to empty string.

Definition at line 64 of file sdhexception.cpp.

◆ cMsg() [2/3]

cMsg::cMsg ( cMsg const &  other)

Copy constructor, copy message content of other object to this object.

Definition at line 71 of file sdhexception.cpp.

◆ cMsg() [3/3]

cMsg::cMsg ( char const *  fmt,
  ... 
)

Constructor with printf like format, argument parameters.

Definition at line 78 of file sdhexception.cpp.

Member Function Documentation

◆ c_str()

const char * cMsg::c_str ( ) const

Return the C-string representation of the messag in this object.

Definition at line 88 of file sdhexception.cpp.

Member Data Documentation

◆ msg

char cMsg::msg[eMAX_MSG]
protected

Definition at line 86 of file sdhexception.h.


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


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:59