Base Framework
Public Member Functions | List of all members
Literal Class Reference

A string literal. More...

#include <base/Literal.h>

Public Member Functions

template<MemorySize SIZE>
 Literal (const char(&value)[SIZE]) noexcept
 
const char * getValue () const noexcept
 
MemorySize getLength () const noexcept
 
 operator bool () const noexcept
 

Detailed Description

A string literal.

This class binds together a native string literal and its length.

Version
1.0
Examples
testsuite/eval.cpp, testsuite/ftp.cpp, testsuite/HashSet.cpp, testsuite/HashTable.cpp, testsuite/http.cpp, testsuite/IEEE1394.cpp, testsuite/ping.cpp, and testsuite/Process.cpp.

Constructor & Destructor Documentation

◆ Literal()

template<MemorySize SIZE>
Literal::Literal ( const char(&)  value[SIZE])
inlinenoexcept

Initializes the literal.

Member Function Documentation

◆ getLength()

MemorySize Literal::getLength ( ) const
inlinenoexcept

Returns the length of the literal.

◆ getValue()

const char* Literal::getValue ( ) const
inlinenoexcept

Returns the literal.

◆ operator bool()

Literal::operator bool ( ) const
inlinenoexcept

Returns true if not empty.