filedef : 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 "filedef".
The method takes the following arguments:
schema : Pointer to object
Not sure.
path : pathtype
Not sure.
fullpath : booltype
Not sure.
The files "boost/filesystem/fstream.hpp", "boost/filesystem/operations.hpp" and "tgl_block_parser.hpp" are included.
Output a global 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(), path); 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); }