mstring  1.3.1
Generates C++ message functions and classes from localized message definitions
MessageCodeWriter Class Reference

#include <MMessage.hh>

+ Inheritance diagram for MessageCodeWriter:
+ Collaboration diagram for MessageCodeWriter:

Public Member Functions

 MessageCodeWriter (std::ostream &stream, std::string &indent)
 
void operator() (const Message &message)
 
- Public Member Functions inherited from MessagePrototypeWriter
 MessagePrototypeWriter (std::ostream &stream, std::string &indent)
 
- Public Member Functions inherited from Writer
 Writer (std::ostream &stream, std::string &indent)
 
virtual ~Writer ()=default
 
void right () const
 Indent one level deeper. More...
 
void left () const
 Indent one level less. More...
 

Protected Member Functions

void TextFunction (const Message &message, bool builder)
 
void Definitions (const Message &message, const FunctionConcept &concept, FunctionKind kind)
 
void ExceptionClass (const Message &message)
 
void StreamableClassBody (const Message &message)
 
void ClassConstructor (const Message &message, const std::string &parent, const std::string &className, bool loc, bool exception)
 
void CallBuilder (const Message &message, const std::string &locale, const std::string &argumentPrefix, const ParameterList &parameters)
 
void CallStreamer (const Message &message, bool loc, const std::string &stream, const std::string &argumentPrefix, const ParameterList &parameters)
 
- Protected Member Functions inherited from MessagePrototypeWriter
void FunctionPrototype (const std::string &returnType, const std::string &className, const std::string &prefix, const std::string &postfix, const std::string &name, const ParameterList &parameters, bool constness, bool localeParm=true, bool streamFunc=false) const
 
void LogFunctionPrototype (const std::string &returnType, const std::string &className, const std::string &prefix, const std::string &postfix, const std::string &name, const ParameterList &parameters, bool constness, const std::string &facility, const std::string &level, bool localeParm, bool defaultVal) const
 
void Declarations (const Message &message, const FunctionConcept &concept, FunctionKind kind, bool inClass) const
 The declarations of a function concept's function(s). More...
 
void WriteBaseClause (inheritance type, const std::string &parent) const
 

Additional Inherited Members

- Static Public Member Functions inherited from MessagePrototypeWriter
static std::string StreamableClassName (const Message &message)
 
static std::string ExceptionClassName (const Message &message)
 
static bool ExceptionLocaleConstructor (const Message &message)
 Whether the exception class needs the constructor taking a locale. More...
 
- Static Protected Member Functions inherited from MessagePrototypeWriter
static Placement Place (const Message &message, const FunctionConcept &concept)
 
- Protected Attributes inherited from Writer
std::ostream & _Stream
 
std::string & _Indent
 

Constructor & Destructor Documentation

◆ MessageCodeWriter()

MessageCodeWriter::MessageCodeWriter ( std::ostream &  stream,
std::string &  indent 
)

Member Function Documentation

◆ operator()()

void MessageCodeWriter::operator() ( const Message &  message)

References Concept::_Active, MessageSettings::_Exception, MessageSettings::_Streamable, MessageSettings::_Throw, NeedsBuilder(), and NeedsStreamer().

+ Here is the call graph for this function:

◆ TextFunction()

void MessageCodeWriter::TextFunction ( const Message &  message,
bool  builder 
)
protected

◆ Definitions()

◆ ExceptionClass()

void MessageCodeWriter::ExceptionClass ( const Message &  message)
protected

References Writer::_Indent, Writer::_Stream, CallBuilder(), ClassConstructor(), MessagePrototypeWriter::ExceptionClassName(), MessagePrototypeWriter::ExceptionLocaleConstructor(), Writer::left(), GenerationMode::Linkage(), Mode, Message::Parameters, Writer::right(), and Message::Settings.

+ Here is the call graph for this function:

◆ StreamableClassBody()

void MessageCodeWriter::StreamableClassBody ( const Message &  message)
protected

References Writer::_Indent, Writer::_Stream, ClassConstructor(), Writer::left(), GenerationMode::Linkage(), Mode, Message::Name, Message::Parameters, Writer::right(), Message::Settings, and MessagePrototypeWriter::StreamableClassName().

+ Here is the call graph for this function:

◆ ClassConstructor()

void MessageCodeWriter::ClassConstructor ( const Message &  message,
const std::string &  parent,
const std::string &  className,
bool  loc,
bool  exception 
)
protected

References Writer::_Indent, Writer::_Stream, MessagePrototypeWriter::FunctionPrototype(), Writer::left(), GenerationMode::Linkage(), Mode, Parameter::Name, Message::Parameters, Writer::right(), and Message::Settings.

Referenced by ExceptionClass(), and StreamableClassBody().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallBuilder()

void MessageCodeWriter::CallBuilder ( const Message &  message,
const std::string &  locale,
const std::string &  argumentPrefix,
const ParameterList &  parameters 
)
protected

References Writer::_Indent, Writer::_Stream, and Message::Name.

Referenced by Definitions(), and ExceptionClass().

+ Here is the caller graph for this function:

◆ CallStreamer()

void MessageCodeWriter::CallStreamer ( const Message &  message,
bool  loc,
const std::string &  stream,
const std::string &  argumentPrefix,
const ParameterList &  parameters 
)
protected

References Writer::_Indent, Writer::_Stream, and Message::Name.

Referenced by Definitions().

+ Here is the caller graph for this function:

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