Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_umod_configfile Class Reference

This class represents the file unimod.xml. More...

#include <ms_umod_configfile.hpp>

Inheritance diagram for ms_umod_configfile:
Collaboration diagram for ms_umod_configfile:

Public Types

enum  MODFILE_FLAGS {
  MODFILE_FLAGS_EMPTY = 0x00000000 ,
  MODFILE_FLAGS_REGULAR = 0x00000001 ,
  MODFILE_FLAGS_HIDDEN = 0x00000002 ,
  MODFILE_FLAGS_AASUBST = 0x00000004 ,
  MODFILE_FLAGS_ALL = 0x7FFFFFFF
}
 Flags for the type of modifications to retrieve. More...
 

Public Member Functions

 ms_umod_configfile ()
 Default constructor.
 
 ms_umod_configfile (const char *fileName, const char *schemaFileName, const ms_connection_settings *cs=0, bool useSchema=true)
 Immediate action constructor that reads the XML file with the given name.
 
 ms_umod_configfile (const ms_umod_configfile &right)
 Copying constructor.
 
virtual ~ms_umod_configfile ()
 Desctructor.
 
void appendAminoAcid (const ms_umod_aminoacid *aa)
 Adds a new amino acid at the end of the list.
 
void appendElement (const ms_umod_element *elem)
 Adds a new element at the end of the list.
 
void appendErrors (const ms_errors &src)
 Copies all errors from another instance and appends them at the end of own list.
 
void appendModBrick (const ms_umod_modbrick *brick)
 Adds a new modification brick at the end of the list.
 
void appendModification (const ms_umod_modification *mod)
 Adds a new modification at the end of the list.
 
void applyVisibility (const ms_session *session)
 If visibility settings are present for this file and session then apply to the currently loaded list of modifications.
 
void applyVisibility (const std::vector< int > &groupIds)
 If visibility settings are present for this file and these group ids, then apply to the currently loaded list of modifications.
 
void clearAllErrors ()
 Remove all errors from the current list of errors.
 
void clearAminoAcids ()
 Deletes all amino acids from the list.
 
void clearElements ()
 Deletes all elements from the list.
 
void clearModBricks ()
 Deletes all modification bricks from the list.
 
void clearModifications ()
 Deletes all modifications from the list.
 
void copyFrom (const ms_errors *right)
 Use this member to make a copy of another instance.
 
void copyFrom (const ms_umod_configfile *right)
 Copies all the information from another instance.
 
virtual void defaultValues ()
 Re-initialises the instance.
 
bool deleteAminoAcidByName (const char *name)
 Remove an amino acid from the list in memory.
 
bool deleteAminoAcidByNumber (const int idx)
 Remove an amino acid from the list in memory.
 
bool deleteElementByName (const char *name)
 Remove an element from the list in memory.
 
bool deleteElementByNumber (const int idx)
 Remove an element from the list in memory.
 
bool deleteModBrickByName (const char *name)
 Remove a modification brick from the list in memory.
 
bool deleteModBrickByNumber (const int idx)
 Remove a modification brick from the list in memory.
 
bool deleteModificationByName (const char *name)
 Remove a modification from the list in memory.
 
bool deleteModificationByNumber (const int idx)
 Remove a modification from the list in memory.
 
int findModFileName (const char *modFileName) const
 Returns modification index by its mod_file-style name (like "Acetyl (K)").
 
int findModification (const char *modName) const
 Retrieves modification index by its plain name.
 
const ms_umod_aminoacidgetAminoAcidByName (const char *name) const
 Returns an amino acid object by its name or NULL in case of not found.
 
const ms_umod_aminoacidgetAminoAcidByNumber (const int idx) const
 Returns an amino acid object by its number.
 
ms_connection_settings getConnectionSettings () const
 Returns the sessionID and proxy server for use with an HTTP transfer.
 
