Final class containing all the data coming from a LHA file.
More...
#include <lhaData.h>
|
|
| LHAFileData ()=default |
| | Default constructor.
|
| |
|
| ~LHAFileData ()=default |
| | Default destructor.
|
| |
| size_t | findBlock (std::string_view nameBlock) const |
| | Searches a block of a given type and returns it if found. More...
|
| |
| void | addBlock (std::string_view nameBlock) |
| | Adds a block to the data if it does not already exist. More...
|
| |
| template<class ... Args> |
| void | addElement (std::string_view nameBlock, Args &&...args) |
| | Adds an element (LHAElement) to a block (LHABlock). More...
|
| |
| std::vector< FloatType > | getValues (std::string_view nameBlock) const |
| | Returns all the values of a given block, in order. More...
|
| |
| std::optional< FloatType > | getValue (std::string_view nameBlock, size_t id) const |
| | Returns the value in a given block for a given id. More...
|
| |
| std::optional< FloatType > | getValue (std::string_view nameBlock, size_t i, size_t j) const |
| | Returns the value in a given block for a given id. More...
|
| |
|
|
static constexpr size_t | npos = -1 |
| |
|
|
std::vector< LHABlock > | blocks |
| | Vector of blocks representing the .lha file.
|
| |
Final class containing all the data coming from a LHA file.
This object is composed of a set of blocks (see LHABlock), each one containing a set of elements (see LHAElement).
◆ addBlock()
| void mty::lha::LHAFileData::addBlock |
( |
std::string_view |
nameBlock | ) |
|
Adds a block to the data if it does not already exist.
- Parameters
-
| nameBlock | Name of the block to create. |
◆ addElement()
template<class ... Args>
| void mty::lha::LHAFileData::addElement |
( |
std::string_view |
nameBlock, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
Adds an element (LHAElement) to a block (LHABlock).
- Template Parameters
-
- Parameters
-
- Note
- If the block does not exists, it is created and the element is added directly after.
◆ findBlock()
| size_t mty::lha::LHAFileData::findBlock |
( |
std::string_view |
nameBlock | ) |
const |
Searches a block of a given type and returns it if found.
- Parameters
-
| nameBlock | Name of the block type. |
- Returns
- The position of the block of type named nameBlock if found.
-
LHAFileData::npos else.
- See also
- BlockName, blockType()
◆ getValue() [1/2]
| std::optional< FloatType > mty::lha::LHAFileData::getValue |
( |
std::string_view |
nameBlock, |
|
|
size_t |
id |
|
) |
| const |
Returns the value in a given block for a given id.
- Parameters
-
| nameBlock | Name of the block. |
| id | Id of the element to get. |
- Returns
- The element in the block nameBlock with id id if it exists.
-
std::nullopt else.
◆ getValue() [2/2]
| std::optional< FloatType > mty::lha::LHAFileData::getValue |
( |
std::string_view |
nameBlock, |
|
|
size_t |
i, |
|
|
size_t |
j |
|
) |
| const |
Returns the value in a given block for a given id.
- Parameters
-
| nameBlock | Name of the block. |
| i | Row number for matrix element. |
| j | Column number for matrix element. |
- Returns
- The element in the block nameBlock with id id if it exists.
-
std::nullopt else.
◆ getValues()
| std::vector< FloatType > mty::lha::LHAFileData::getValues |
( |
std::string_view |
nameBlock | ) |
const |
Returns all the values of a given block, in order.
- Parameters
-
| nameBlock | Name of the block to get. |
- Returns
- All the values of the block if it exists.
-
An empty vector else.
The documentation for this class was generated from the following files: