Earth Observation Mission CFI Software FileHandlling Software User Manual |
Class for reading and writing XML files. More...
Public Member Functions | |
XmlFile () | |
Default constructor. | |
XmlFile (const std::string &fileNam) | |
Construct object and init parser. | |
~XmlFile () EXCEPT | |
Class destructor. | |
void | create () |
Create an XML tree in memory. | |
void | read (const std::string &fileNam) |
Read file from disk. | |
void | write () |
Write file to disk. | |
void | write (const std::string &fileNam) |
Write file to disk with different name. | |
void | clean () |
Clean memory. | |
void | root () |
Go to root element. | |
void | next () |
Go to next element. | |
void | nextSibling () |
Go to the next Sibling. | |
void | toElement (const std::string &element) |
Go to element. | |
void | toPath (const std::string &path) |
Go to path. | |
std::string | currentElementName () const |
Get current element name. | |
std::string | currentPathName () const |
Get current path name. | |
std::string | getElementValueAsString (const std::string &element) |
Read element value as a string. | |
long | getElementValueAsInt (const std::string &element) |
Read element value as an integer. | |
double | getElementValueAsReal (const std::string &element) |
Read element value as a real number. | |
std::vector< std::string > & | getElementArrayAsString (const std::string &element, std::vector< std::string > &outVector) |
Read array of values as strings. | |
std::vector< long > & | getElementArrayAsInt (const std::string &element, std::vector< long > &outVector) |
Read array of values as integers. | |
std::vector< double > & | getElementArrayAsReal (const std::string &element, std::vector< double > &outVector) |
Read array of values as real numbers. | |
std::string | getAttributeValueAsString (const std::string &element, const std::string &attribute) |
Read attribute value as a string. | |
long | getAttributeValueAsInt (const std::string &element, const std::string &attribute) |
Read attribute value as an integer. | |
double | getAttributeValueAsReal (const std::string &element, const std::string &attribute) |
Read attribute value as a real number. | |
std::string | getPathValueAsString (const std::string &path) |
Read path node value as a string. | |
long | getPathValueAsInt (const std::string &path) |
Read path node value as an integer. | |
double | getPathValueAsReal (const std::string &path) |
Read path node value as a real number. | |
std::vector< std::string > & | getPathArrayAsString (const std::string &node, std::vector< std::string > &outVector) |
Read string node array. | |
std::vector< long > & | getPathArrayAsInt (const std::string &node, std::vector< long > &outVector) |
Read integer node array. | |
std::vector< double > & | getPathArrayAsReal (const std::string &node, std::vector< double > &outVector) |
Read double node array. | |
void | createRoot (const std::string &element) |
Create root element. | |
void | addChild (const std::string &parent, const std::string &child) |
Add child element. | |
void | addNext (const std::string ¤t, const std::string &next) |
Append sibling element after current one. | |
void | addPrevious (const std::string ¤t, const std::string &previous) |
Insert sibling element before current one. | |
void | addAttribute (const std::string &element, const std::string &attribute) |
Add attribute. | |
void | copyNode (const std::string &destPath, const std::string &sourceXmlFile, const std::string &sourcePath) |
Copy a node of one XmlFile to parent node in this XmlFile. | |
void | removeNode (const std::string &path) |
Remove node. | |
void | setValue (const std::string &path, const std::string &value, const std::string &format) |
Set string node value with format. | |
void | setValue (const std::string &path, const long value, const std::string &format) |
Set integer node value with format. | |
void | setValue (const std::string &path, const double value, const std::string &format) |
Set real node value with format. | |
void | addChild (const std::string &parent, const std::string &child, const std::string &value, const std::string &format) |
Add a child element with a string value. | |
void | addChild (const std::string &parent, const std::string &hild, const long value, const std::string &format) |
Add a child element with an integer value. | |
void | addChild (const std::string &parent, const std::string &child, const double value, const std::string &format) |
Add a child element with a real value. | |
void | addNext (const std::string ¤t, const std::string &next, const std::string &value, const std::string &format) |
Append an element after the current one with a string value. | |
void | addNext (const std::string ¤t, const std::string &next, const long value, const std::string &format) |
Append an element after the current one with an integer value. | |
void | addNext (const std::string ¤t, const std::string &next, const double value, const std::string &format) |
Append an element after the current one with a real value. | |
void | addPrevious (const std::string ¤t, const std::string &previous, const std::string &value, const std::string &format) |
Insert an element before the current one with a string value. | |
void | addPrevious (const std::string ¤t, const std::string &previous, const long value, const std::string &format) |
Insert an element before the current one with an integer value. | |
void | addPrevious (const std::string ¤t, const std::string &previous, const double value, const std::string &format) |
Insert an element before the current one with a real value. | |
void | addAttribute (const std::string &element, const std::string &attribute, const std::string &value, const std::string &format) |
Add attribute with a string value to an element. | |
void | addAttribute (const std::string &element, const std::string &attribute, const long value, const std::string &format) |
Add attribute with an integer value to an element. | |
void | addAttribute (const std::string &element, const std::string &attribute, const double value, const std::string &format) |
Add attribute with a real value to an element. | |
std::string | findValueInElement (const std::string &element, const std::string &value) |
Find element with value. | |
std::string | findValueInPath (const std::string &path, const std::string &value) |
Find node with value. | |
void | createHeader (long fileExtensionType) |
Creates a blank header. | |
void | createHeader (FixedHeader &xmlHeader) |
Creates a fixed header with the input values. | |
std::string | createFileName (long satelliteId, const std::string &fileClass, const std::string &fileType, const std::string &instanceId, long fileExtensionType) const |
Generates a complete Cryosat file name. | |
FileNameItems | getFileNameItems (std::string &fileNam) const |
Retrieve items of created fileName. | |
void | setFixedHeaderItem (const std::string &itemName, const std::string &itemValue) |
Set an item in the fixed header. | |
void | setFixedHeaderItems (const std::string &fileNam, const std::string &fileDescription, const std::string ¬es, const std::string &mission, const std::string &fileClass, const std::string &filetype, const std::string &validityStart, const std::string &validityStop, const long fileVersion, const std::string &system, const std::string &creator, const std::string &creatorVersion, const std::string &creationDate) |
Set all items in the fixed header. | |
std::string | getFixedHeaderItem (const std::string &itemName) |
Get an item from the fixed header. | |
FixedHeader | getFixedHeader () |
Get fixed header data. | |
long | getId () const |
Get id. | |
std::string | getFileName () const |
Get fileName. | |
void | setSchema (const std::string &schemaName, bool setAll) |
Set schema name. | |
void | removeSchema (bool removeAll) |
Remove schema name. | |
std::vector< std::string > & | getStringValuesFromList (const std::string &listPath, const std::string &element, std::vector< std::string > &outVector) |
Read elements from a list. |
Class for reading and writing XML files.
This class is used for reading and writing XML files according to the Earth Explorer Mission File Format Guidelines
It relies on the EO_FILE_HANDLING CFI software and the GNOME libxml2 (http://xmlsoft.org)
In memory representation of the XML file is maintained in the form of a tree. Navigation through the tree is performed with the help of a pointer. The following methods can be used for moving the pointer:
The current position can be retrieved using the following methods:
Methods for creating nodes, reading and writing node values will move the pointer to the requested element if the execution is successful.
EECFI::XmlFile::XmlFile | ( | ) |
Default constructor.
EECFI::XmlFile::XmlFile | ( | const std::string & | fileNam | ) | [explicit] |
EECFI::XmlFile::~XmlFile | ( | ) |
Class destructor.
void EECFI::XmlFile::addAttribute | ( | const std::string & | element, | |
const std::string & | attribute | |||
) |
Add attribute.
element | XPath expression of element node to which the new attribute is added. | |
attribute | Attribute name. |
The tree pointer is set to the element that contains the attribute.
Referenced by addAttribute().
void EECFI::XmlFile::addAttribute | ( | const std::string & | element, | |
const std::string & | attribute, | |||
const std::string & | value, | |||
const std::string & | format | |||
) |
Add attribute with a string value to an element.
element | XPath expression of element node to which the new attribute is added. | |
attribute | Inserted attribute name. | |
value | Attribute value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to element that owns the attribute.
References addAttribute(), and setValue().
void EECFI::XmlFile::addAttribute | ( | const std::string & | element, | |
const std::string & | attribute, | |||
const long | value, | |||
const std::string & | format | |||
) |
Add attribute with an integer value to an element.
element | XPath expression of element node to which the new attribute is added. | |
attribute | Inserted attribute name. | |
value | Attribute value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to element that owns the attribute.
References addAttribute(), and setValue().
void EECFI::XmlFile::addAttribute | ( | const std::string & | element, | |
const std::string & | attribute, | |||
const double | value, | |||
const std::string & | format | |||
) |
Add attribute with a real value to an element.
element | XPath expression of element node to which the new attribute is added. | |
attribute | Inserted attribute name. | |
value | Attribute value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to element that owns the attribute.
References addAttribute(), and setValue().
void EECFI::XmlFile::addChild | ( | const std::string & | parent, | |
const std::string & | child, | |||
const std::string & | value, | |||
const std::string & | format | |||
) |
Add a child element with a string value.
parent | XPath expression of element node to which the child is added. | |
child | Child element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addChild(), and setValue().
void EECFI::XmlFile::addChild | ( | const std::string & | parent, | |
const std::string & | hild, | |||
const long | value, | |||
const std::string & | format | |||
) |
Add a child element with an integer value.
parent | XPath expression of element node to which the child is added. | |
child | Child element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addChild(), and setValue().
void EECFI::XmlFile::addChild | ( | const std::string & | parent, | |
const std::string & | child | |||
) |
Add child element.
parent | XPath expression of element node to which the child is added. | |
child | Child element name. |
The tree pointer is set to the created element.
Referenced by addChild().
void EECFI::XmlFile::addChild | ( | const std::string & | parent, | |
const std::string & | child, | |||
const double | value, | |||
const std::string & | format | |||
) |
Add a child element with a real value.
parent | XPath expression of element node to which the child is added. | |
child | Child element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addChild(), and setValue().
void EECFI::XmlFile::addNext | ( | const std::string & | current, | |
const std::string & | next, | |||
const std::string & | value, | |||
const std::string & | format | |||
) |
Append an element after the current one with a string value.
current | XPath expression of element node to which the new element is appended. | |
next | Appended element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addNext(), and setValue().
void EECFI::XmlFile::addNext | ( | const std::string & | current, | |
const std::string & | next, | |||
const long | value, | |||
const std::string & | format | |||
) |
Append an element after the current one with an integer value.
current | XPath expression of element node to which the new element is appended. | |
next | Appended element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addNext(), and setValue().
void EECFI::XmlFile::addNext | ( | const std::string & | current, | |
const std::string & | next, | |||
const double | value, | |||
const std::string & | format | |||
) |
Append an element after the current one with a real value.
current | XPath expression of element node to which the new element is appended. | |
next | Appended element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addNext(), and setValue().
void EECFI::XmlFile::addNext | ( | const std::string & | current, | |
const std::string & | next | |||
) |
Append sibling element after current one.
current | XPath expression of element node to which the new element is appended. | |
next | Appended element name. |
The tree pointer is set to the created element.
Referenced by addNext().
void EECFI::XmlFile::addPrevious | ( | const std::string & | current, | |
const std::string & | previous, | |||
const long | value, | |||
const std::string & | format | |||
) |
Insert an element before the current one with an integer value.
current | XPath expression of element node in front of which the new element is appended. | |
previous | Inserted element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addPrevious(), and setValue().
void EECFI::XmlFile::addPrevious | ( | const std::string & | current, | |
const std::string & | previous, | |||
const std::string & | value, | |||
const std::string & | format | |||
) |
Insert an element before the current one with a string value.
current | XPath expression of element node in front of which the new element is appended. | |
previous | Inserted element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addPrevious(), and setValue().
void EECFI::XmlFile::addPrevious | ( | const std::string & | current, | |
const std::string & | previous, | |||
const double | value, | |||
const std::string & | format | |||
) |
Insert an element before the current one with a real value.
current | XPath expression of element node in front of which the new element is appended. | |
previous | Inserted element name. | |
value | Element value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the created element.
References addPrevious(), and setValue().
void EECFI::XmlFile::addPrevious | ( | const std::string & | current, | |
const std::string & | previous | |||
) |
Insert sibling element before current one.
current | XPath expression of element node in front of which the new element is inserted. | |
previous | Inserted element name. |
The tree pointer is set to the created element.
Referenced by addPrevious().
void EECFI::XmlFile::clean | ( | ) |
Clean memory.
void EECFI::XmlFile::copyNode | ( | const std::string & | destPath, | |
const std::string & | sourceXmlFile, | |||
const std::string & | sourcePath | |||
) |
Copy a node of one XmlFile to parent node in this XmlFile.
destPath | XPath expression of element node to which the new element will be added. | |
sourceXmlFile | File Xml Source, some elements will be added to the destination file. | |
sourcePath | XPath expression of element node is copied to destination file, this element is child in destPath. |
Two files, one file is a destination file and another file is source file, elements of the source files will be copied into destination files. To have it, there are two tree pointer.
void EECFI::XmlFile::create | ( | ) |
Create an XML tree in memory.
string EECFI::XmlFile::createFileName | ( | long | missionId, | |
const std::string & | fileClass, | |||
const std::string & | fileType, | |||
const std::string & | instanceId, | |||
long | fileExtensionType | |||
) | const |
Generates a complete Cryosat file name.
missionId | Satellite Id (one of SatIdEnum). | |
fileClass | Type of activity for which the file is used. | |
fileType | File type. | |
instanceId | Makes the file unique. | |
fileExtensionType | Type of XML file to add header. |
void EECFI::XmlFile::createHeader | ( | FixedHeader & | fixedHeader | ) |
Creates a fixed header with the input values.
fixedHeader | FixedHeader object containing data for the fixed header. |
Sets the value of all Fixed Header elements.
References EECFI::FixedHeader::creationDate, EECFI::FixedHeader::creator, EECFI::FixedHeader::creatorVersion, EECFI::FixedHeader::fileClass, EECFI::FixedHeader::fileDescription, EECFI::FixedHeader::fileExtensionType, EECFI::FixedHeader::fileName, EECFI::FixedHeader::fileType, EECFI::FixedHeader::mission, EECFI::FixedHeader::notes, EECFI::FixedHeader::system, EECFI::FixedHeader::valStartDate, EECFI::FixedHeader::valStopDate, and EECFI::FixedHeader::version.
void EECFI::XmlFile::createHeader | ( | long | fileExtensionType | ) |
Creates a blank header.
fileExtensionType | Type of XML. Should be one of the possibles values in FileExtensionTypeEnum. |
Generates a new blank Header including both Fixed and Variable headers.
void EECFI::XmlFile::createRoot | ( | const std::string & | element | ) |
Create root element.
element | Root element name. |
string EECFI::XmlFile::currentElementName | ( | ) | const |
string EECFI::XmlFile::currentPathName | ( | ) | const |
Get current path name.
string EECFI::XmlFile::findValueInElement | ( | const std::string & | element, | |
const std::string & | value | |||
) |
Find element with value.
element | Element name. | |
value | Element value. |
Find the first occurence of the element whose name and value match the requested input parameters and return its absolute XPath name.
string EECFI::XmlFile::findValueInPath | ( | const std::string & | path, | |
const std::string & | value | |||
) |
Find node with value.
path | XPath expression of node name (wildcard allowed). | |
value | Element value. |
Find the first occurence of the element whose XPath name and value match the requested input parameters and return its absolute XPath name. The input XPath name can contain a "*" wildcard for searching through sequences.
long EECFI::XmlFile::getAttributeValueAsInt | ( | const std::string & | element, | |
const std::string & | attribute | |||
) |
Read attribute value as an integer.
element | Element name. | |
attribute | Attribute name. |
Return the value of the given attribute in the first occurence of the given element from the current position as integer. If the current position is an element whose name equals "element", returns the value of the given attribute in the current element. The tree pointer is set to the found element.
Referenced by getStringValuesFromList().
double EECFI::XmlFile::getAttributeValueAsReal | ( | const std::string & | element, | |
const std::string & | attribute | |||
) |
Read attribute value as a real number.
element | Element name. | |
attribute | Attribute name. |
Return the value of the given attribute in the first occurence of the given element from the current position as double. If the current position is an element whose name equals "element", returns the value of the given attribute in the current element. The tree pointer is set to the found element.
string EECFI::XmlFile::getAttributeValueAsString | ( | const std::string & | element, | |
const std::string & | attribute | |||
) |
Read attribute value as a string.
element | Element name. | |
attribute | Attribute name. |
Return the value of the given attribute in the first occurence of the given element from the current position as string. If the current position is an element whose name equals "element", returns the value of the given attribute in the current element. The tree pointer is set to the found element.
vector< long > & EECFI::XmlFile::getElementArrayAsInt | ( | const std::string & | element, | |
std::vector< long > & | outVector | |||
) |
Read array of values as integers.
element | Element name. | |
outVector | Vector of element values. |
Return a vector with the values of all ocurrences of the given element as integers. The tree pointer is set to the last found element.
vector< double > & EECFI::XmlFile::getElementArrayAsReal | ( | const std::string & | element, | |
std::vector< double > & | outVector | |||
) |
Read array of values as real numbers.
element | Element name. | |
outVector | Vector of element values. |
Return a vector with the values of all ocurrences of the given element as doubles. The tree pointer is set to the last found element.
vector< string > & EECFI::XmlFile::getElementArrayAsString | ( | const std::string & | element, | |
std::vector< std::string > & | outVector | |||
) |
Read array of values as strings.
element | Element name. | |
outVector | Vector of element values. |
Return a vector with the values of all ocurrences of the given element as strings. The tree pointer is set to the last found element.
long EECFI::XmlFile::getElementValueAsInt | ( | const std::string & | element | ) |
Read element value as an integer.
element | Element name. |
Return the value of the first occurence after the current position of the given element as integer. The tree pointer is set to the found element.
double EECFI::XmlFile::getElementValueAsReal | ( | const std::string & | element | ) |
Read element value as a real number.
element | Element name. |
Return the value of the first occurence after the current position of the given element as double. The tree pointer is set to the found element.
string EECFI::XmlFile::getElementValueAsString | ( | const std::string & | element | ) |
Read element value as a string.
element | Element name. |
Return the value of the first occurence after the current position of the given element as string. The tree pointer is set to the found element.
Referenced by getStringValuesFromList().
string EECFI::XmlFile::getFileName | ( | ) | const |
Get fileName.
FileNameItems EECFI::XmlFile::getFileNameItems | ( | std::string & | fileNam | ) | const |
Retrieve items of created fileName.
fileNam | File Name. |
FixedHeader EECFI::XmlFile::getFixedHeader | ( | ) |
Get fixed header data.
Gets the value of all Fixed Header elements.
string EECFI::XmlFile::getFixedHeaderItem | ( | const std::string & | itemName | ) |
Get an item from the fixed header.
itemName | Name of the element which value we want to retrieve. |
This function gets the value of a Fixed Header node.
long EECFI::XmlFile::getId | ( | ) | const |
vector< long > & EECFI::XmlFile::getPathArrayAsInt | ( | const std::string & | node, | |
std::vector< long > & | outVector | |||
) |
Read integer node array.
path | Node XPath name. | |
outVector | Vector of node values. |
Returns an integer vector with the values of all ocurrences of the given path. This method should be used for reading values from sequences and therefore the path must be absolute and must include a "*" wildcard for indicating the repeated element. The tree pointer is set to the last found element.
vector< double > & EECFI::XmlFile::getPathArrayAsReal | ( | const std::string & | node, | |
std::vector< double > & | outVector | |||
) |
Read double node array.
path | Node XPath name. | |
outVector | Vector of node values. |
Returns a double vector with the values of all ocurrences of the given path. This method should be used for reading values from sequences and therefore the path must be absolute and must include a "*" wildcard for indicating the repeated element. The tree pointer is set to the last found element.
vector< string > & EECFI::XmlFile::getPathArrayAsString | ( | const std::string & | node, | |
std::vector< std::string > & | outVector | |||
) |
Read string node array.
path | Node XPath name. | |
outVector | Vector of node values. |
Returns a string vector with the values of all ocurrences of the given path. This method should be used for reading values from sequences and therefore the path must be absolute and must include a "*" wildcard for indicating the repeated element. The tree pointer is set to the last found element.
long EECFI::XmlFile::getPathValueAsInt | ( | const std::string & | path | ) |
Read path node value as an integer.
path | XPath expression of node. |
Return the value of the node with the given XPath name as integer. The XPath name can be either absolute or relative to the current element. The tree pointer will be set to the found element or the element that contains the found attribute.
double EECFI::XmlFile::getPathValueAsReal | ( | const std::string & | path | ) |
Read path node value as a real number.
path | XPath expression of node. |
Return the value of the node with the given XPath name as double. The XPath name can be either absolute or relative to the current element. The tree pointer will be set to the found element or the element that contains the found attribute.
string EECFI::XmlFile::getPathValueAsString | ( | const std::string & | path | ) |
Read path node value as a string.
path | XPath expression of node. |
Return the value of the node with the given XPath name as string. The XPath name can be either absolute or relative to the current element. The tree pointer will be set to the found element or the element that contains the found attribute.
vector< string > & EECFI::XmlFile::getStringValuesFromList | ( | const std::string & | listPath, | |
const std::string & | element, | |||
std::vector< std::string > & | outVector | |||
) |
Read elements from a list.
listPath | Path of the list to read. | |
element | Element to read. | |
outVector | String vector with the values. |
References currentElementName(), getAttributeValueAsInt(), getElementValueAsString(), and toPath().
void EECFI::XmlFile::next | ( | ) |
Go to next element.
Go to the next element. If the current element has a children then the next is first child else the next could be the next sibling, or the next element could be the next sibling of the parent if the next element has not sibling.
void EECFI::XmlFile::nextSibling | ( | ) |
Go to the next Sibling.
References getId().
void EECFI::XmlFile::read | ( | const std::string & | fileNam | ) |
Read file from disk.
Referenced by XmlFile().
void EECFI::XmlFile::removeNode | ( | const std::string & | path | ) |
Remove node.
path | XPath name of the node to be removed. |
Remove the requested node and all its descendants. The tree pointer is not moved.
void EECFI::XmlFile::removeSchema | ( | bool | removeAll | ) |
Remove schema name.
removeAll | Indicates if schema and version will be removed (true) or only the schema (false). |
void EECFI::XmlFile::root | ( | ) |
Go to root element.
void EECFI::XmlFile::setFixedHeaderItem | ( | const std::string & | itemName, | |
const std::string & | itemValue | |||
) |
Set an item in the fixed header.
itemName | Name of the element which value we want to modify. | |
itemValue | New value assigned for the node. |
Sets the value of any element of a Header.
void EECFI::XmlFile::setFixedHeaderItems | ( | const std::string & | fileNam, | |
const std::string & | fileDescription, | |||
const std::string & | notes, | |||
const std::string & | mission, | |||
const std::string & | fileClass, | |||
const std::string & | filetype, | |||
const std::string & | validityStart, | |||
const std::string & | validityStop, | |||
const long | fileVersion, | |||
const std::string & | system, | |||
const std::string & | creator, | |||
const std::string & | creatorVersion, | |||
const std::string & | creationDate | |||
) |
Set all items in the fixed header.
fileNam | Name of the file. | |
fileDescription | Description of the file. | |
notes | Notes about the file. | |
mission | Mission the file belongs to. | |
fileClass | File class. | |
fileType | File type. | |
validityStart | Date when the file starts being valid. | |
validityStop | Date when the file stops being valid. | |
fileVersion | Version of the file. | |
system | System. | |
creator | Creator name. | |
creatorVersion | Version put by the creator. | |
creationDate | Date of creation. |
Sets the value of any element of a Header.
void EECFI::XmlFile::setSchema | ( | const std::string & | schemaName, | |
bool | setAll | |||
) |
Set schema name.
schemaName | Name of the new schema. | |
setAll | Indicates if schema and version will be changed (true) or only the schema (false). |
void EECFI::XmlFile::setValue | ( | const std::string & | path, | |
const double | value, | |||
const std::string & | format | |||
) |
Set real node value with format.
path | XPath name of node. | |
value | New node value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the requested element. In case an attribute is requested it is set to the element that contains the attribute.
void EECFI::XmlFile::setValue | ( | const std::string & | path, | |
const long | value, | |||
const std::string & | format | |||
) |
Set integer node value with format.
path | XPath name of node. | |
value | New node value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the requested element. In case an attribute is requested it is set to the element that contains the attribute.
void EECFI::XmlFile::setValue | ( | const std::string & | path, | |
const std::string & | value, | |||
const std::string & | format | |||
) |
Set string node value with format.
path | XPath name of node. | |
value | New node value. | |
format | Value format as expressed for printf functions. If format is empty "%%s" is used. |
The tree pointer is set to the requested element. In case an attribute is requested it is set to the element that contains the attribute.
Referenced by addAttribute(), addChild(), addNext(), and addPrevious().
void EECFI::XmlFile::toElement | ( | const std::string & | element | ) |
Go to element.
element | Element name to be found. |
Set the tree pointer to the first occurrence of the given element after the current position.
void EECFI::XmlFile::toPath | ( | const std::string & | path | ) |
Go to path.
path | Path name to be found, either absolute or relative to the current element. |
Set the tree pointer to the first occurence of the given path after the current position.
Referenced by getStringValuesFromList().
void EECFI::XmlFile::write | ( | ) |
Write file to disk.
void EECFI::XmlFile::write | ( | const std::string & | fileNam | ) |
Write file to disk with different name.
fileNam | Output file name. |