本文整理汇总了C++中stringlist::const_iterator::size方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::size方法的具体用法?C++ const_iterator::size怎么用?C++ const_iterator::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stringlist::const_iterator
的用法示例。
在下文中一共展示了const_iterator::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isNotPrintable
bool LDAPAttribute::isNotPrintable() const {
StringList::const_iterator i;
for(i=m_values.begin(); i!=m_values.end(); i++) {
size_t len = i->size();
for(size_t j=0; j<len; j++) {
if (! isprint( (i->data())[j] ) ) {
return true;
}
}
}
return false;
}
示例2: Execute
virtual void Execute(const std::string& sExecute, const StringList& rlsParams)
{
STAFF_ASSERT(m_pProvider != NULL && m_pProvider->m_pImpl->m_pConn != NULL, "Not Initialized");
Reset();
std::string sExecuteParams = sExecute;
int nIndex = 1;
std::string sIndex;
unsigned nCount = 0;
std::string::size_type nPos = 0;
while ((nPos = sExecuteParams.find("?", nPos)) != std::string::npos)
{
ToString(nIndex, sIndex);
sExecuteParams.replace(nPos, 1, "$" + sIndex);
nPos += sIndex.size() + 1;
++nCount;
++nIndex;
}
STAFF_ASSERT(nCount == rlsParams.size(), "Params count mismatch");
int* panParamLengths = new int[nCount];
int* panParamFormats = new int[nCount];
char** paszParamValues = new char*[nCount];
try
{
unsigned nPos = 0;
for (StringList::const_iterator itParam = rlsParams.begin();
itParam != rlsParams.end(); ++itParam, ++nPos)
{
panParamFormats[nPos] = 0;
if (*itParam == STAFF_DAS_NULL_VALUE)
{
panParamLengths[nPos] = 0;
paszParamValues[nPos] = NULL;
}
else
{
panParamLengths[nPos] = itParam->size();
paszParamValues[nPos] = const_cast<char*>(itParam->c_str());
}
}
m_pResult = PQexecParams(m_pProvider->m_pImpl->m_pConn,
sExecuteParams.c_str(), nCount, NULL, paszParamValues, panParamLengths, panParamFormats, 0);
delete[] paszParamValues;
delete[] panParamFormats;
delete[] panParamLengths;
}
catch(...)
{
delete[] paszParamValues;
delete[] panParamFormats;
delete[] panParamLengths;
throw;
}
ExecStatusType tQueryStatus = PQresultStatus(m_pResult);
if (tQueryStatus != PGRES_COMMAND_OK)
{
STAFF_ASSERT(tQueryStatus == PGRES_TUPLES_OK, "error executing query #"
+ ToString(tQueryStatus) + ": \n"
+ std::string(PQerrorMessage(m_pProvider->m_pImpl->m_pConn))
+ "\nQuery was:\n----------\n" + sExecute + "\n----------\n");
m_nRowsCount = static_cast<unsigned>(PQntuples(m_pResult));
m_nFieldsCount = static_cast<unsigned>(PQnfields(m_pResult));
}
}