const ms_umod_elementgetElementByName (const char *name) const
 Returns an element object by its name or NULL in case of not found.
 
const ms_umod_elementgetElementByNumber (const int idx) const
 Returns an element object by its number.
 
const ms_errsgetErrorHandler () const
 Retrive the error object using this function to get access to all errors and error parameters.
 
std::string getFileName () const
 Returns the current file name.
 
int getLastError () const
 Return the error description of the last error that occurred.
 
std::string getLastErrorString () const
 Return the error description of the last error that occurred.
 
std::string getMajorVersion () const
 Returns major document schema version as read from the file, otherwise the latest.
 
std::string getMinorVersion () const
 Returns minor document schema version as read from the file, otherwise the latest.
 
const ms_umod_modbrickgetModBrickByName (const char *name) const
 Returns a modification brick object by its name or NULL in case of not found.
 
const ms_umod_modbrickgetModBrickByNumber (const int idx) const
 Returns an modification brick object by its number.
 
std::vector< std::string > getModFileList (const unsigned int flags=MODFILE_FLAGS_ALL) const
 Returns an ordered list of modification names in mod_file-style, i.e. "Acetyl (K)" instead of "Acetyl".
 
const ms_umod_modificationgetModificationByName (const char *name) const
 Returns a modification object by its name or NULL in case of not found.
 
const ms_umod_modificationgetModificationByNumber (const int idx) const
 Returns a modification object by its number.
 
int getNumberOfAminoAcids () const
 Returns a number of amino acids currently held in memory.
 
int getNumberOfElements () const
 Returns a number of elements currently held in memory.
 
int getNumberOfModBricks () const
 Returns a number of modification bricks currently held in memory.
 
int getNumberOfModifications () const
 Returns a number of modifications currently held in memory.
 
std::string getSchemaFileName () const
 Returns the current schema file name that is used to validate the XML file.
 
bool isValid () const
 Call this function to determine if there have been any errors.
 
ms_umod_configfileoperator= (const ms_umod_configfile &right)
 Assignment operator for C++ applications.
 
void read_buffer (const char *buffer)
 Reads configuration information from a string buffer.
 
void read_file ()
 Reads configuration information from the XML file.
 
std::string save_buffer (bool validateAgainstSchema=true)
 Creates a string representation of the XML document with all the content of the object.
 
void save_file ()
 Saves configuration information in the XML file (not mod_file).
 
void setConnectionSettings (const ms_connection_settings &cs)
 Sets the sessionID and proxy server for use with an HTTP transfer.
 
void setFileName (const char *filename)
 Changes the file name for subsequent read/write operations (do not use it for saving in a mod_file!).
 
void setMajorVersion (const std::string &version)
 Update the major document schema version.
 
void setMinorVersion (const std::string &version)
 Update the minor document schema version.
 
void setSchemaFileName (const char *name)
 Call this member to specify a custom schema file name for validating the XML file.
 
bool updateAminoAcidByName (const char *name, const ms_umod_aminoacid *aa)
 Update the information for a specific amino acid.
 
bool updateAminoAcidByNumber (const int idx, const ms_umod_aminoacid *aa)
 Update the information for a specific amino acid.
 
bool updateElementByName (const char *name, const ms_umod_element *element)
 Update the information for a specific element.
 
bool updateElementByNumber (const int idx, const ms_umod_element *element)
 Update the information for a specific element.
 
void updateMasses ()
 Recalculates all masses derived from elements (brick masses, modification deltas etc.).
 
bool updateModBrickByName (const char *name, const ms_umod_modbrick *brick)
 Update the information for a specific modification brick.
 
bool updateModBrickByNumber (const int idx, const ms_umod_modbrick *brick)
 Update the information for a specific modification brick.
 
bool updateModificationByName (const char *name, const ms_umod_modification *mod)
 Update the information for a specific modification.
 
bool updateModificationByNumber (const int idx, const ms_umod_modification *mod)
 Update the information for a specific modification.
 
