/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                   Copyright (c) 2002 Zanoza Software.                   *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg M.
 *--------------------------------------------------------------------------
 * @purpose:  ZModeler 2.x regular expressions helper
 *--------------------------------------------------------------------------
 * @histroy: 24.04.2003. Created
 */
#ifndef zmregexphelper_h_included
#define zmregexphelper_h_included

#include <zmodeler.h>


//-------------------------------------------------------
// @name : ZAPICALL regExpCmp
// Compares str on matching regular expression strExp
// @param const char* strExp             : regular expression
// @param const char* str                : string to compare
//
// @return DLL_LINKAGE bool : true on match
//-------------------------------------------------------
DLL_LINKAGE bool ZAPICALL regExpCmp(const char* strExp, const char* str);

//-------------------------------------------------------
// @name : ZAPICALL regExpPrepare
// Prepares regular expression (compiles it)
// @param const char* strExp             : 
// @param DWORD& nToken                  : ret-val expression reference token
//
// @return DLL_LINKAGE bool : 
//-------------------------------------------------------
DLL_LINKAGE bool ZAPICALL regExpPrepare(const char* strExp, DWORD& nToken);

//-------------------------------------------------------
// @name : ZAPICALL regExpCompare
// uses pre-compiled regular expression to compare supplied string
// @param DWORD nToken                   : reference token (see regExpPrepare)
// @param const char* str                : 
//
// @return DLL_LINKAGE bool : true on match
//-------------------------------------------------------
DLL_LINKAGE bool ZAPICALL regExpCompare(DWORD nToken, const char* str);

//-------------------------------------------------------
// @name : ZAPICALL regExpSubstitute
// Performs substitution after regExpCompare match
// @param DWORD nToken                   : reference token (see regExpPrepare)
// @param const char* str                : source string
// @param char* result                   : destination buffer. Allocate it first!
//
// @return DLL_LINKAGE bool : 
//-------------------------------------------------------
DLL_LINKAGE bool ZAPICALL regExpSubstitute(DWORD nToken, const char* str, char* result);

//-------------------------------------------------------
// @name : ZAPICALL regExpRelease
// Releases precompiled regular expression
// @param DWORD nToken                   : reference token (see regExpPrepare)
//
// @return DLL_LINKAGE bool : 
//-------------------------------------------------------
DLL_LINKAGE void ZAPICALL regExpRelease(DWORD nToken);

#endif //zmregexphelper_h_included

