mstring  1.3.1
Generates C++ message functions and classes from localized message definitions
Message Struct Reference

A $MESSAGE block. More...

#include <Message.hh>

+ Collaboration diagram for Message:

Public Member Functions

 Message (std::string name, std::string defaultLanguage, const MessageSettings &settings)
 
const LocaleMessage * DefaultLocale () const
 The locale text used when no other language matches: the one in DefaultLanguage, else the first one. nullptr for a message without text. More...
 
LocaleMessage & Locale (const std::string &language, const std::string &encode)
 The locale of language / encode, created on first use. More...
 
const Parameter * FindParameter (const std::string &name) const
 

Public Attributes

std::string Name
 
std::string DefaultLanguage
 $LANGUAGE in effect when the message was declared. More...
 
ParameterList Parameters
 
LocaleMessageList Locales
 
std::shared_ptr< const MessageSettings > Settings
 
std::string File
 Where $MESSAGE is, for diagnostics. More...
 
unsigned long int Line { 0 }
 
unsigned long int Col { 0 }
 

Detailed Description

A $MESSAGE block.

Constructor & Destructor Documentation

◆ Message()

Message::Message ( std::string  name,
std::string  defaultLanguage,
const MessageSettings &  settings 
)

Member Function Documentation

◆ DefaultLocale()

const LocaleMessage * Message::DefaultLocale ( ) const

The locale text used when no other language matches: the one in DefaultLanguage, else the first one. nullptr for a message without text.

References Locales.

Referenced by MessageCodeWriter::TextFunction().

+ Here is the caller graph for this function:

◆ Locale()

LocaleMessage & Message::Locale ( const std::string &  language,
const std::string &  encode 
)

The locale of language / encode, created on first use.

References Locales.

Referenced by MStringParser::currentLocale().

+ Here is the caller graph for this function:

◆ FindParameter()

const Parameter * Message::FindParameter ( const std::string &  name) const

References Parameters.

Referenced by MStringParser::parameterLine().

+ Here is the caller graph for this function:

Member Data Documentation

◆ Name

◆ DefaultLanguage

std::string Message::DefaultLanguage

$LANGUAGE in effect when the message was declared.

◆ Parameters

◆ Locales

◆ Settings

◆ File

std::string Message::File

Where $MESSAGE is, for diagnostics.

Referenced by CheckTranslations().

◆ Line

unsigned long int Message::Line { 0 }

Referenced by CheckTranslations().

◆ Col

unsigned long int Message::Col { 0 }

Referenced by CheckTranslations().


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