std::string validateDocument () const
 Validates the whole document against schema and returns errors as a string.
 

Static Public Member Functions

static std::string getDefaultSchemaFileName ()
 Returns the default schema filename (no path)
 

Detailed Description

This class represents the file unimod.xml.

The Unimod file comprises chemical elements, amino-acids and modifications. The file can be created from scratch, read from a disk file or retrieved from a remote location (HTTP) and then saved as a mod_file or another unimod.xml.

After reading a file and before using the object check validity by calling isValid() and retrieve error descriptions with getLastErrorString() if not valid. Similarly, after writing out the file, isValid() can be used to check if the file has been created correctly and is valid for further use.

Member Enumeration Documentation

◆ MODFILE_FLAGS

Flags for the type of modifications to retrieve.

See Using enumerated values and static const ints in Perl, Java, Python and C#.

The result of combining these flags is a union of modifications sets.

Enumerator
MODFILE_FLAGS_EMPTY 

Default behaviour (regular modifications only).

MODFILE_FLAGS_REGULAR 

Non-hidden modifications which are not AA-substitutions.

MODFILE_FLAGS_HIDDEN 

Hidden modifications which are not AA-substitutions.

MODFILE_FLAGS_AASUBST 

AA substitutions.

MODFILE_FLAGS_ALL 

Get all modifications.

Constructor & Destructor Documentation

◆ ms_umod_configfile() [1/2]

ms_umod_configfile ( const char *  fileName,
const char *  schemaFileName,
const ms_connection_settings cs = 0,
bool  useSchema = true 
)

Immediate action constructor that reads the XML file with the given name.

An instance of this class is normally created using this form of the constructor.

Parameters
fileNamerepresents either local file name (for example, "C:/unimod.xml") or a fully formed URL such as http://www.matrixscience.com/cgi . The filename may use backslashes or forward slashes on Windows and spaces in file or directory names are allowed.
schemaFileNameis a local file name for the schema (for example, "C:/unimod_2.xsd"). The schema must be a local file – it cannot be accessed using HTTP. The schema filename may use backslashes or forward slashes on Windows and spaces in file or directory names are allowed.
csa connection settings object for downloading the file from a Mascot server. This should contain a sessionID and optionally the proxy server settings. For a local file cs is not required and will be ignored.
useSchemaspecify whether it should use a xsd schema validator, true by default

◆ ms_umod_configfile() [2/2]

Copying constructor.

Parameters
srcanother instance of this class to copy the content from.

Member Function Documentation

◆ appendAminoAcid()

void appendAminoAcid ( const ms_umod_aminoacid aa)

Adds a new amino acid at the end of the list.

Creates a new amino acid object, copies all content from the object supplied as a parameter and adds it at the end of the amino acids list.

Parameters
aaan instance of the amino acid object to copy content from.

◆ appendElement()

void appendElement ( const ms_umod_element elem)

Adds a new element at the end of the list.

Creates a new element object, copies all content from the object supplied as a parameter and adds it at the end of the elements list.

Parameters
eleman instance of the element object to copy content from.

◆ appendErrors()

void appendErrors ( const ms_errors src)
inherited

Copies all errors from another instance and appends them at the end of own list.

Parameters
srcThe object to copy the errors across from. See Maintaining object references: two rules of thumb.

◆ appendModBrick()

void appendModBrick ( const ms_umod_modbrick brick)

Adds a new modification brick at the end of the list.

Creates a new modification brick object, copies all content from the object supplied as a parameter and adds it at the end of the modification bricks list.

Parameters
brickan instance of the modification brick object to copy content from.

◆ appendModification()

void appendModification ( const ms_umod_modification mod)

Adds a new modification at the end of the list.

Creates a new modification object, copies all content from the object supplied as a parameter and adds it at the end of the modifications list.

Parameters
modan instance of the modification object to copy content from.

