Represents an element
object in unimod.xml
.
More...
#include <ms_umod_element.hpp>
Inherits ms_xml_IValidatable.
Public Member Functions | |
ms_umod_element () | |
Default constructor. | |
ms_umod_element (const ms_umod_element &src) | |
Copying constructor. | |
virtual | ~ms_umod_element () |
Destructor. | |
void | copyFrom (const ms_umod_element *right) |
Copies all content from another instance. | |
void | defaultValues () |
Call this member if you want to start again. | |
void | dropAvgeMass () |
Delete the avge_mass attribute. | |
void | dropFullName () |
Delete the full_name attribute. | |
void | dropMonoMass () |
Delete the mono_mass attribute. | |
void | dropTitle () |
Delete the title attribute. | |
std::string | getAvgeMass () const |
Returns the value of the avge_mass attribute as a string. | |
double | getAvgeMassAsNumber () const |
Returns the value of the avge_mass attribute as a floating point number. | |
std::string | getAvgeMassSchemaType () const |
Obtain a symbolic name for the avge_mass attribute schema type. | |
std::string | getFullName () const |
Returns the value of the full_name attribute. | |
std::string | getFullNameSchemaType () const |
Obtain a symbolic name for the full_name attribute schema type. | |
std::string | getMonoMass () const |
Returns the value of the mono_mass attribute as a string. | |
double | getMonoMassAsNumber () const |
Returns the value of the mono_mass attribute as a floating point number. | |
std::string | getMonoMassSchemaType () const |
Obtain a symbolic name for the mono_mass attribute schema type. | |
virtual std::string | getSchemaType () const |
Returns name of the schema type that can be used to validate this element. | |
std::string | getTitle () const |
Returns the value of the title attribute. | |
std::string | getTitleSchemaType () const |
Obtain a symbolic name for the title attribute schema type. | |
bool | haveAvgeMass () const |
Indicates presence of the avge_mass attribute. | |
bool | haveFullName () const |
Indicates presence of the full_name attribute. | |
bool | haveMonoMass () const |
Indicates presence of the mono_mass attribute. | |
bool | haveTitle () const |
Indicates presence of the title attribute. | |
ms_umod_element & | operator= (const ms_umod_element &right) |
C++ style assignment operator. | |
bool | setAvgeMass (const char *value, ms_errs *err=NULL) |
Set a custom string value for the avge_mass attribute. | |
void | setFullName (const char *value) |
Set a custom value for the full_name attribute. | |
bool | setMonoMass (const char *value, ms_errs *err=NULL) |
Set a custom string value for the mono_mass attribute. | |
void | setTitle (const char *value) |
Set a custom value for the title attribute. | |
virtual std::string | validateDeep (const ms_xml_schema *pSchemaFileObj) const |
Performs validation of all child elements in addition to 'shallow' validation. | |
virtual std::string | validateShallow (const ms_xml_schema *pSchemaFileObj) const |
Performs simple validation of the top-level elements only. | |
Represents an element
object in unimod.xml
.
ms_umod_element | ( | ) |
Default constructor.
Assigns reasonable default values to all internal members.
ms_umod_element | ( | const ms_umod_element & | src | ) |
Copying constructor.
src | another instance of this class to copy the content from. |
void copyFrom | ( | const ms_umod_element * | right | ) |
Copies all content from another instance.
right | another instance of this class to copy the content from. |
void defaultValues | ( | ) |
Call this member if you want to start again.
After calling this method, internal values are reset to defaults, as if the object had been freshly created with the default constructor.
void dropAvgeMass | ( | ) |
Delete the avge_mass
attribute.
Deletes the attribute until is re-set.
void dropFullName | ( | ) |
Delete the full_name
attribute.
Deletes the attribute until is re-set.
void dropMonoMass | ( | ) |
Delete the mono_mass
attribute.
Deletes the attribute until is re-set.
void dropTitle | ( | ) |
Delete the title
attribute.
Deletes the attribute until is re-set.
std::string getAvgeMass | ( | ) | const |
Returns the value of the avge_mass
attribute as a string.
Average mass for the chemical element or an isotope.
double getAvgeMassAsNumber | ( | ) | const |
Returns the value of the avge_mass
attribute as a floating point number.
Average mass for the chemical element or an isotope.
std::string getAvgeMassSchemaType | ( | ) | const |
Obtain a symbolic name for the avge_mass
attribute schema type.
The obtained type name can be used to get a corresponding type description object from ms_xml_schema.
std::string getFullName | ( | ) | const |
Returns the value of the full_name
attribute.
A full name for the chemical element or an isotope (for example, 'Hydrogen').
std::string getFullNameSchemaType | ( | ) | const |
Obtain a symbolic name for the full_name
attribute schema type.
The obtained type name can be used to get a corresponding type description object from ms_xml_schema.
std::string getMonoMass | ( | ) | const |
Returns the value of the mono_mass
attribute as a string.
Monoisotopic mass for the chemical element or an isotope.
double getMonoMassAsNumber | ( | ) | const |
Returns the value of the mono_mass
attribute as a floating point number.
Monoisotopic mass for the chemical element or an isotope.
std::string getMonoMassSchemaType | ( | ) | const |
Obtain a symbolic name for the mono_mass
attribute schema type.
The obtained type name can be used to get a corresponding type description object from ms_xml_schema.
|
virtual |
Returns name of the schema type that can be used to validate this element.
Additional information about the current object can be retrieved from the associated XML schema file. Every element in an XML document is defined with a named type, which you can use to find out what kind of limits (numerical or otherwise) are defined for values of that type.
std::string getTitle | ( | ) | const |
Returns the value of the title
attribute.
A unique name for the chemical element or an isotope (for example, 'N15').
std::string getTitleSchemaType | ( | ) | const |
Obtain a symbolic name for the title
attribute schema type.
The obtained type name can be used to get a corresponding type description object from ms_xml_schema.
bool haveAvgeMass | ( | ) | const |
Indicates presence of the avge_mass
attribute.
bool haveFullName | ( | ) | const |
Indicates presence of the full_name
attribute.
bool haveMonoMass | ( | ) | const |
Indicates presence of the mono_mass
attribute.
bool haveTitle | ( | ) | const |
Indicates presence of the title
attribute.
ms_umod_element & operator= | ( | const ms_umod_element & | right | ) |
C++ style assignment operator.
right | another instance of this class to copy the content from. |
bool setAvgeMass | ( | const char * | value, |
ms_errs * | err = NULL |
||
) |
Set a custom string value for the avge_mass
attribute.
The method is trying to parse the string value as a floating point number first. It it fails it reports an error and returns FALSE leaving the old value unchanged.
value | a new string value for the attribute. |
err | an error object to return possible error messages. |
void setFullName | ( | const char * | value | ) |
Set a custom value for the full_name
attribute.
value | a new value for the attribute. |
bool setMonoMass | ( | const char * | value, |
ms_errs * | err = NULL |
||
) |
Set a custom string value for the mono_mass
attribute.
The method is trying to parse the string value as a floating point number first. It it fails it reports an error and returns FALSE leaving the old value unchanged.
value | a new string value for the attribute. |
err | an error object to return possible error messages. |
void setTitle | ( | const char * | value | ) |
Set a custom value for the title
attribute.
value | a new value for the attribute. |
|
virtual |
Performs validation of all child elements in addition to 'shallow' validation.
The current object can be checked against an XML schema. When using this method all possible checks are performed. However, this is not a substitute for the schema: some schema-defined constraint are not applied (unique fields, foreign keys etc.).
In order to make sure that current object is free from all syntax errors validate it as a part of the whole document.
pSchemaFileObj | a valid schema object instance to validate against. |
|
virtual |
Performs simple validation of the top-level elements only.
The current object can be checked against some basic constraints in a schema without looking at children element types. When using this method only the current object and children derived from standard types (for example, restrictions with enumerations) are checked. For more thorough validation, use validateDeep().
pSchemaFileObj | a valid schema object instance to validate against. |