def create_xml_file(self, source_file, destination=None):
        """
        This method will generate a xml file using an external tool.

        The method will return the file path of the generated xml file.

        :param source_file: path to the source file that should be parsed.
        :type source_file: str

        :param destination: if given, will be used as target file path for
                            the xml generator.
        :type destination: str

        :rtype: path to xml file.

        """

        xml_file = destination
        # If file specified, remove it to start else create new file name
        if xml_file:
            utils.remove_file_no_raise(xml_file, self.__config)
        else:
            xml_file = utils.create_temp_file_name(suffix='.xml')

        ffname = source_file
        if not os.path.isabs(ffname):
            ffname = self.__file_full_name(source_file)
        command_line = self.__create_command_line(ffname, xml_file)

        process = subprocess.Popen(
            args=command_line,
            shell=True,
            stdout=subprocess.PIPE)

        try:
            results = []
            while process.poll() is None:
                line = process.stdout.readline()
                if line.strip():
                    results.append(line.rstrip())
            for line in process.stdout.readlines():
                if line.strip():
                    results.append(line.rstrip())

            exit_status = process.returncode
            msg = os.linesep.join([str(s) for s in results])
            if self.__config.ignore_gccxml_output:
                if not os.path.isfile(xml_file):
                    raise RuntimeError(
                        "Error occurred while running " +
                        self.__config.xml_generator.upper() +
                        ": %s status:%s" %
                        (msg, exit_status))
            else:
                if msg or exit_status or not \
                        os.path.isfile(xml_file):
                    if not os.path.isfile(xml_file):
                        raise RuntimeError(
                            "Error occurred while running " +
                            self.__config.xml_generator.upper() +
                            " xml file does not exist")
                    else:
                        raise RuntimeError(
                            "Error occurred while running " +
                            self.__config.xml_generator.upper() +
                            ": %s status:%s" % (msg, exit_status))
        except Exception:
            utils.remove_file_no_raise(xml_file, self.__config)
            raise
        finally:
            process.wait()
            process.stdout.close()
        return xml_file
def create_xml_file ( self , source_file , destination = None ) : xml_file = destination if xml_file : utils . remove_file_no_raise ( xml_file , self . __config ) else : xml_file = utils . create_temp_file_name ( suffix = '.xml' ) ffname = source_file if not os . path . isabs ( ffname ) : ffname = self . __file_full_name ( source_file ) command_line = self . __create_command_line ( ffname , xml_file ) process = subprocess . Popen ( args = command_line , shell = True , stdout = subprocess . PIPE ) try : results = [ ] while process . poll ( ) is None : line = process . stdout . readline ( ) if line . strip ( ) : results . append ( line . rstrip ( ) ) for line in process . stdout . readlines ( ) : if line . strip ( ) : results . append ( line . rstrip ( ) ) exit_status = process . returncode msg = os . linesep . join ( [ str ( s ) for s in results ] ) if self . __config . ignore_gccxml_output : if not os . path . isfile ( xml_file ) : raise RuntimeError ( "Error occurred while running " + self . __config . xml_generator . upper ( ) + ": %s status:%s" % ( msg , exit_status ) ) else : if msg or exit_status or not os . path . isfile ( xml_file ) : if not os . path . isfile ( xml_file ) : raise RuntimeError ( "Error occurred while running " + self . __config . xml_generator . upper ( ) + " xml file does not exist" ) else : raise RuntimeError ( "Error occurred while running " + self . __config . xml_generator . upper ( ) + ": %s status:%s" % ( msg , exit_status ) ) except Exception : utils . remove_file_no_raise ( xml_file , self . __config ) raise finally : process . wait ( ) process . stdout . close ( ) return xml_file
This method will generate a xml file using an external tool.

        The method will return the file path of the generated xml file.

        :param source_file: path to the source file that should be parsed.
        :type source_file: str

        :param destination: if given, will be used as target file path for
                            the xml generator.
        :type destination: str

        :rtype: path to xml file.