diff --git a/src/lib/ebus/symbol.h b/src/lib/ebus/symbol.h index f414da66..0c88e31d 100644 --- a/src/lib/ebus/symbol.h +++ b/src/lib/ebus/symbol.h @@ -170,6 +170,18 @@ class SymbolString { return m_data[index]; } + /** + * Return a reference to the symbol at the specified index. + * @param index the index of the symbol to return. + * @return the reference to the symbol at the specified index, or SYN if not available. + */ + symbol_t operator[](const size_t index) const { + if (index >= m_data.size()) { + return SYN; + } + return m_data[index]; + } + /** * Return whether this instance is equal to the other instance. * @param other the other instance.