本文整理汇总了C++中Row::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ Row::empty方法的具体用法?C++ Row::empty怎么用?C++ Row::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row::empty方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: identifyType
uint32 GDAFile::identifyType(const Columns &columns, const Row &rows, size_t column) const {
if (!columns || (column >= columns->size()) || !(*columns)[column])
return -1;
if ((*columns)[column]->hasField(kGFF4G2DAColumnType))
return (uint32) (*columns)[column]->getUint(kGFF4G2DAColumnType, -1);
if (!rows || rows->empty() || !(*rows)[0])
return -1;
GFF4Struct::FieldType fieldType = (*rows)[0]->getFieldType(kGFF4G2DAColumn1 + column);
switch (fieldType) {
case GFF4Struct::kFieldTypeString:
return 0;
case GFF4Struct::kFieldTypeUint:
case GFF4Struct::kFieldTypeSint:
return 1;
case GFF4Struct::kFieldTypeDouble:
return 2;
default:
break;
}
return -1;
}
示例2: selectValue
Value Connection::selectValue(const std::string& query)
{
Row t = selectRow(query);
if (t.empty())
throw NotFound();
return t.getValue(0);
}
示例3: selectValue
Value Connection::selectValue(const std::string& query)
{
log_debug("selectValue(\"" << query << "\")");
Row t = selectRow(query);
if (t.empty())
throw NotFound();
return t.getValue(0);
}
示例4: readMemberID
size_t IRCBot::readMemberID( string memberName) {
size_t memberID = 0;
Row Smoking = _db->memberRead(memberName);
if(Smoking.empty())
return 0;
memberID = ((size_t) Smoking["memberID"]);
return memberID;
}
示例5: readServerName
size_t IRCBot::readServerName(string serverName) {
size_t serverID = 0;
if(! _db->ready() )
return 0;
Row Smoking = _db->serverRead(serverName);
if(Smoking.empty())
return 0;
serverID = ((size_t) Smoking["serverID"]);
return serverID;
}
示例6: genBiosInfo
QueryData genBiosInfo(QueryContext& context) {
QueryData results;
std::string manufacturer;
WmiRequest wmiComputerSystemReq(
"select Manufacturer from Win32_ComputerSystem");
std::vector<WmiResultItem>& wmiComputerSystemResults =
wmiComputerSystemReq.results();
if (!wmiComputerSystemResults.empty()) {
wmiComputerSystemResults[0].GetString("Manufacturer", manufacturer);
manufacturer = getManufacturer(manufacturer);
} else {
return results;
}
if (kQueryMap.find(manufacturer) != kQueryMap.end()) {
WmiRequest wmiBiosReq(std::get<0>(kQueryMap.at(manufacturer)),
(std::get<1>(kQueryMap.at(manufacturer))));
std::vector<WmiResultItem>& wmiResults = wmiBiosReq.results();
for (unsigned int i = 0; i < wmiResults.size(); ++i) {
Row r;
if (manufacturer == "hp") {
r = getHPBiosInfo(wmiResults[i]);
} else if (manufacturer == "lenovo") {
r = getLenovoBiosInfo(wmiResults[i]);
} else if (manufacturer == "dell") {
r = getDellBiosInfo(wmiResults[i]);
}
if (!r.empty()) {
results.push_back(r);
}
}
} else {
LOG(INFO) << "Vendor \"" << manufacturer << "\" is currently not supported";
}
return results;
}
示例7: a_Login
// Attempt to login to server
void moduleAuth::a_Login( void *buffer, size_t bufferSize ) {
const byte *bytePtr = (const byte*) buffer;
size_t dataSize = *((size_t*) bytePtr);
string username, password;
Row memberRow;
// Decrease the buffer, increase the byte ptr
bufferSize -= sizeof(size_t);
bytePtr += sizeof(size_t);
// Test data size against the buffersize
if( ( dataSize - bufferSize ) )
return;
// Grab the username, (grabs until byte 0x00)
username.append( (const char*) bytePtr);
// Increase the pointer, decrease remaining size
bufferSize -= username.size() + 1;
bytePtr += username.size() + 1;
// Grab the password, (grabs until byte 0x00)
password.append( (const char *) bytePtr );
// Read the user row from the member table
memberRow = _client->databaseGet()->memberRead( username );
// Check No Result, or member name/password doesn't match entered ones (enforce case)
if( memberRow.empty() || username.compare( memberRow["nameUser"] ) != 0 || password.compare( memberRow["password"] ) != 0 ) {
stringstream ircMessage;
ircMessage << "Login Attempt Failed. v" << _version << " " << username << " from ";
ircMessage << _client->remoteIPGet() << " (" << _client->ipResolve( _client->remoteIPGet() ) << ")";
_client->smokingmanGet()->thebotGet()->speak("Auth", ircMessage, channelADMIN);
_loginAttempts++;
packetSend( (byte) modAUTH_LoginFailed );
if( _loginAttempts > 2 ) {
packetSend( (byte) modAUTH_Disconnecting );
_client->shutdown();
}
return;
}
// Is this member active?
if( (bool) memberRow["active"] == false) {
stringstream ircMessage;
ircMessage << "Inactive member login attempt. v" << _version << " " << username << " from ";
ircMessage << _client->remoteIPGet() << " (" << _client->ipResolve( _client->remoteIPGet() ) << ")";
_client->smokingmanGet()->thebotGet()->speak("Auth", ircMessage, channelADMIN);
string reason = (string) memberRow["reason"];
packetSend( (byte) modAUTH_MemberInactive, reason );
packetSend( (byte) modAUTH_Disconnecting );
_client->shutdown();
return;
}
//
_userRow = memberRow;
// Check IP
//
if( ipValidate(_client->databaseGet(), _client->remoteIPGet(), memberIDGet() ) == false ) {
stringstream ircMessage;
ircMessage << "IP has no match. v" << _version << " " << username << " from ";
ircMessage << _client->remoteIPGet() << " (" << _client->ipResolve( _client->remoteIPGet() ) << ")";
_client->smokingmanGet()->thebotGet()->speak("Auth", ircMessage, channelADMIN);
packetSend( (byte) modAUTH_IPInvalid );
_client->shutdown();
return;
}
if( memberLevel() == levelSPIDZ ) {
stringstream ircMessage;
ircMessage << "connected. v" << _version;
_client->smokingmanGet()->thebotGet()->speak("spidz", ircMessage);
_client->smokingmanGet()->spidzSet( _client );
}
if(!_versionOk) {
stringstream ircMessage;
ircMessage << "[" << OSNameGet( _OS ) << "] " << memberUserNameGet() << " Old Client v" << _version << " from ";
ircMessage << _client->remoteIPGet() << " (" << _client->ipResolve( _client->remoteIPGet() ) << ")";
_client->smokingmanGet()->thebotGet()->speak("Auth", ircMessage, channelADMIN);
}
// Set our last online time
_client->databaseGet()->memberLastOnlineSet( memberRow["memberID"] );
// Success!
//.........这里部分代码省略.........
示例8: is_zero
bool is_zero(const Row & row) { return row.empty(); }