本文整理汇总了C++中firebird::string::find方法的典型用法代码示例。如果您正苦于以下问题:C++ string::find方法的具体用法?C++ string::find怎么用?C++ string::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类firebird::string
的用法示例。
在下文中一共展示了string::find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isc_delete_user
ISC_STATUS API_ROUTINE isc_delete_user(ISC_STATUS* status, const USER_SEC_DATA* input_user_data)
{
/**************************************
*
* i s c _ d e l e t e _ u s e r
*
**************************************
*
* Functional description
* Deletes a user from the server's security
* database.
* Return 0 if the user was deleted
*
* Return > 0 if any error occurs.
*
**************************************/
Auth::StackUserData userInfo;
userInfo.op = Auth::DEL_OPER;
Firebird::LocalStatus s;
Firebird::CheckStatusWrapper statusWrapper(&s);
if (input_user_data->user_name)
{
Firebird::string work = input_user_data->user_name;
if (work.length() > USERNAME_LENGTH) {
return user_error(status, isc_usrname_too_long);
}
Firebird::string::size_type l = work.find(' ');
if (l != Firebird::string::npos) {
work.resize(l);
}
userInfo.user.set(&statusWrapper, work.c_str());
Firebird::check(&statusWrapper);
userInfo.user.setEntered(&statusWrapper, 1);
Firebird::check(&statusWrapper);
}
else {
return user_error(status, isc_usrname_required);
}
return executeSecurityCommand(status, input_user_data, userInfo);
}
示例2: isc_modify_user
ISC_STATUS API_ROUTINE isc_modify_user(ISC_STATUS* status, const USER_SEC_DATA* input_user_data)
{
/**************************************
*
* i s c _ m o d i f y _ u s e r
*
**************************************
*
* Functional description
* Adds a user to the server's security
* database.
* Return 0 if the user was added
*
* Return > 0 if any error occurs.
*
**************************************/
Auth::StackUserData userInfo;
userInfo.op = Auth::MOD_OPER;
Firebird::LocalStatus s;
Firebird::CheckStatusWrapper statusWrapper(&s);
if (input_user_data->user_name)
{
Firebird::string work = input_user_data->user_name;
if (work.length() > USERNAME_LENGTH) {
return user_error(status, isc_usrname_too_long);
}
Firebird::string::size_type l = work.find(' ');
if (l != Firebird::string::npos) {
work.resize(l);
}
userInfo.user.set(&statusWrapper, work.c_str());
check(&statusWrapper);
userInfo.user.setEntered(&statusWrapper, 1);
check(&statusWrapper);
}
else {
return user_error(status, isc_usrname_required);
}
if (input_user_data->password)
{
userInfo.pass.set(&statusWrapper, input_user_data->password);
check(&statusWrapper);
userInfo.pass.setEntered(&statusWrapper, 1);
check(&statusWrapper);
}
else {
return user_error(status, isc_password_required);
}
copyField(userInfo.u, input_user_data->uid, input_user_data->sec_flags & sec_uid_spec);
copyField(userInfo.g, input_user_data->gid, input_user_data->sec_flags & sec_gid_spec);
copyField(userInfo.group, input_user_data->group_name, input_user_data->sec_flags & sec_group_name_spec);
copyField(userInfo.first, input_user_data->first_name, input_user_data->sec_flags & sec_first_name_spec);
copyField(userInfo.middle, input_user_data->middle_name, input_user_data->sec_flags & sec_middle_name_spec);
copyField(userInfo.last, input_user_data->last_name, input_user_data->sec_flags & sec_last_name_spec);
return executeSecurityCommand(status, input_user_data, userInfo);
}