| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassCore
- IsotopicDataUserConfigHandler

# MsXpS::libXpertMassCore::IsotopicDataUserConfigHandler Class

class MsXpS::libXpertMassCore::IsotopicDataUserConfigHandler

The IsotopicDataUserConfigHandler class handles user-defined IsotopicData. More...

Header: | `#include <MsXpS/libXpertMassCore/IsotopicDataUserConfigHandler.hpp>`
Inherits: | MsXpS::libXpertMassCore::IsotopicDataBaseHandler

- List of all members, including inherited members
- IsotopicDataUserConfigHandler is part of Polymer chemistry building blocks.

## Public Functions

| IsotopicDataUserConfigHandler(const QString &file_name = QString())
| IsotopicDataUserConfigHandler(MsXpS::libXpertMassCore::IsotopicDataSPtr isotopic_data_sp, const QString &file_name = QString())
virtual | ~IsotopicDataUserConfigHandler()
virtual qsizetype | loadData(const QString &file_name)

## Reimplemented Public Functions

virtual qsizetype | loadData() override
virtual qsizetype | writeData(const QString &file_name = QString()) override

## Reimplemented Protected Functions

virtual qsizetype | checkConsistency() override

## Detailed Description

The data can be loaded and written to file. The format of the data is based on Isotope::toString(), that outputs each Isotope data in a separate line.

Comments are allowed and are on lines that start with the '#' character. These lines are ignored when loading data.

See also IsotopicDataLibraryHandler, IsotopicDataManualConfigHandler, and Isotope::toString.

## Member Function Documentation

### `[explicit]` IsotopicDataUserConfigHandler::IsotopicDataUserConfigHandler(const QString &file_name = QString())

Constructs the IsotopicDataUserConfigHandler.

m_fileName is set to file_name

### IsotopicDataUserConfigHandler::IsotopicDataUserConfigHandler(MsXpS::libXpertMassCore::IsotopicDataSPtr isotopic_data_sp, const QString &file_name = QString())

Constructs the IsotopicDataUserConfigHandler.

The instance will have its isotopic data member pointing to isotopic_data_sp.

m_fileName is set to file_name

### `[virtual noexcept]` IsotopicDataUserConfigHandler::~IsotopicDataUserConfigHandler()

Destructs the IsotopicDataUserConfigHandler.

Nothing is explicitely deleted in the destructor.

### `[override virtual protected]` qsizetype IsotopicDataUserConfigHandler::checkConsistency()

Returns the size of the member IsotopicData.

### `[override virtual]` qsizetype IsotopicDataUserConfigHandler::loadData()

Loads isotopic data from the file pointed to by the member file name datum.

The format of the file consists in a single line of data per Isotope as created using the Isotope::toString() function. Each line is used to create an Isotope with the text-based constructor.

Returns the count of Isotopes created or 0 if the file does not exist or is not readable.

See also Isotope::Isotope.

### `[virtual]` qsizetype IsotopicDataUserConfigHandler::loadData(const QString &file_name)

Loads isotopic data from file_name.

If file_name is empty, 0 is returned.

The format of the file consists in a single line of data per Isotope as created using the Isotope::toString() function. Each line is used to create an Isotope with the text-based constructor.

Returns the count of Isotopes created or 0 if the file does not exist or is not readable.

See also Isotope::Isotope.

### `[override virtual]` qsizetype IsotopicDataUserConfigHandler::writeData(const QString &file_name = QString())

Writes isotopic data to file_name.

If file_name is empty, m_fileName is tried. If both are empty, the function returns 0. If any one of the file names are correct (file_name takes precedence over m_fileName), then m_fileName is set to that file name.

The format of the file consists in a single line of data per Isotope as created using the Isotope::toString() function. Each isotope is output to its own line.

Returns the count of Isotopes written to file or 0 if the file does not exist or is not readable.