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

#include <Puma/CStrLiteral.h>

Inheritance diagram for Puma::CStrLiteral:

Description

String literal abstraction.

Holds the string value, its length, and the string type.

Public Member Functions

 CStrLiteral (const char *s, unsigned long len, CTypeInfo *t)
 Constructor.
virtual ~CStrLiteral ()
 Destructor.
virtual void print (std::ostream &out) const
 Print the string on the given output stream.
const char * String () const
 Get the wide string.
unsigned long Length () const
 Get the length of the string.
CStrLiteralStrLiteral () const
 Get this.
Public Member Functions inherited from Puma::CExprValue
virtual ~CExprValue ()
 Destructor.
CTypeInfoType () const
 Get the type of the value.
virtual CConstantConstant () const
 Get a pointer to CConstant if this is an arithmetic constant.
virtual CWStrLiteralWStrLiteral () const
 Get a pointer to CWStrLiteral if this is a wide string literal.

Additional Inherited Members

Protected Member Functions inherited from Puma::CExprValue
 CExprValue (CTypeInfo *t)
 Constructor.

Constructor & Destructor Documentation

◆ CStrLiteral()

Puma::CStrLiteral::CStrLiteral ( const char * s,
unsigned long len,
CTypeInfo * t )
inline

Constructor.

Parameters
sThe string array.
lenThe length of the string.
tThe type of the string.

◆ ~CStrLiteral()

virtual Puma::CStrLiteral::~CStrLiteral ( )
inlinevirtual

Destructor.

Frees the string.

Member Function Documentation

◆ Length()

unsigned long Puma::CStrLiteral::Length ( ) const
inline

Get the length of the string.

◆ print()

virtual void Puma::CStrLiteral::print ( std::ostream & out) const
inlinevirtual

Print the string on the given output stream.

Parameters
outThe output stream.

Implements Puma::CExprValue.

◆ String()

const char * Puma::CStrLiteral::String ( ) const
inline

Get the wide string.

◆ StrLiteral()

CStrLiteral * Puma::CStrLiteral::StrLiteral ( ) const
inlinevirtual

Get this.

Reimplemented from Puma::CExprValue.