src/PredFinder/elf/ElfDocument.cpp
/**
 * Writes this document as an ELF XML file to the specified directory.
 * If an XML file for this document (by unique ID) already exists in
 * the directory, it will be overwritten.
 *
 * XMLPlatformUtils::Initialize() must be called before this method.
 *
 * @param output_dir The path to a directory where this document will
 * be written.
 *
 * @author nward@bbn.com
 * @date 2010.05.14
 **/
Writes this document as an ELF XML file to the specified directory.
If an XML file for this document (by unique ID) already exists in
the directory, it will be overwritten.

:Initialize() must be called before this method.

@param output_dir The path to a directory where this document will
be written.


Writes this document as an ELF XML file to the specified directory . If an XML file for this document ( by unique ID ) already exists in the directory it will be overwritten . : Initialize () must be called before this method . @param output_dir The path to a directory where this document will be written .
void ElfDocument::to_file(const std::wstring & output_dir) const {
	boost::filesystem::wpath output_dir_path = boost::filesystem::system_complete(boost::filesystem::wpath(output_dir));
	boost::filesystem::create_directories(output_dir_path);
	std::wstring doc_output_file = output_dir + L"/" + _id;
	if (_contents == L"S-ELF") {
		doc_output_file += L".self.xml";
	} else if (_contents == L"R-ELF") {
		doc_output_file += L".relf.xml";
	} else {
		doc_output_file += L".elf.xml";
	}
	DOMDocument* output_doc = to_xml();
    XMLUtil::saveXercesDOMToFilename(output_doc, doc_output_file.c_str());
	output_doc->release();
}
void ElfDocument :: to_file ( const std :: wstring & output_dir ) const { boost :: filesystem :: wpath output_dir_path = boost :: filesystem :: system_complete ( boost :: filesystem :: wpath ( output_dir ) ) ; boost :: filesystem :: create_directories ( output_dir_path ) ; std :: wstring doc_output_file = output_dir + L" " + _id ; if ( _contents == L" " ) { doc_output_file += L" " ; } else if ( _contents == L" " ) { doc_output_file += L" " ; } else { doc_output_file += L" " ; } DOMDocument * output_doc = to_xml ( ) ; XMLUtil :: saveXercesDOMToFilename ( output_doc , doc_output_file . c_str ( ) ) ; output_doc -> release ( ) ; }
Writes this document as an ELF XML file to the specified directory.
Writes this document as an ELF XML file to the specified directory .
// Make sure the output directory exists
 // Generate a full path to the output file
 // Write out the document
