Bash++
Bash++ compiler internal documentation
Public Member Functions | Public Attributes | List of all members
BashVersion Struct Reference

Represents a Bash version to target for code generation. More...

#include <BashVersion.h>

Public Member Functions

constexpr operator uint32_t () const
 
constexpr bool operator>= (const BashVersion &other) const
 
constexpr bool operator<= (const BashVersion &other) const
 
constexpr bool operator> (const BashVersion &other) const
 
constexpr bool operator< (const BashVersion &other) const
 
constexpr bool operator== (const BashVersion &other) const
 
constexpr bool operator!= (const BashVersion &other) const
 
constexpr std::string to_string () const
 
constexpr operator std::string () const
 
constexpr BashVersion ()=default
 
constexpr ~BashVersion ()=default
 
constexpr BashVersion (const BashVersion &)=default
 
constexpr BashVersionoperator= (const BashVersion &)=default
 
constexpr BashVersion (BashVersion &&)=default
 
constexpr BashVersionoperator= (BashVersion &&)=default
 
constexpr BashVersion (uint16_t major, uint16_t minor)
 
constexpr BashVersion (std::string_view version_string)
 Constructs a BashVersion from a string in the format "major.minor" (e.g., "5.2")
 

Public Attributes

uint16_t major = 5
 
uint16_t minor = 2
 

Detailed Description

Represents a Bash version to target for code generation.

Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes Licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later)

This struct is used to specify the target Bash version for code generation. It is represented as a single unsigned 32-bit integer for efficient comparison. The high 16 bits represent the major version, and the low 16 bits represent the minor version.

Constructor & Destructor Documentation

◆ BashVersion() [1/5]

constexpr BashVersion::BashVersion ( )
constexprdefault

◆ ~BashVersion()

constexpr BashVersion::~BashVersion ( )
constexprdefault

◆ BashVersion() [2/5]

constexpr BashVersion::BashVersion ( const BashVersion )
constexprdefault

◆ BashVersion() [3/5]

constexpr BashVersion::BashVersion ( BashVersion &&  )
constexprdefault

◆ BashVersion() [4/5]

constexpr BashVersion::BashVersion ( uint16_t  major,
uint16_t  minor 
)
inlineconstexpr

◆ BashVersion() [5/5]

constexpr BashVersion::BashVersion ( std::string_view  version_string)
inlineexplicitconstexpr

Constructs a BashVersion from a string in the format "major.minor" (e.g., "5.2")

Also accepts a string with just the major version (e.g., "5"), in which case the minor version defaults to 0.

Parameters
version_stringThe version string to parse
Exceptions
std::invalid_argumentif the version string is not in a valid format

Member Function Documentation

◆ operator std::string()

constexpr BashVersion::operator std::string ( ) const
inlineconstexpr

◆ operator uint32_t()

constexpr BashVersion::operator uint32_t ( ) const
inlineconstexpr

◆ operator!=()

constexpr bool BashVersion::operator!= ( const BashVersion other) const
inlineconstexpr

◆ operator<()

constexpr bool BashVersion::operator< ( const BashVersion other) const
inlineconstexpr

◆ operator<=()

constexpr bool BashVersion::operator<= ( const BashVersion other) const
inlineconstexpr

◆ operator=() [1/2]

constexpr BashVersion & BashVersion::operator= ( BashVersion &&  )
constexprdefault

◆ operator=() [2/2]

constexpr BashVersion & BashVersion::operator= ( const BashVersion )
constexprdefault

◆ operator==()

constexpr bool BashVersion::operator== ( const BashVersion other) const
inlineconstexpr

◆ operator>()

constexpr bool BashVersion::operator> ( const BashVersion other) const
inlineconstexpr

◆ operator>=()

constexpr bool BashVersion::operator>= ( const BashVersion other) const
inlineconstexpr

◆ to_string()

constexpr std::string BashVersion::to_string ( ) const
inlineconstexpr

Member Data Documentation

◆ major

uint16_t BashVersion::major = 5

◆ minor

uint16_t BashVersion::minor = 2

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