tntdb::StmtParser Class Reference

Search host variables. More...

#include <tntdb/stmtparser.h>

Public Member Functions

 StmtParser (char praefixChar_= ':')
void parse (const std::string &sqlIn, StmtEvent &event)
const std::string & getSql () const

Detailed Description

Search host variables.

Host variables start with a ':' followed by alpha characters. For each variable found the event handler StmtEvent is called. The host variable is removed and replaced with the value returned by the event handler.

The character '\' is treated as an escape character. It is removed and the following character is processed as is. Name parsing is stopped at '\', so if you need to put alpha characters directly after a host variable, you can escape the character following the host variables name.

Strings enclosed in ', " or ` are skipped.

Constructor & Destructor Documentation

tntdb::StmtParser::StmtParser ( char  praefixChar_ = ':')

Member Function Documentation

const std::string& tntdb::StmtParser::getSql ( ) const
void tntdb::StmtParser::parse ( const std::string &  sqlIn,
StmtEvent event 

The documentation for this class was generated from the following file: