<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!--
// // See license.txt for license information. // // tgl_filedef.xml // // 24-Jul-2003 phamilton Created //
-->

<object xmlns:xi="http://www.w3.org/2001/XInclude" xmlns="urn:xmlliterate.schema" name="filedef">
    <description>Class used to represent the definition of a file (like a header or implementation) for the tangle tool.</description>
    <classname>tgl_filedef</classname>
    <members>
        <pathtype name="filepath">
            <description>The path to use for the file. This would be a folder when the file definition is used on multiple objects, and the actual output filename when used as a one off.</description>
        </pathtype>
        <stringtype name="extension">
            <description>The extension to use for the file. This is appended to the object name when multiple objects are processed through this filedef.</description>
        </stringtype>
        <stringtype name="root">
            <description>The location of the root to use for the filedef if the objname passed in is "*".</description>
        </stringtype>
        <typedobjvectortype name="data">
            <description>Generic data that may be used later.</description>
            <reftype>@tglobj</reftype>
        </typedobjvectortype>
        <typedobjvectortype name="blocks">
            <description>The blocks to be placed in the file.</description>
            <reftype>@block</reftype>
        </typedobjvectortype>
        <stringtype name="structure">
            <description>the overall structure of the file.</description>
        </stringtype>
        <stringtype name="ignoreobjects">
            <description>A list of objects which should be ignored in the schema.</description>
        </stringtype>
        <streamptrtype name="stream">
            <description>The real output stream.</description>
            <attributes>
                <attribute name="nopersist"/>
            </attributes>
        </streamptrtype>
        <streamptrtype name="console">
            <description>The real console stream.</description>
            <attributes>
                <attribute name="nopersist"/>
            </attributes>
        </streamptrtype>
    </members>
    <methods>
        <method name="setstreams">
            <description>Allow a filedef access to the real streams.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <voidtype/>
            </returns>
            <arguments>
                <streamptrtype name="stream">
                    <description>The real output streamtype.</description>
                </streamptrtype>
                <streamptrtype name="console">
                    <description>The real console streamtype.</description>
                </streamptrtype>
            </arguments>
            <implementations>
                <xi:include href="cpp/filedef/setstreams.xml"/>
            </implementations>
        </method>
        <method name="match">
            <description>Match any object inside this file definition.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <booltype>
                    <description>Returns true if match is successful.</description>
                </booltype>
            </returns>
            <arguments>
                <ptrtypename name="schema">
                    <description>Not sure.</description>
                    <reftype>object</reftype>
                </ptrtypename>
                <stringtype name="objname">
                    <description>Not sure.</description>
                </stringtype>
            </arguments>
            <implementations>
                <xi:include href="cpp/filedef/match.xml"/>
            </implementations>
        </method>
        <method name="process">
            <description>Process the object through this file definition, outputing "structure" to the stream provided, and sending any errors to the console. Commands can be embedded in the structure according to the definitions in the class.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <booltype>
                    <description>Returns true if the function is successful.</description>
                </booltype>
            </returns>
            <arguments>
                <ptrtypename name="schema">
                    <description>Not sure.</description>
                    <reftype>object</reftype>
                </ptrtypename>
                <stringtype name="objname">
                    <description>Not sure.</description>
                </stringtype>
            </arguments>
            <implementations>
                <xi:include href="cpp/filedef/process1.xml"/>
            </implementations>
        </method>
        <method name="process">
            <description>As above, but write a file out to the folder passed in. Progress messages are written to the stream.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <booltype>
                    <description>Returns true if the function is successful.</description>
                </booltype>
            </returns>
            <arguments>
                <ptrtypename name="schema">
                    <description>Not sure.</description>
                    <reftype>object</reftype>
                </ptrtypename>
                <stringtype name="objname">
                    <description>Not sure.</description>
                </stringtype>
                <pathtype name="path">
                    <description>Not sure.</description>
                </pathtype>
            </arguments>
            <implementations>
                <xi:include href="cpp/filedef/process2.xml"/>
            </implementations>
        </method>
        <method name="process">
            <description>As above, but don't try to find the object, jyst pass the schema.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <booltype>
                    <description>Returns true if the function is successful.</description>
                </booltype>
            </returns>
            <arguments>
                <ptrtypename name="schema">
                    <description>Not sure.</description>
                    <reftype>object</reftype>
                </ptrtypename>
            </arguments>
            <implementations>
                <xi:include href="cpp/filedef/process3.xml"/>
            </implementations>
        </method>
        <method name="process">
            <description>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.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <booltype>
                    <description>Returns true if the function is successful.</description>
                </booltype>
            </returns>
            <arguments>
                <ptrtypename name="schema">
                    <description>Not sure.</description>
                    <reftype>object</reftype>
                </ptrtypename>
                <pathtype name="path">
                    <description>Not sure.</description>
                </pathtype>
                <booltype name="fullpath">
                    <description>Not sure.</description>
                </booltype>
            </arguments>
            <implementations>
                <xi:include href="cpp/filedef/process4.xml"/>
            </implementations>
        </method>
        <method name="make_filename">
            <description>Create a filename out of the path and name we are given. We use the path inside here and the extension on the end.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <pathtype>
                    <description>The path to the file specified.</description>
                </pathtype>
            </returns>
            <arguments>
                <pathtype name="path">
                    <description>Not sure.</description>
                </pathtype>
                <stringtype name="fname">
                    <description>Not sure.</description>
                </stringtype>
            </arguments>
            <implementations>
                <xi:include href="cpp/make_filename.xml"/>
            </implementations>
        </method>
        <method name="get_block">
            <description>Used by the parser to get a block.</description>
            <inheritance>concrete</inheritance>
            <access>public</access>
            <returns>
                <ptrtypename>
                    <description>The block that matches name.</description>
                    <reftype>@block</reftype>
                </ptrtypename>
            </returns>
            <arguments>
                <stringtype name="block">
                    <description>The name of the block.</description>
                </stringtype>
            </arguments>
            <implementations>
                <xi:include href="cpp/get_block.xml"/>
            </implementations>
        </method>
        <method name="get_root">
            <description>Utility for getting the root of a schema.</description>
            <access>private</access>
            <returns>
                <ptrtypename>
                    <description>The schema object at the root.</description>
                    <reftype>object</reftype>
                </ptrtypename>
            </returns>
            <arguments>
                <ptrtypename name="schema">
                    <description>Not sure.</description>
                    <reftype>object</reftype>
                </ptrtypename>
                <stringtype name="root">
                    <description>The path to the root.</description>
                </stringtype>
                <streamptrtype name="console">
                    <description>Not sure.</description>
                </streamptrtype>
            </arguments>
            <implementations>
                <xi:include href="cpp/get_root.xml"/>
            </implementations>
        </method>
    </methods>
</object>