mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
Merge from pocoproject/develop
Signed-off-by: FrancisANDRE <zosrothko@orange.fr>
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -319,6 +319,16 @@ public:
|
|||||||
/// Returns true if there is at least one row in the RecordSet,
|
/// Returns true if there is at least one row in the RecordSet,
|
||||||
/// false otherwise.
|
/// false otherwise.
|
||||||
|
|
||||||
|
using Statement::reset;
|
||||||
|
/// Don't hide base class method.
|
||||||
|
|
||||||
|
void reset(const Statement& stmt);
|
||||||
|
/// Resets the RecordSet and assigns a new statement.
|
||||||
|
/// Should be called after the given statement has been reset,
|
||||||
|
/// assigned a new SQL statement, and executed.
|
||||||
|
///
|
||||||
|
/// Does not remove the associated RowFilter or RowFormatter.
|
||||||
|
|
||||||
Poco::Dynamic::Var value(const std::string& name) const;
|
Poco::Dynamic::Var value(const std::string& name) const;
|
||||||
/// Returns the value in the named column of the current row.
|
/// Returns the value in the named column of the current row.
|
||||||
|
|
||||||
@@ -473,7 +483,6 @@ private:
|
|||||||
void filter(RowFilter* pFilter);
|
void filter(RowFilter* pFilter);
|
||||||
/// Sets the filter for the RecordSet.
|
/// Sets the filter for the RecordSet.
|
||||||
|
|
||||||
|
|
||||||
const RowFilter* getFilter() const;
|
const RowFilter* getFilter() const;
|
||||||
/// Returns the filter associated with the RecordSet.
|
/// Returns the filter associated with the RecordSet.
|
||||||
|
|
||||||
@@ -493,6 +502,7 @@ private:
|
|||||||
/// inlines
|
/// inlines
|
||||||
///
|
///
|
||||||
|
|
||||||
|
|
||||||
inline Data_API std::ostream& operator << (std::ostream &os, const RecordSet& rs)
|
inline Data_API std::ostream& operator << (std::ostream &os, const RecordSet& rs)
|
||||||
{
|
{
|
||||||
return rs.copy(os);
|
return rs.copy(os);
|
||||||
@@ -534,8 +544,8 @@ inline std::size_t RecordSet::columnCount() const
|
|||||||
|
|
||||||
inline Statement& RecordSet::operator = (const Statement& stmt)
|
inline Statement& RecordSet::operator = (const Statement& stmt)
|
||||||
{
|
{
|
||||||
_currentRow = 0;
|
reset(stmt);
|
||||||
return Statement::operator = (stmt);
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -663,36 +673,6 @@ inline size_t RecordSet::storageRowCount() const
|
|||||||
return impl()->rowsExtracted();
|
return impl()->rowsExtracted();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO
|
|
||||||
namespace Keywords {
|
|
||||||
|
|
||||||
|
|
||||||
inline const std::string& select(const std::string& str)
|
|
||||||
{
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const RecordSet& from(const RecordSet& rs)
|
|
||||||
{
|
|
||||||
return rs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline RecordSet from(const Statement& stmt)
|
|
||||||
{
|
|
||||||
return RecordSet(stmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const std::string& where(const std::string& str)
|
|
||||||
{
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Keywords
|
|
||||||
*/
|
|
||||||
|
|
||||||
} } // namespace Poco::Data
|
} } // namespace Poco::Data
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ RecordSet::RecordSet(const RecordSet& other):
|
|||||||
_pFilter(other._pFilter),
|
_pFilter(other._pFilter),
|
||||||
_totalRowCount(other._totalRowCount)
|
_totalRowCount(other._totalRowCount)
|
||||||
{
|
{
|
||||||
|
if (_pFilter) _pFilter->duplicate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -92,6 +93,27 @@ RecordSet::~RecordSet()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RecordSet::reset(const Statement& stmt)
|
||||||
|
{
|
||||||
|
delete _pBegin;
|
||||||
|
_pBegin = 0;
|
||||||
|
delete _pEnd;
|
||||||
|
_pEnd = 0;
|
||||||
|
_currentRow = 0;
|
||||||
|
_totalRowCount = UNKNOWN_TOTAL_ROW_COUNT;
|
||||||
|
|
||||||
|
RowMap::iterator it = _rowMap.begin();
|
||||||
|
RowMap::iterator end = _rowMap.end();
|
||||||
|
for (; it != end; ++it) delete it->second;
|
||||||
|
_rowMap.clear();
|
||||||
|
|
||||||
|
Statement::operator = (stmt);
|
||||||
|
|
||||||
|
_pBegin = new RowIterator(this, 0 == rowsExtracted());
|
||||||
|
_pEnd = new RowIterator(this, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Poco::Dynamic::Var RecordSet::value(std::size_t col, std::size_t dataRow, bool useFilter) const
|
Poco::Dynamic::Var RecordSet::value(std::size_t col, std::size_t dataRow, bool useFilter) const
|
||||||
{
|
{
|
||||||
if (useFilter && isFiltered() && !isAllowed(dataRow))
|
if (useFilter && isFiltered() && !isAllowed(dataRow))
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ POrtable COmponents C++ Libraries are:
|
|||||||
- Open Source, licensed under the [Boost Software License](https://spdx.org/licenses/BSL-1.0).
|
- Open Source, licensed under the [Boost Software License](https://spdx.org/licenses/BSL-1.0).
|
||||||
|
|
||||||
----
|
----
|
||||||
To start using POCO, see the [Guided Tour](http://pocoproject.org/docs-1.5.3/00100-GuidedTour.html) and [Getting Started](http://pocoproject.org/docs-1.5.3/00200-GettingStarted.html) documents.
|
To start using POCO, see the [Guided Tour](http://pocoproject.org/docs/00100-GuidedTour.html) and [Getting Started](http://pocoproject.org/docs/00200-GettingStarted.html) documents.
|
||||||
|
|
||||||
----
|
----
|
||||||
POCO has an active user and contributing community, please visit our [web site](http://pocoproject.org), [forum](http://pocoproject.org/forum) and [blog](http://pocoproject.org/blog).
|
POCO has an active user and contributing community, please visit our [web site](http://pocoproject.org), [forum](http://pocoproject.org/forum) and [blog](http://pocoproject.org/blog).
|
||||||
|
|||||||
@@ -1038,7 +1038,7 @@ XML_GetFeatureList(void);
|
|||||||
*/
|
*/
|
||||||
#define XML_MAJOR_VERSION 2
|
#define XML_MAJOR_VERSION 2
|
||||||
#define XML_MINOR_VERSION 1
|
#define XML_MINOR_VERSION 1
|
||||||
#define XML_MICRO_VERSION 0
|
#define XML_MICRO_VERSION 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1685,6 +1685,10 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
|
|||||||
void * XMLCALL
|
void * XMLCALL
|
||||||
XML_GetBuffer(XML_Parser parser, int len)
|
XML_GetBuffer(XML_Parser parser, int len)
|
||||||
{
|
{
|
||||||
|
if (len < 0) {
|
||||||
|
errorCode = XML_ERROR_NO_MEMORY;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
switch (ps_parsing) {
|
switch (ps_parsing) {
|
||||||
case XML_SUSPENDED:
|
case XML_SUSPENDED:
|
||||||
errorCode = XML_ERROR_SUSPENDED;
|
errorCode = XML_ERROR_SUSPENDED;
|
||||||
@@ -1696,8 +1700,11 @@ XML_GetBuffer(XML_Parser parser, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len > bufferLim - bufferEnd) {
|
if (len > bufferLim - bufferEnd) {
|
||||||
/* FIXME avoid integer overflow */
|
|
||||||
int neededSize = len + (int)(bufferEnd - bufferPtr);
|
int neededSize = len + (int)(bufferEnd - bufferPtr);
|
||||||
|
if (neededSize < 0) {
|
||||||
|
errorCode = XML_ERROR_NO_MEMORY;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
#ifdef XML_CONTEXT_BYTES
|
#ifdef XML_CONTEXT_BYTES
|
||||||
int keep = (int)(bufferPtr - buffer);
|
int keep = (int)(bufferPtr - buffer);
|
||||||
|
|
||||||
@@ -1726,7 +1733,11 @@ XML_GetBuffer(XML_Parser parser, int len)
|
|||||||
bufferSize = INIT_BUFFER_SIZE;
|
bufferSize = INIT_BUFFER_SIZE;
|
||||||
do {
|
do {
|
||||||
bufferSize *= 2;
|
bufferSize *= 2;
|
||||||
} while (bufferSize < neededSize);
|
} while (bufferSize < neededSize && bufferSize > 0);
|
||||||
|
if (bufferSize <= 0) {
|
||||||
|
errorCode = XML_ERROR_NO_MEMORY;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
newBuf = (char *)MALLOC(bufferSize);
|
newBuf = (char *)MALLOC(bufferSize);
|
||||||
if (newBuf == 0) {
|
if (newBuf == 0) {
|
||||||
errorCode = XML_ERROR_NO_MEMORY;
|
errorCode = XML_ERROR_NO_MEMORY;
|
||||||
@@ -2918,6 +2929,8 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
|
|||||||
unsigned long uriHash = hash_secret_salt;
|
unsigned long uriHash = hash_secret_salt;
|
||||||
((XML_Char *)s)[-1] = 0; /* clear flag */
|
((XML_Char *)s)[-1] = 0; /* clear flag */
|
||||||
id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
|
id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
|
||||||
|
if (!id || !id->prefix)
|
||||||
|
return XML_ERROR_NO_MEMORY;
|
||||||
b = id->prefix->binding;
|
b = id->prefix->binding;
|
||||||
if (!b)
|
if (!b)
|
||||||
return XML_ERROR_UNBOUND_PREFIX;
|
return XML_ERROR_UNBOUND_PREFIX;
|
||||||
@@ -5482,6 +5495,8 @@ getAttributeId(XML_Parser parser, const ENCODING *enc,
|
|||||||
return NULL;
|
return NULL;
|
||||||
id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
|
id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
|
||||||
sizeof(PREFIX));
|
sizeof(PREFIX));
|
||||||
|
if (!id->prefix)
|
||||||
|
return NULL;
|
||||||
if (id->prefix->name == poolStart(&dtd->pool))
|
if (id->prefix->name == poolStart(&dtd->pool))
|
||||||
poolFinish(&dtd->pool);
|
poolFinish(&dtd->pool);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user