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

#include <MMessage.hh>

+ Inheritance diagram for MessagePrototypeWriter:
+ Collaboration diagram for MessagePrototypeWriter:

Classes

struct  Placement
 Where a generated function lives and what it takes. More...
 

Public Member Functions

 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...
 

Static Public Member Functions

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...
 

Protected Member Functions

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
 

Static Protected Member Functions

static Placement Place (const Message &message, const FunctionConcept &concept)
 

Additional Inherited Members

- Protected Attributes inherited from Writer
std::ostream & _Stream
 
std::string & _Indent
 

Constructor & Destructor Documentation

◆ MessagePrototypeWriter()

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

Member Function Documentation

◆ StreamableClassName()

string MessagePrototypeWriter::StreamableClassName ( const Message &  message)
static

References Concept::_Postfix, Concept::_Prefix, Message::Name, and Message::Settings.

Referenced by Place(), MessageHeaderWriter::StreamableClass(), and MessageCodeWriter::StreamableClassBody().

+ Here is the caller graph for this function:

◆ ExceptionClassName()

string MessagePrototypeWriter::ExceptionClassName ( const Message &  message)
static

References Concept::_Postfix, Concept::_Prefix, Message::Name, and Message::Settings.

Referenced by MessageCodeWriter::Definitions(), MessageCodeWriter::ExceptionClass(), and MessageHeaderWriter::ExceptionClass().

+ Here is the caller graph for this function:

◆ ExceptionLocaleConstructor()

bool MessagePrototypeWriter::ExceptionLocaleConstructor ( const Message &  message)
static

Whether the exception class needs the constructor taking a locale.

References Concept::_Active, MessageSettings::_Exception, Concept::_LocaleExtra, MessageSettings::_Throw, and Message::Settings.

Referenced by MessageCodeWriter::ExceptionClass(), and MessageHeaderWriter::ExceptionClass().

+ Here is the caller graph for this function:

◆ Place()

MessagePrototypeWriter::Placement MessagePrototypeWriter::Place ( const Message &  message,
const FunctionConcept &  concept 
)
staticprotected

References FunctionConcept::_Constness, FunctionConcept::_Naming, FunctionConcept::_Type, MEMBER_AS, MEMBER_OF, Message::Name, NONMEMBER, Message::Parameters, and StreamableClassName().

Referenced by Declarations(), and MessageCodeWriter::Definitions().

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

◆ FunctionPrototype()

void MessagePrototypeWriter::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
protected

References Writer::_Indent, Writer::_Stream, Writer::left(), and Writer::right().

Referenced by MessageCodeWriter::ClassConstructor(), Declarations(), MessageCodeWriter::Definitions(), MessageHeaderWriter::ExceptionClass(), MessageHeaderWriter::StreamableClass(), and MessageCodeWriter::TextFunction().

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

◆ LogFunctionPrototype()

void MessagePrototypeWriter::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
protected

References Writer::_Indent, Writer::_Stream, Writer::left(), and Writer::right().

Referenced by Declarations(), and MessageCodeWriter::Definitions().

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

◆ Declarations()

void MessagePrototypeWriter::Declarations ( const Message &  message,
const FunctionConcept &  concept,
FunctionKind  kind,
bool  inClass 
) const
protected

The declarations of a function concept's function(s).

References LogConcept::_Facility, Writer::_Indent, LogConcept::_Level, Concept::_LocaleExtra, Concept::_Postfix, Concept::_Prefix, Writer::_Stream, MessagePrototypeWriter::Placement::constness, GenerationMode::Export(), FunctionPrototype(), Log, LogFunctionPrototype(), Mode, MessagePrototypeWriter::Placement::name, MessagePrototypeWriter::Placement::parameters, Place(), Message::Settings, and Throw.

Referenced by MessageHeaderWriter::StreamableClass().

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

◆ WriteBaseClause()

void MessagePrototypeWriter::WriteBaseClause ( inheritance  type,
const std::string &  parent 
) const
protected

References Writer::_Indent, Writer::_Stream, Writer::left(), PRIVATE_INHERITANCE, PROTECTED_INHERITANCE, PUBLIC_INHERITANCE, and Writer::right().

Referenced by MessageHeaderWriter::ExceptionClass(), and MessageHeaderWriter::StreamableClass().

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

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