<!--
* 
*
*  ProLinga-Validate
*
*  Copyright (C) 2002-2008 Xobas Software.
*  All rights reserved.
*  
*  This file is part of ProLinga-Validate.
*
*  ProLinga-Validate is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  ProLinga-Validate is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with ProLinga-Validate.  If not, see <http://www.gnu.org/licenses/>.
*
*  More information is available at the following addresses:
*
*  Website     : http://www.prolinga.org
*
*  Email       : prolinga-list@prolinga.org
*
*
-->

<refentry id="prolinga-validate-validate">
  <refmeta>
    <refentrytitle>Validate</refentrytitle>
    <manvolnum>3</manvolnum>
  <refmiscinfo>ProLinga-Validate Library</refmiscinfo>
</refmeta>

<refnamediv>
  <refname>Validate</refname>
  <refpurpose>Class used to manage Validate connections and process Validate Commands.</refpurpose>
</refnamediv>

<refsynopsisdiv>
  <title>Synopsis</title>

  <synopsis>
#include &lt;prolinga/Validate.hpp&gt;

class <anchor id="class_PlValidate"/>PlValidate
{
        public:
                <link linkend="PlValidate">PlValidate</link>();
                ~<link linkend="PlValidate">PlValidate</link>();
                <link linkend="void">void</link>         <link linkend="PlValidate__validateOpen">validateOpen</link>           (const <link linkend="char">char</link> *configFileName);
                <link linkend="void">void</link>         <link linkend="PlValidate__validateClose">validateClose</link>          (<link linkend="void">void</link>);
                <link linkend="xmlDocPtr">xmlDocPtr</link>    <link linkend="PlValidate__executeCommand">executeCommand</link>         (const <link linkend="xmlDocPtr">xmlDocPtr</link> validateRequest);
                ...
};
typedef <link linkend="class_PlValidate">PlValidate</link> *PlValidatePtr;

  </synopsis>
</refsynopsisdiv>

<refsect1>
  <title>Description</title>
    <para>
    This class is used to connect to a Validate environment and executes a Validate Command.
    </para>
</refsect1>

<refsect1>
  <title>Details</title>
    <para/>
    <refsect2>
      <title><anchor id="PlValidate__validateOpen"/>PlValidate::validateOpen ()</title>
        <indexterm>
          <primary>PlValidate::validateOpen</primary>
        </indexterm>
        <programlisting><link linkend="void">void</link>       PlValidate::validateOpen           (const <link linkend="char">char</link> *configFileName);
</programlisting>
        <para>
        This function is called to initialize a connection to the Validate environment. The configuration file that
        is passed as an argument, is processed and the Language Definition File is opened. If the argument is set to
        NULL, the Validation default configuration file (etc/prolingavalcfg.xml) will be used.</para>

        <para>Function <link linkend="PlValidate__validateClose">PlValidate::validateClose</link> 
        must be called when access to the Validate is no longer needed in order to close all handles
        and to free memory.</para>
        <para>
        </para>
        <variablelist role="params">
          <varlistentry>
            <term><parameter>configFileName</parameter>&nbsp;:</term>
            <listitem>
              <simpara> the name or the Validate configuration file. If the argument is set to
              NULL, the Validate default configuration file (etc/prolingavalcfg.xml) will be used.</simpara>
            </listitem>
          </varlistentry>
        </variablelist>
    </refsect2>

    <refsect2>
      <para/>
      <title><anchor id="PlValidate__validateClose"/>PlValidate::validateClose ()</title>
        <indexterm>
          <primary>PlValidate::validateClose</primary>
        </indexterm>
        <programlisting><link linkend="void">void</link>       PlValidate::validateClose           (<link linkend="void">void</link>);
</programlisting>
        <para>
        This function is called to close a connection to the Validate environment.
        All handles and allocated memory will be freed.</para>
        
        <para>
        </para>
        <variablelist role="params">
        </variablelist>
    </refsect2>

    <refsect2>
      <para/>
      <title><anchor id="PlValidate__executeCommand"/>PlValidate::executeCommand ()</title>
        <indexterm>
          <primary>PlValidate::executeCommand</primary>
        </indexterm>
        <programlisting><link linkend="xmlDocPtr">xmlDocPtr</link>       PlValidate::executeCommand      (const <link linkend="xmlDocPtr">xmlDocPtr</link> validateRequest);
</programlisting>
        <para>
        This function presents a Validate Command to the Validate processing engine. 
        The command gets processed and a result
        returned. The returned XML document needs to be freed manually when it
        is no longer needed.
        </para>

        <para>
        </para>
        <variablelist role="params">
          <varlistentry>
            <term><emphasis>Returns</emphasis>&nbsp;:</term>
            <listitem>
              <simpara> the Validate Command response as a libxml2 XML document.</simpara>
            </listitem>
          </varlistentry>
        </variablelist>
    </refsect2>

  </refsect1>
</refentry>

