PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::CLanguage Class Reference

#include <Puma/CLanguage.h>

Description

Language specific encoding of entity names.

The language is specified using the 'extern' linkage specifier.

Following languages are supported: "C", "C++". C entity names are not encoded. C++ entity names usually are encoded according to the C++ V3 ABI mangling (see http://www.codesourcery.com/cxx-abi/abi.html#mangling).

Example:

void foo(char); // encoded as: _Z3fooc
extern "C" void bar(int); // encoded as: bar

Public Types

enum  LangType {
  LANG_C ,
  LANG_CPLUSPLUS ,
  LANG_OTHER ,
  LANG_UNDEFINED
}
 Entity language encoding types. More...
 

Public Member Functions

 CLanguage ()
 Constructor.
 
void Type (LangType lt)
 Set the language encoding type.
 
void Type (LangType lt, const char *txt)
 Set the language encoding type.
 
LangType Type () const
 Get the language type.
 
const DStringText () const
 Get the language identifier like "C" or "C++".
 
bool operator== (const CLanguage &lang)
 Compare two language encodings.
 
bool operator== (LangType lt)
 Compare two language encodings.
 

Member Enumeration Documentation

◆ LangType

Entity language encoding types.

Enumerator
LANG_C 

Language C.

LANG_CPLUSPLUS 

Language C++.

LANG_OTHER 

Neither C nor C++.

LANG_UNDEFINED 

No explicit language encoding.

Constructor & Destructor Documentation

◆ CLanguage()

Puma::CLanguage::CLanguage ( )
inline

Constructor.

Member Function Documentation

◆ operator==() [1/2]

bool Puma::CLanguage::operator== ( const CLanguage & lang)
inline

Compare two language encodings.

Parameters
langThe language encoding to compare with.

◆ operator==() [2/2]

bool Puma::CLanguage::operator== ( LangType lt)
inline

Compare two language encodings.

Parameters
ltThe language encoding type to compare with.

◆ Text()

const DString & Puma::CLanguage::Text ( ) const
inline

Get the language identifier like "C" or "C++".

Returns
The language identifier or the empty string.

◆ Type() [1/3]

LangType Puma::CLanguage::Type ( ) const
inline

Get the language type.

◆ Type() [2/3]

void Puma::CLanguage::Type ( LangType lt)
inline

Set the language encoding type.

Parameters
ltThe language type.

◆ Type() [3/3]

void Puma::CLanguage::Type ( LangType lt,
const char * txt )
inline

Set the language encoding type.

Parameters
ltThe language type.
txtThe language identifier for languages other than C or C++.