LibreOffice Module connectivity (master) 1
|
A class which allows input of an SQL predicate for a row set column into an edit field. More...
#include <predicateinput.hxx>
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::OSQLParseNode > | implPredicateTree (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 |
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.
dbtools::OPredicateInputController::OPredicateInputController | ( | const css::uno::Reference< css::uno::XComponentContext > & | rxContext, |
const css::uno::Reference< css::sdbc::XConnection > & | _rxConnection, | ||
const ::connectivity::IParseContext * | _pParseContext = nullptr |
||
) |
Definition at line 96 of file predicateinput.cxx.
References Exception, dbtools::getNumberFormats(), m_xConnection, m_xConnection, m_xFormatter, m_xLocaleData, and TOOLS_WARN_EXCEPTION.
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
_rPredicateValue | the value which has been normalized using normalizePredicateString |
_rxField | is the field for which a predicate is to be entered |
Definition at line 327 of file predicateinput.cxx.
References Any, implParseNode(), and implPredicateTree().
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
_rPredicateValue | the value which has been normalized using normalizePredicateString |
_rxField | is the field for which a predicate is to be entered |
OUString dbtools::OPredicateInputController::getPredicateValueStr | ( | const OUString & | _sField, |
const OUString & | _rPredicateValue | ||
) | const |
Definition at line 282 of file predicateinput.cxx.
References connectivity::OSQLParser::getContext(), connectivity::OSQLParser::getFunctionReturnType(), implParseNode(), implPredicateTree(), m_aParser, m_xConnection, nIndex, nType, and xColumn.
|
private |
Definition at line 73 of file predicateinput.cxx.
References Exception, dbtools::lcl_getSeparatorChar(), m_xLocaleData, and TOOLS_WARN_EXCEPTION.
Referenced by implPredicateTree(), and normalizePredicateString().
|
private |
Definition at line 346 of file predicateinput.cxx.
References Any, connectivity::OSQLParseNode::getByRule(), connectivity::OSQLParseNode::getChild(), connectivity::OSQLParser::getContext(), connectivity::OSQLParseNode::getNodeType(), connectivity::OSQLParseNode::getParent(), connectivity::OSQLParseNode::getTokenValue(), m_aParser, m_xConnection, connectivity::OSQLParseNode::odbc_fct_spec, connectivity::OSQLParseNode::parseNodeToStr(), connectivity::String, and connectivity::OSQLParseNode::test_for_null.
Referenced by getPredicateValue(), and getPredicateValueStr().
|
private |
Definition at line 129 of file predicateinput.cxx.
References Exception, connectivity::OSQLParser::getContext(), connectivity::IParseContext::getPreferredLocale(), getSeparatorChars(), Locale, m_aParser, m_xFormatter, nType, TOOLS_WARN_EXCEPTION, and u.
Referenced by getPredicateValue(), getPredicateValueStr(), and 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
_rPredicateValue | The text to normalize. |
_rxField | The field for which the text should be a predicate value. |
_pErrorMessage | If 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.
|
private |
Definition at line 55 of file predicateinput.hxx.
Referenced by getPredicateValueStr(), implParseNode(), implPredicateTree(), and normalizePredicateString().
|
private |
Definition at line 48 of file predicateinput.hxx.
Referenced by getPredicateValueStr(), implParseNode(), normalizePredicateString(), and OPredicateInputController().
|
private |
Definition at line 50 of file predicateinput.hxx.
Referenced by implPredicateTree(), normalizePredicateString(), and OPredicateInputController().
|
private |
Definition at line 52 of file predicateinput.hxx.
Referenced by getSeparatorChars(), and OPredicateInputController().