enumfiledef : process

As above, But output a file to the path specified. If "fullpath", then the path represents an actual filename, so we don't append the filedefs path onto it.

Any other method of any other object can call this method. This is called 'public' access.

The data-type returned is "booltype"; Returns true if the function is successful.

This method is contained in the object "enumfiledef".

The method takes the following arguments:

schema : Pointer to enumeration

Not sure.

path : pathtype

Not sure.

fullpath : booltype

Not sure.

C++

The files "boost/filesystem/fstream.hpp", "boost/filesystem/operations.hpp" and "tgl_block_parser.hpp" are included.

Output a global enumeration file definition to the file provided. If the full path is provided, then we output a message and process the blocks. The message contains only a relative path in it.

	if (fullpath)
	{
		boost::filesystem::ofstream fs(path);
		if (!fs.is_open())
		{
			*_console << "Could not open file [" << path.string() << "]." << std::endl;
			return false;
		}
		
		std::string current = boost::filesystem::current_path().string();
		std::string p = path.string();
		
		if (p.substr(0, current.length()) == current)
			p = p.substr(current.length()+1);
			
		*_stream << "Processing " << p << std::endl;

		tgl_block_parser parser(this, schema, false, false, 
			&fs, _console, get_path(), _filepath);
		return parser.write_output(_structure);
	}
	else
	{
		boost::filesystem::path filename;
		if (path.empty() || _filepath.is_complete())
			filename = _filepath;
		else
			filename = path / _filepath;
		filename.normalize();
		return process(schema, filename, true);
	}

Generated: Thu Apr 6 00:01:10 EST 2006 using "xsltproc ... docbook.xsl". Copyright (c) 2003, 2004, 2005; Paul Hamilton; pHamtec P/L. Use, modification, and distribution is provided free of any limitations.