BashSpark
Loading...
Searching...
No Matches
bs::shell_node_unicode Class Referencefinal

A single Unicode codepoint node. More...

#include <shell_node.h>

Inheritance diagram for bs::shell_node_unicode:
Collaboration diagram for bs::shell_node_unicode:

Public Member Functions

 shell_node_unicode (const std::size_t nPos, const char32_t cCharacter)
 Construct a unicode codepoint node.
 
void expand (std::vector< std::string > &vTokens, shell_session &oSession, bool bSplit) const override
 Expand by converting the codepoint into UTF-8 and appending it.
 
char32_t get_character () const noexcept
 Returns the stored UTF-32 codepoint.
 
- Public Member Functions inherited from bs::shell_node_expandable
 shell_node_expandable (const shell_node_type nType, const std::size_t nPos)
 Construct an expandable node.
 
- Public Member Functions inherited from bs::shell_node
virtual ~shell_node ()=default
 Virtual default destructor for polymorphic deletion.
 
shell_node_type get_type () const noexcept
 Get the node type.
 
std::size_t get_pos () const noexcept
 Get node position in the original input stream.
 

Additional Inherited Members

- Protected Member Functions inherited from bs::shell_node
 shell_node (const shell_node_type nType, const std::size_t nPos)
 Protected constructor used by derived classes.
 
- Protected Attributes inherited from bs::shell_node
const shell_node_type m_nType
 Node type.
 
const std::size_t m_nPos
 Position in the input stream.
 

Detailed Description

A single Unicode codepoint node.

Represents a single UTF-32 codepoint that expands into the corresponding UTF-8 encoded character(s).

Constructor & Destructor Documentation

◆ shell_node_unicode()

bs::shell_node_unicode::shell_node_unicode ( const std::size_t  nPos,
const char32_t  cCharacter 
)
inline

Construct a unicode codepoint node.

Parameters
nPosPosition in input.
cCharacterUTF-32 codepoint value.

Member Function Documentation

◆ expand()

void bs::shell_node_unicode::expand ( std::vector< std::string > &  vTokens,
shell_session oSession,
bool  bSplit 
) const
overridevirtual

Expand by converting the codepoint into UTF-8 and appending it.

Implements bs::shell_node_expandable.

◆ get_character()

char32_t bs::shell_node_unicode::get_character ( ) const
inlinenoexcept

Returns the stored UTF-32 codepoint.

Returns
char32_t The codepoint.

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