◆ applyVisibility() [1/2]

void applyVisibility ( const ms_session session)

If visibility settings are present for this file and session then apply to the currently loaded list of modifications.

If visibility settings are present for this file and session then apply to the currently loaded list of modifications.

Parameters
sessionOptional session object used to apply user security restrictions. Can be NULL or not supplied.

◆ applyVisibility() [2/2]

void applyVisibility ( const std::vector< int > &  groupIds)

If visibility settings are present for this file and these group ids, then apply to the currently loaded list of modifications.

If visibility settings are present for this file and group ids then apply to the currently loaded list of modifications.

Parameters
groupIdsvector of group ids to apply visibility for

◆ clearAllErrors()

void clearAllErrors ( )
inherited

Remove all errors from the current list of errors.

The list of 'errors' can include fatal errors, warning messages, information messages and different levels of debugging messages.

All messages are accumulated into a list in this object, until clearAllErrors() is called.

See Error Handling.

See also
isValid(), getLastError(), getLastErrorString(), getErrorHandler()
Examples
common_error.cpp, resfile_error.cpp, and resfile_summary.cpp.

◆ copyFrom() [1/2]

void copyFrom ( const ms_errors right)
inherited

Use this member to make a copy of another instance.

Parameters
rightis the source to initialise from

◆ copyFrom() [2/2]

void copyFrom ( const ms_umod_configfile right)

Copies all the information from another instance.

Parameters
rightanother instance of this class to copy the content from.

◆ defaultValues()

void defaultValues ( )
virtual

Re-initialises the instance.

After calling this method, all internal values will be reset to their defaults, as if the object had been freshly created with the default constructor.

This method, however, doesn't change file name, schema location and connection settings. If a complete cleanup is required, you need to do three additional calls:

   umod_configfile.setFileName(""); 
   umod_configfile.setSchemaFileName("");
   umod_configfile.setConnectionSetting(ms_connection_settings());

◆ deleteAminoAcidByName()

bool deleteAminoAcidByName ( const char *  name)

Remove an amino acid from the list in memory.

Parameters
namename of the amino acid for deletion.
Returns
TRUE if the amino acid has been found and successfully deleted and FALSE otherwise.

◆ deleteAminoAcidByNumber()

bool deleteAminoAcidByNumber ( const int  idx)

Remove an amino acid from the list in memory.

Parameters
idxnumber of the amino acid for deletion from 0 to (getNumberOfAminoAcids() - 1).
Returns
TRUE if the amino acid has been found and successfully deleted and FALSE otherwise.

◆ deleteElementByName()

bool deleteElementByName ( const char *  name)

Remove an element from the list in memory.

Parameters
namename of the element for deletion.
Returns
TRUE if the element has been found and successfully deleted and FALSE otherwise.

◆ deleteElementByNumber()

bool deleteElementByNumber ( const int  idx)

Remove an element from the list in memory.

Parameters
idxnumber of the element for deletion from 0 to (getNumberOfElements() - 1).
Returns
TRUE if the element has been found and successfully deleted and FALSE otherwise.

◆ deleteModBrickByName()

bool deleteModBrickByName ( const char *  name)

Remove a modification brick from the list in memory.

Parameters
namename of the modification brick for deletion.
Returns
TRUE if the modification brick has been found and successfully deleted and FALSE otherwise.

◆ deleteModBrickByNumber()

bool deleteModBrickByNumber ( const int  idx)

Remove a modification brick from the list in memory.

Parameters
idxnumber of the modification brick for deletion from 0 to (getNumberOfModBricks() - 1).
Returns
TRUE if the modification brick has been found and successfully deleted and FALSE otherwise.

◆ deleteModificationByName()

bool deleteModificationByName ( const char *  name)

Remove a modification from the list in memory.

Parameters
namename of the modification for deletion.
Returns
TRUE if the modification has been found and successfully deleted and FALSE otherwise.

