libXpertMass Developer Documentation
  • libXpertMass
  • IntProp
  • IntProp Class

    class MsXpS::libXpertMass::IntProp

    The IntProp class is the specialized class for properties that hold data in the form of integer values. More...

    Header: #include <IntProp>
    Inherits: MsXpS::libXpertMass::Prop

    Public Functions

    IntProp(const QString &name = QString(), int data = 0)
    IntProp(const IntProp &other)
    virtual ~IntProp()
    virtual IntProp &operator=(const IntProp &other)

    Reimplemented Public Functions

    virtual IntProp *cloneOut() const override
    virtual void deleteData() override
    virtual QString *formatXmlElement(int offset, const QString &indent = QString(" ")) override
    virtual bool renderXmlElement(const QDomElement &element, int version = 1) override

    Detailed Description

    A IntProp property is a simple property in which the data is a pointer to an allocated integer.

    Member Function Documentation

    IntProp::IntProp(const QString &name = QString(), int data = 0)

    Constructs a IntProp instance.

    The integer passed as data is used to dynamically allocate a new integer with the same contents and then is set to the member mpa_data pointer.

    IntProp::IntProp(const IntProp &other)

    Constructs a IntProp instance as a copy of other.

    [virtual noexcept] IntProp::~IntProp()

    Destructs this IntProp instance.

    Deletion of the data is delegated to deleteData().

    [override virtual] IntProp *IntProp::cloneOut() const

    Duplicates this IntProp instance and returns a pointer to it.

    [override virtual] void IntProp::deleteData()

    Deletes the member data.

    [override virtual] QString *IntProp::formatXmlElement(int offset, const QString &indent = QString(" "))

    Formats a string suitable to use as an XML element.

    Formats a string suitable to be used as an XML element. Typical integer property elements that might be generated in this function look like this:

    <prop>
    <name>IONIZATION_LEVEL</name>
    <data>5</data>
    </prop>

    offset times the indent string must be used as a lead in the formatting of elements.

    Returns a dynamically allocated string that needs to be freed after use.

    [override virtual] bool IntProp::renderXmlElement(const QDomElement &element, int version = 1)

    Parses a integer property XML element using a versioned function.

    Parses the integer property XML element passed as argument and for each encountered data (name and data) will set the data to this IntProp instance (this is called XML rendering).

    Returns true if parsing was successful, false otherwise.)

    [virtual] IntProp &IntProp::operator=(const IntProp &other)

    Assigns other to this IntProp instance.

    Returns a reference to this IntProp instance.