te::da::FieldNameValidator Class Reference

This class is responsible for validating field names. It can handle size limits, fix special characters changes the form 'tableName.propertyName' into the form 'tableName_propertyName'. More...

#include <FieldNameValidator.h>

Public Member Functions

bool addFieldName (const std::string &fieldName)
 
bool addFieldName (const std::string &fieldName, std::string &adjustedFieldName)
 
bool exists (const std::string &fieldName) const
 
 FieldNameValidator (int fieldNameMaxSize, bool replaceDotForUnderline, bool replaceSpecialChars)
 
const std::vector< std::string > & getAdjustedNames () const
 

Static Public Member Functions

static std::string adjustFieldNameMaxSize (const std::string &fieldName, int fieldNameMaxSize)
 
static std::string replaceDotForUnderline (const std::string &fieldName)
 
static std::string replaceSpecialCharacters (const std::string &fieldName)
 

Protected Attributes

int m_fieldNameMaxSize
 The field name maximum size. -1 means no limit. More...
 
bool m_replaceDotForUnderline
 If TRUE, all 'dots' characters present in a "table.property" format will be replaced by an underline character. More...
 
bool m_replaceSpecialChars
 If TRUE, the special chars will be replaced. More...
 
std::set< std::string > m_setAdjustedNames
 Internal set used to make a fast check to make sure there arent repeated field names. More...
 
std::vector< std::string > m_vecAdjustedNames
 Internal vector containing the ajusted (or the original if no adjustment hasbeen needed) names. More...
 

Detailed Description

This class is responsible for validating field names. It can handle size limits, fix special characters changes the form 'tableName.propertyName' into the form 'tableName_propertyName'.

Definition at line 45 of file FieldNameValidator.h.

Constructor & Destructor Documentation

◆ FieldNameValidator()

te::da::FieldNameValidator::FieldNameValidator ( int  fieldNameMaxSize,
bool  replaceDotForUnderline,
bool  replaceSpecialChars 
)

Member Function Documentation

◆ addFieldName() [1/2]

bool te::da::FieldNameValidator::addFieldName ( const std::string &  fieldName)

◆ addFieldName() [2/2]

bool te::da::FieldNameValidator::addFieldName ( const std::string &  fieldName,
std::string &  adjustedFieldName 
)

◆ adjustFieldNameMaxSize()

static std::string te::da::FieldNameValidator::adjustFieldNameMaxSize ( const std::string &  fieldName,
int  fieldNameMaxSize 
)
static

◆ exists()

bool te::da::FieldNameValidator::exists ( const std::string &  fieldName) const

◆ getAdjustedNames()

const std::vector<std::string>& te::da::FieldNameValidator::getAdjustedNames ( ) const

◆ replaceDotForUnderline()

static std::string te::da::FieldNameValidator::replaceDotForUnderline ( const std::string &  fieldName)
static

◆ replaceSpecialCharacters()

static std::string te::da::FieldNameValidator::replaceSpecialCharacters ( const std::string &  fieldName)
static

Member Data Documentation

◆ m_fieldNameMaxSize

int te::da::FieldNameValidator::m_fieldNameMaxSize
protected

The field name maximum size. -1 means no limit.

Definition at line 64 of file FieldNameValidator.h.

◆ m_replaceDotForUnderline

bool te::da::FieldNameValidator::m_replaceDotForUnderline
protected

If TRUE, all 'dots' characters present in a "table.property" format will be replaced by an underline character.

Definition at line 65 of file FieldNameValidator.h.

◆ m_replaceSpecialChars

bool te::da::FieldNameValidator::m_replaceSpecialChars
protected

If TRUE, the special chars will be replaced.

Definition at line 66 of file FieldNameValidator.h.

◆ m_setAdjustedNames

std::set<std::string> te::da::FieldNameValidator::m_setAdjustedNames
protected

Internal set used to make a fast check to make sure there arent repeated field names.

Definition at line 68 of file FieldNameValidator.h.

◆ m_vecAdjustedNames

std::vector<std::string> te::da::FieldNameValidator::m_vecAdjustedNames
protected

Internal vector containing the ajusted (or the original if no adjustment hasbeen needed) names.

Definition at line 67 of file FieldNameValidator.h.


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