pelican/utility/src/Config.cpp
/**
 * @details
 * Imports and appends a file to the given \p parent XML node.
 * All element nodes under (but not including) the root node of the
 * file are copied to the \p document.
 *
 * If not an absolute path, the name of the file to import must be relative
 * to the executable.
 *
 * @param[in] document A reference to the XML document.
 * @param[in] parent   A reference to the parent XML node.
 * @param[in] name     Name of the file to import.
 */
@details
Imports and appends a file to the given \p parent XML node.
All element nodes under (but not including) the root node of the
file are copied to the \p document.

If not an absolute path, the name of the file to import must be relative
to the executable.

@param[in] document A reference to the XML document.
@param[in] parent   A reference to the parent XML node.
@param[in] name     Name of the file to import.
@details Imports and appends a file to the given \ p parent XML node . All element nodes under ( but not including ) the root node of the file are copied to the \ p document . If not an absolute path the name of the file to import must be relative to the executable . @param [ in ] document A reference to the XML document . @param [ in ] parent A reference to the parent XML node . @param [ in ] name Name of the file to import .
void Config::importFile(QDomDocument& document,
        QDomNode& parent, const QString& name)
{
    if (name.isEmpty()) return;
    QString filename = searchFile(name);
    parent.appendChild(document.createComment(
            "% Imported file " + filename) );
    QDomDocument newDoc = read(filename);
    QDomNodeList list = newDoc.documentElement().childNodes();
    for (int j = 0; j < list.size(); j++) {
        parent.appendChild(list.at(j).cloneNode());
    }
}
void Config :: importFile ( QDomDocument & document , QDomNode & parent , const QString & name ) { if ( name . isEmpty ( ) ) return ; QString filename = searchFile ( name ) ; parent . appendChild ( document . createComment ( " " + filename ) ) ; QDomDocument newDoc = read ( filename ) ; QDomNodeList list = newDoc . documentElement ( ) . childNodes ( ) ; for ( int j = 0 ; j < list . size ( ) ; j ++ ) { parent . appendChild ( list . at ( j ) . cloneNode ( ) ) ; } }
@details
 Imports and appends a file to the given \p parent XML node.
@details Imports and appends a file to the given \ p parent XML node .
// Return if name is empty. // find the file // Write comment. // Import the file. // Loop over each child under the root node of the file, and append it.