oos::varchar< C > Class Template Reference

A simple varchar class. More...

#include <varchar.hpp>

Inherits varchar_base.

Public Member Functions

 varchar ()
 
 varchar (const varchar &x)
 
 varchar (const std::string &x)
 
 varchar (const char *x)
 
varcharoperator= (const varchar &x)
 
varcharoperator= (const std::string &x)
 
varcharoperator= (const char *x)
 

Detailed Description

template<unsigned int C>
class oos::varchar< C >

A simple varchar class.

Template Parameters
CThe capacity of the varchar.

This class provides string class with the SQL VARCHAR type in mind. The capacity of the string is given within the template parameter of type unsigned int. The real string is represented internaly by a std::string.

Constructor & Destructor Documentation

template<unsigned int C>
oos::varchar< C >::varchar ( )
inline

Creates an empty varchar with the given capacity

template<unsigned int C>
oos::varchar< C >::varchar ( const varchar< C > &  x)
inline

Copies the string data from the given varchar.

Parameters
xThe varchar to copy.
template<unsigned int C>
oos::varchar< C >::varchar ( const std::string &  x)
inlineexplicit

Initializes the varchar with the given string.

Parameters
xThe string value to set.
template<unsigned int C>
oos::varchar< C >::varchar ( const char *  x)
inlineexplicit

Initializes the varchar with the given string.

Parameters
xThe string value to set.

Member Function Documentation

template<unsigned int C>
varchar& oos::varchar< C >::operator= ( const varchar< C > &  x)
inline

Assigns a varchar.

Parameters
xThe varchar to assign.
Returns
Returns a reference to this class.
template<unsigned int C>
varchar& oos::varchar< C >::operator= ( const std::string &  x)
inline

Assigns a string to the varchar

Parameters
xThe string to assign.
Returns
Returns a reference to this class.
template<unsigned int C>
varchar& oos::varchar< C >::operator= ( const char *  x)
inline

Assigns a character array to the varchar

Parameters
xThe character array to assign.
Returns
Returns a reference to this class.

The documentation for this class was generated from the following file:
  • tools/varchar.hpp