Fledge
An open source edge computing platform for industrial users
SQLBuffer Class Reference

Buffer class designed to hold SQL statement that can as required but have minimal copy semantics. More...

#include <sql_buffer.h>

Public Member Functions

 SQLBuffer ()
 Buffer class designed to hold SQL statement that can as required but have minimal copy semantics. More...
 
 ~SQLBuffer ()
 SQLBuffer destructor.
 
bool isEmpty ()
 
void append (const char)
 Append a character to a buffer. More...
 
void append (const char *)
 Append a character string to a buffer. More...
 
void append (const int)
 Append an integer to a buffer. More...
 
void append (const unsigned int)
 Append an unsigned integer to a buffer. More...
 
void append (const long)
 Append a long to a buffer. More...
 
void append (const unsigned long)
 Append an unsigned long to a buffer. More...
 
void append (const double)
 Append a double to a buffer. More...
 
void append (const std::string &)
 
void quote (const std::string &)
 Quote and append a string to a buffer. More...
 
const char * coalesce ()
 Create a coalesced buffer from the buffer chain. More...
 
void clear ()
 Clear all the buffers from the SQLBuffer and allow it to be reused.
 

Detailed Description

Buffer class designed to hold SQL statement that can as required but have minimal copy semantics.

Constructor & Destructor Documentation

◆ SQLBuffer()

SQLBuffer::SQLBuffer ( )

Buffer class designed to hold SQL statement that can as required but have minimal copy semantics.

SQLBuffer constructor

Member Function Documentation

◆ append() [1/7]

void SQLBuffer::append ( const char  data)

Append a character to a buffer.

Parameters
dataThe character to append to the buffer

◆ append() [2/7]

void SQLBuffer::append ( const char *  data)

Append a character string to a buffer.

data The string to append to the buffer

◆ append() [3/7]

void SQLBuffer::append ( const int  value)

Append an integer to a buffer.

Parameters
valueThe value to append to the buffer

◆ append() [4/7]

void SQLBuffer::append ( const unsigned int  value)

Append an unsigned integer to a buffer.

Parameters
valueThe unsigned long value to append to the buffer

◆ append() [5/7]

void SQLBuffer::append ( const long  value)

Append a long to a buffer.

Parameters
valueThe long value to append to the buffer

◆ append() [6/7]

void SQLBuffer::append ( const unsigned long  value)

Append an unsigned long to a buffer.

Parameters
valueThe value to append to the buffer

◆ append() [7/7]

void SQLBuffer::append ( const double  value)

Append a double to a buffer.

Parameters
valueThe double value to append to the buffer

◆ coalesce()

const char * SQLBuffer::coalesce ( )

Create a coalesced buffer from the buffer chain.

The buffer returned has been created usign the new[] operator and must be deleted by the caller.

Returns
char* The SQL statement in a single buffer

◆ quote()

void SQLBuffer::quote ( const std::string &  )

Quote and append a string to a buffer.

Parameters
strThe string to quote and append to the buffer

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