◆ deleteModificationByNumber()

bool deleteModificationByNumber ( const int  idx)

Remove a modification from the list in memory.

Parameters
idxnumber of the modification for deletion from 0 to (getNumberOfModifications() - 1).
Returns
TRUE if the modification has been found and successfully deleted and FALSE otherwise.

◆ findModFileName()

int findModFileName ( const char *  modFileName) const

Returns modification index by its mod_file-style name (like "Acetyl (K)").

Parameters
modFileNamemodification string name.
Returns
modification zero-based index or -1 (if not found).

◆ findModification()

int findModification ( const char *  modName) const

Retrieves modification index by its plain name.

Tries to find modification by its name (not mod_file-style name).

Parameters
modNamemodification string name.
Returns
modification zero-based index if the modification is found and -1 otherwise.

◆ getAminoAcidByName()

const ms_umod_aminoacid * getAminoAcidByName ( const char *  name) const

Returns an amino acid object by its name or NULL in case of not found.

Parameters
namea unique name of the amino acid.
Returns
a read-only pointer to an amino acid object. See Maintaining object references: two rules of thumb.

◆ getAminoAcidByNumber()

const ms_umod_aminoacid * getAminoAcidByNumber ( const int  idx) const

Returns an amino acid object by its number.

Parameters
idxnumber of the amino acid from 0 to (getNumberOfAminoAcids() - 1).
Returns
a read-only pointer to an amino acid object.

◆ getDefaultSchemaFileName()

std::string getDefaultSchemaFileName ( )
static

Returns the default schema filename (no path)

Static method to return the filename of the currently used schema

Returns
Returns "unimod_2.xsd" (at version 2.6.1)

◆ getElementByName()

const ms_umod_element * getElementByName ( const char *  name) const

Returns an element object by its name or NULL in case of not found.

Parameters
namea unique name of the element.
Returns
a read-only pointer to an element object. See Maintaining object references: two rules of thumb.

◆ getElementByNumber()

const ms_umod_element * getElementByNumber ( const int  idx) const

Returns an element object by its number.

Parameters
idxnumber of the element from 0 to (getNumberOfElements() - 1).
Returns
a read-only pointer to an element object. See Maintaining object references: two rules of thumb.

◆ getErrorHandler()

const ms_errs * getErrorHandler ( ) const
inherited

Retrive the error object using this function to get access to all errors and error parameters.

See Error Handling.

Returns
Constant pointer to the error handler
See also
isValid(), getLastError(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Examples
common_error.cpp, and http_helper_getstring.cpp.

◆ getFileName()

std::string getFileName ( ) const

Returns the current file name.

Returns
currently set file location (not necessarily the location from which the current content has been read).

◆ getLastError()

int getLastError ( ) const
inherited

Return the error description of the last error that occurred.

All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.

See Error Handling.

See also
isValid(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Returns
the error number of the last error, or 0 if there have been no errors.

◆ getLastErrorString()

std::string getLastErrorString ( ) const
inherited

Return the error description of the last error that occurred.

All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.

Returns
Most recent error, warning, information or debug message

See Error Handling.

See also
isValid(), getLastError(), clearAllErrors(), getErrorHandler()
Examples
common_error.cpp, config_enzymes.cpp, config_fragrules.cpp, config_license.cpp, config_mascotdat.cpp, config_masses.cpp, config_modfile.cpp, config_procs.cpp, config_quantitation.cpp, config_taxonomy.cpp, http_helper_getstring.cpp, and tools_aahelper.cpp.

◆ getModBrickByName()

const ms_umod_modbrick * getModBrickByName ( const char *  name) const

Returns a modification brick object by its name or NULL in case of not found.

Parameters
namea unique name of the modification brick.
Returns
a read-only pointer to a modification brick object. See Maintaining object references: two rules of thumb.

◆ getModBrickByNumber()

const ms_umod_modbrick * getModBrickByNumber ( const int  idx) const

Returns an modification brick object by its number.

Parameters
idxnumber of the modification brick from 0 to (getNumberOfModBricks() - 1).
Returns
a read-only pointer to a modification brick object.

◆ getModFileList()

std::vector< std::string > getModFileList ( const unsigned int  flags = MODFILE_FLAGS_ALL) const

Returns an ordered list of modification names in mod_file-style, i.e. "Acetyl (K)" instead of "Acetyl".

Parameters
flagscan be one or more of the ms_umod_configfile::MODFILE_FLAGS values OR'ed together.
Returns
an ordered modification names list.

◆ getModificationByName()

const ms_umod_modification * getModificationByName ( const char *  name) const

Returns a modification object by its name or NULL in case of not found.

Parameters
namea unique name of the modification.
Returns
a read-only pointer to a modification object. See Maintaining object references: two rules of thumb.

◆ getModificationByNumber()

const ms_umod_modification * getModificationByNumber ( const int  idx) const

Returns a modification object by its number.

Parameters
idxnumber of the modification from 0 to (getNumberOfModifications() - 1).
Returns
a read-only pointer to a modification-object. See Maintaining object references: two rules of thumb.

◆ getNumberOfAminoAcids()

int getNumberOfAminoAcids ( ) const

Returns a number of amino acids currently held in memory.

Returns
total number of amino acids in the configuration file.

◆ getNumberOfElements()

int getNumberOfElements ( ) const

Returns a number of elements currently held in memory.

Returns
total number of elements in the configuration file.

◆ getNumberOfModBricks()

int getNumberOfModBricks ( ) const

Returns a number of modification bricks currently held in memory.

Returns
total number of modification bricks in the configuration file.

◆ getNumberOfModifications()

int getNumberOfModifications ( ) const

Returns a number of modifications currently held in memory.

Returns
total number of modifications in the configuration file.

◆ getSchemaFileName()

std::string getSchemaFileName ( ) const

Returns the current schema file name that is used to validate the XML file.

Returns
currently set file location (not necessarily the location from which the current content has been read).

◆ isValid()

bool isValid ( ) const
inherited

◆ operator=()

ms_umod_configfile & operator= ( const ms_umod_configfile right)

Assignment operator for C++ applications.

Parameters
rightanother instance of this class to copy the content from.
Returns
reference to the current object

◆ read_buffer()

void read_buffer ( const char *  buffer)

Reads configuration information from a string buffer.

This method is useful when reading configuration information from a mascor result file. Old content of the object will be removed and substituted with the information read from the buffer.

Parameters
bufferstring buffer that contains a valid xml-document. It can be a document with just one modification in it, or only with amino acid masses.

◆ read_file()

void read_file ( )

Reads configuration information from the XML file.

Downloads the file if necessary from the Unimod web site and parses it. Check for errors before using any other methods for retrieving content.

◆ save_buffer()

std::string save_buffer ( bool  validateAgainstSchema = true)

Creates a string representation of the XML document with all the content of the object.

Creates a valid XML document and returns it as a string which can be used, for example, for writing out configuration information to mascot result file.

To produce a 'file' that validates against the schema, it is not sufficient to add, for example, just a modification because this will be missing keyrefs to elements and termini building 'bricks'.

If you choose not to validate against the schema, then it is sufficient to just output, say, a single modification.

Parameters
validateAgainstSchemaspecifies whether to validate against the schema. If true and the schema file exists and the resulting XML fails to validate, then an empty string will be returned and the errors will indicate why it failed to validate.
Returns
XML document with the object content.

◆ save_file()

void save_file ( )

Saves configuration information in the XML file (not mod_file).

Check for errors after calling this method to see if the operation has been successful or to get any schema validation errors. If the document is not valid it is going to be saved anyway unless there are other problems.

If you want to validate document without actually saving it use validateDocument().

◆ setConnectionSettings()

void setConnectionSettings ( const ms_connection_settings cs)

Sets the sessionID and proxy server for use with an HTTP transfer.

This value would normally be passed in the constructor.

Parameters
csis the new connection settings.

◆ setFileName()

void setFileName ( const char *  name)

Changes the file name for subsequent read/write operations (do not use it for saving in a mod_file!).

Calling this method does not mean an immediate update on disk. Use either read_file() or save_file() for that.

Parameters
namea new file location.

◆ setSchemaFileName()

void setSchemaFileName ( const char *  name)

Call this member to specify a custom schema file name for validating the XML file.

Parameters
namea new file location (if empty default value will be assigned).

◆ updateAminoAcidByName()

bool updateAminoAcidByName ( const char *  name,
const ms_umod_aminoacid aa 
)

Update the information for a specific amino acid.

Parameters
namename of the amino acid for updating.
aaan object to copy the content from.
Returns
TRUE if the amino acid has been found and successfully updated and FALSE otherwise.

◆ updateAminoAcidByNumber()

bool updateAminoAcidByNumber ( const int  idx,
const ms_umod_aminoacid aa 
)

Update the information for a specific amino acid.

Parameters
idxnumber of the amino acid for updating from 0 to (getNumberOfAminoAcids() - 1).
aaan object to copy the content from.
Returns
TRUE if the amino acid has been found and successfully updated and FALSE otherwise.

◆ updateElementByName()

bool updateElementByName ( const char *  name,
const ms_umod_element element 
)

Update the information for a specific element.

Parameters
namename of the element for updating.
elementan object to copy the content from.
Returns
TRUE if the element has been found and successfully updated and FALSE otherwise.

◆ updateElementByNumber()

bool updateElementByNumber ( const int  idx,
const ms_umod_element element 
)

Update the information for a specific element.

Parameters
idxnumber of the element for updating from 0 to (getNumberOfElements() - 1).
elementan object to copy the content from.
Returns
TRUE if the element has been found and successfully updated and FALSE otherwise.

◆ updateModBrickByName()

bool updateModBrickByName ( const char *  name,
const ms_umod_modbrick brick 
)

Update the information for a specific modification brick.

Parameters
namename of the modification brick for updating.
brickan object to copy the content from.
Returns
TRUE if the modification brick has been found and successfully updated and FALSE otherwise.

◆ updateModBrickByNumber()

bool updateModBrickByNumber ( const int  idx,
const ms_umod_modbrick brick 
)

Update the information for a specific modification brick.

Parameters
idxnumber of the modification brick for updating from 0 to (getNumberOfModBricks() - 1).
brickan object to copy the content from.
Returns
TRUE if the modification brick has been found and successfully updated and FALSE otherwise.

◆ updateModificationByName()

bool updateModificationByName ( const char *  name,
const ms_umod_modification mod 
)

Update the information for a specific modification.

Parameters
namename of the modification for updating.
modan object to copy the content from.
Returns
TRUE if the modification has been found and successfully updated and FALSE otherwise.

◆ updateModificationByNumber()

bool updateModificationByNumber ( const int  idx,
const ms_umod_modification mod 
)

Update the information for a specific modification.

Parameters
idxnumber of the modification for updating from 0 to (getNumberOfModifications() - 1).
modan object to copy the content from.
Returns
TRUE if the modification has been found and successfully updated and FALSE otherwise.

◆ validateDocument()

std::string validateDocument ( ) const

Validates the whole document against schema and returns errors as a string.

This method doesn't attempt to store the document anywhere and doesn't make the object invalid. Also, no errors are stored. Therefore, this method can be called as many times as necessary without any consequences.

All validation errors will be returned back as a string. However, the XML parser will describe errors in terms of row and column numbers as if the document was actually saved in a file.

Returns
validation errors as a string or an empty string if there are no errors detected.

The documentation for this class was generated from the following files: