LibreOffice Module connectivity (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
dbtools::OPredicateInputController Class Reference

A class which allows input of an SQL predicate for a row set column into an edit field. More...

#include <predicateinput.hxx>

Collaboration diagram for dbtools::OPredicateInputController:
[legend]

Public Member Functions

 OPredicateInputController (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const ::connectivity::IParseContext *_pParseContext=nullptr)
 
bool normalizePredicateString (OUString &_rPredicateValue, const css::uno::Reference< css::beans::XPropertySet > &_rxField, OUString *_pErrorMessage=nullptr) const
 transforms a "raw" predicate value (usually obtained from a user input) into a valid predicate for the given column More...
 
OUString getPredicateValueStr (const OUString &_rPredicateValue, const css::uno::Reference< css::beans::XPropertySet > &_rxField) const
 get the value of the predicate, as a string to be used in a WHERE clause More...
 
OUString getPredicateValueStr (const OUString &_sField, const OUString &_rPredicateValue) const
 
css::uno::Any getPredicateValue (const OUString &_rPredicateValue, const css::uno::Reference< css::beans::XPropertySet > &_rxField) const
 get the value of the predicate, either as an empty or as a string More...
 

Private Member Functions

std::unique_ptr<::connectivity::OSQLParseNodeimplPredicateTree (OUString &_rErrorMessage, const OUString &_rStatement, const css::uno::Reference< css::beans::XPropertySet > &_rxField) const
 
bool getSeparatorChars (const css::lang::Locale &_rLocale, sal_Unicode &_rDecSep, sal_Unicode &_rThdSep) const
 
css::uno::Any implParseNode (std::unique_ptr<::connectivity::OSQLParseNode > pParseNode, bool _bForStatementUse) const
 

Private Attributes

css::uno::Reference< css::sdbc::XConnection > m_xConnection
 
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
 
css::uno::Reference< css::i18n::XLocaleData4 > m_xLocaleData
 
::connectivity::OSQLParser m_aParser
 

Detailed Description

A class which allows input of an SQL predicate for a row set column into an edit field.

Definition at line 44 of file predicateinput.hxx.

Constructor & Destructor Documentation

◆ OPredicateInputController()

dbtools::OPredicateInputController::OPredicateInputController ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::sdbc::XConnection > &  _rxConnection,
const ::connectivity::IParseContext _pParseContext = nullptr 
)

Member Function Documentation

◆ getPredicateValue()

Any dbtools::OPredicateInputController::getPredicateValue ( const OUString &  _rPredicateValue,
const css::uno::Reference< css::beans::XPropertySet > &  _rxField 
) const

get the value of the predicate, either as an empty or as a string

Parameters
_rPredicateValuethe value which has been normalized using normalizePredicateString
_rxFieldis the field for which a predicate is to be entered
See also
normalizePredicateString

Definition at line 327 of file predicateinput.cxx.

References Any, implParseNode(), and implPredicateTree().

◆ getPredicateValueStr() [1/2]

OUString dbtools::OPredicateInputController::getPredicateValueStr ( const OUString &  _rPredicateValue,
const css::uno::Reference< css::beans::XPropertySet > &  _rxField 
) const

get the value of the predicate, as a string to be used in a WHERE clause

Parameters
_rPredicateValuethe value which has been normalized using normalizePredicateString
_rxFieldis the field for which a predicate is to be entered
See also
normalizePredicateString

◆ getPredicateValueStr() [2/2]

OUString dbtools::OPredicateInputController::getPredicateValueStr ( const OUString &  _sField,
const OUString &  _rPredicateValue 
) const

◆ getSeparatorChars()

bool dbtools::OPredicateInputController::getSeparatorChars ( const css::lang::Locale &  _rLocale,
sal_Unicode _rDecSep,
sal_Unicode _rThdSep 
) const
private

◆ implParseNode()

Any dbtools::OPredicateInputController::implParseNode ( std::unique_ptr<::connectivity::OSQLParseNode pParseNode,
bool  _bForStatementUse 
) const
private

◆ implPredicateTree()

std::unique_ptr< OSQLParseNode > dbtools::OPredicateInputController::implPredicateTree ( OUString &  _rErrorMessage,
const OUString &  _rStatement,
const css::uno::Reference< css::beans::XPropertySet > &  _rxField 
) const
private

◆ normalizePredicateString()

bool dbtools::OPredicateInputController::normalizePredicateString ( OUString &  _rPredicateValue,
const css::uno::Reference< css::beans::XPropertySet > &  _rxField,
OUString *  _pErrorMessage = nullptr 
) const

transforms a "raw" predicate value (usually obtained from a user input) into a valid predicate for the given column

Parameters
_rPredicateValueThe text to normalize.
_rxFieldThe field for which the text should be a predicate value.
_pErrorMessageIf not <NULL>, and a parsing error occurs, the error message will be copied to the string the argument points to.

Definition at line 226 of file predicateinput.cxx.

References connectivity::OSQLParser::getContext(), connectivity::IParseContext::getPreferredLocale(), getSeparatorChars(), implPredicateTree(), m_aParser, m_xConnection, and m_xFormatter.

Member Data Documentation

◆ m_aParser

::connectivity::OSQLParser dbtools::OPredicateInputController::m_aParser
private

◆ m_xConnection

css::uno::Reference< css::sdbc::XConnection > dbtools::OPredicateInputController::m_xConnection
private

◆ m_xFormatter

css::uno::Reference< css::util::XNumberFormatter > dbtools::OPredicateInputController::m_xFormatter
private

◆ m_xLocaleData

css::uno::Reference< css::i18n::XLocaleData4 > dbtools::OPredicateInputController::m_xLocaleData
private

Definition at line 52 of file predicateinput.hxx.

Referenced by getSeparatorChars(), and OPredicateInputController().


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