本文整理汇总了C++中capitalize函数的典型用法代码示例。如果您正苦于以下问题:C++ capitalize函数的具体用法?C++ capitalize怎么用?C++ capitalize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了capitalize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_close
int on_close() {
object remote;
if( this_object()->query_closed() ) {
msg(capitalize((string) this_object()->query_specific()) + " is already closed. Attempting to close it further would likely arouse undesired criticism.");
return 1;
}
if( query_locked() ) {
msg( capitalize(this_object()->query_specific()) + " is locked. You can't close it.");
return 1;
}
set_target( MOBJ );
this_player()->msg_local( "~CACT~Name ~verbclose ~targ.~CDEF" );
this_object()->set_closed( 1 );
return 1;
}
示例2: on_open
int on_open() {
object remote;
if( !this_object()->query_closed() ) {
msg(capitalize((string) this_object()->query_specific()) + " is already open. Attempting to open it again would just look strange.");
return 1;
}
if( query_locked() ) {
msg( capitalize(this_object()->query_specific()) + " is locked. You can't open it.");
return 1;
}
set_target( MOBJ );
this_player()->msg_local( "~CACT~Name ~verbopen ~targ.~CDEF" );
this_object()->set_closed( 0 );
return 1;
}
示例3: do_delete
void do_delete( CHAR_DATA * ch, char * argument ) {
DESCRIPTOR_DATA * d;
if ( !ch->desc ) {
return;
}
if ( str_cmp( ch->desc->incomm, "delete yes" ) ) {
send_to_char( C_DEFAULT, "If you want to DELETE yourself, type 'delete yes'\n\r", ch );
return;
}
if ( ch->desc->original || IS_NPC( ch ) ) {
send_to_char( C_DEFAULT, "You may not delete a switched character.\n\r", ch );
return;
}
stop_fighting( ch, TRUE );
send_to_char( C_DEFAULT, "You are no more.\n\r", ch );
act( AT_BLOOD, "$n is no more.", ch, NULL, NULL, TO_ROOM );
info( "%s is no more.", (int)( ch->name ), 0 );
sprintf( log_buf, "$N has DELETED in room vnum %d.", ch->in_room->vnum );
wiznet( log_buf, ch, NULL, WIZ_LOGINS, 0, 0 );
// delete player file
sprintf( log_buf, "%s%c/%s", PLAYER_DIR, LOWER( ch->name[ 0 ] ), capitalize( ch->name ) );
remove( log_buf );
// delete finger file
sprintf( log_buf, "%s%c/%s.fng", PLAYER_DIR, LOWER( ch->name[ 0 ] ), capitalize( ch->name ) );
remove( log_buf );
// delete corpses
sprintf( log_buf, "%s%c/%s.cps", PLAYER_DIR, LOWER( ch->name[ 0 ] ), capitalize( ch->name ) );
remove( log_buf );
delete_playerlist( ch->name );
d = ch->desc;
extract_char( ch, TRUE );
if ( d ) {
close_socket( d );
}
return;
}
示例4: remove_user
static int remove_user(string where, int verbose, int flag, int test) {
string name, wiz_dir, tmp;
sscanf(where, "%s" + __SAVE_EXTENSION__, name);
wiz_dir = HOME_DIRS + extract(name, 0, 0) + "/" + name + "/";
total++;
// Don't want to purge admins -- Rust
if( adminp(name) ) return 0;
tmp = capitalize(name);
if(flag == 2 && directory_exists(wiz_dir)) {
/*
if(!test) CLEAN_D->clean_dir(wiz_dir);
*/
// Rather than delete the dirs, move them to /purged/name/blah
// inspiral.
if( !test ) "/adm/daemons/move_dir" -> clean_dir( wiz_dir );
tmp += " and " + wiz_dir + " " + (test ? "flagged" : "deleted") + ".\n";
}
else tmp += " " + (test ? "flagged" : "deleted") + ".\n";
if(!test) {
rm(DATA_DIR + "/std/user/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
rm(PDATA_DIR + "/" + name[0..0] + "/" + name + __SAVE_EXTENSION__);
}
if(verbose) write(tmp);
return 1; }
示例5: javaNameSpec
WrapperStr UmlOperation::compute_name()
{
WrapperStr get_set_spec = javaNameSpec();
if (! get_set_spec.isEmpty()) {
UmlClassMember * it;
if ((it = getOf()) == 0)
it = setOf();
int index;
WrapperStr s = (it->kind() == aRelation)
? ((UmlRelation *) it)->roleName()
: it->name();
if ((index = get_set_spec.find("${name}")) != -1)
get_set_spec.replace(index, 7, s);
else if ((index = get_set_spec.find("${Name}")) != -1)
get_set_spec.replace(index, 7, capitalize(s));
else if ((index = s.find("${NAME}")) != -1)
get_set_spec.replace(index, 7, s.upper());
else if ((index = s.find("${nAME}")) != -1)
get_set_spec.replace(index, 7, s.lower());
return get_set_spec;
}
else
return name();
}
示例6: direct_drink_from_obj
mixed direct_drink_from_obj() {
object ob;
if (this_object()->query_closed())
return capitalize(the_short()) + " is closed.\n";
if (needs_contents)
ob = first_inventory();
else
ob = this_object();
if (!ob)
return capitalize(the_short()) + " is empty.\n";
return ob->direct_drink_obj();
}
示例7: repl
void repl() {
SqlParser parser;
while (true) {
std::string command = read_command();
std::string::size_type first_space = command.find_first_of(" ");
std::string fst_token = first_space == string::npos ? command : command.substr(0, first_space);
capitalize(&fst_token);
#ifdef MAIN_DBG
Utils::info("[REPL] execute \"" + command +"\"");
#endif
if (fst_token.compare("QUIT") == 0 || fst_token.compare("EXIT") == 0) {
return;
} else if (fst_token.compare("PURGE") == 0) {
BufferManager &bm = BufferManager::get_instance();
bm.purge();
std::cout << "Purge has been done" << std::endl;
} else if (fst_token.compare("BMST") == 0) {
std::cout << "BufferManager state:" << std::endl;
std::cout << " Pinned pages: " + std::to_string(BufferManager::get_instance().get_pinned_page_count()) << std::endl;
BufferManager::get_instance().print_pinned_page();
} else if (fst_token.compare("ABOUT") == 0) {
std::string table_name = command.substr(6);
#ifdef MAIN_DBG
Utils::info("[REPL] 'about' was called for " + table_name);
#endif
describe_table(table_name);
} else {
SqlStatement const * stmt = parser.parse(command);
DBFacade::get_instance()->execute_statement(stmt);
delete stmt;
}
}
}
示例8: _
String ActionStack::redoName() const {
if (canRedo()) {
return _(" ") + capitalize(redo_actions.back()->getName(false));
} else {
return wxEmptyString;
}
}
示例9: while
/* current line has first token removed (instruction) and comments
* removed. Now go through the rest and assume they're instructions
* separated with ','
*/
struct instruction *get_operands(struct instruction *cur)
{
int cur_op_num;
char *buf;
/* check for operands */
cur_op_num = 0;
while ((buf = (char *) strtok(NULL, comma)))
{
remove_whitespace(buf); //remove any tabs etc.
if (strlen(buf) > 0) {
if (!cur->operands)
cur->operands = (char **) malloc(sizeof( char *));
else
cur->operands = (char **) realloc(cur->operands, (sizeof(char *)*(cur_op_num+1)));
capitalize(buf);
cur->operands[cur_op_num] = (char *) malloc(strlen(buf) );
strcpy(cur->operands[cur_op_num], buf);
cur->op_num = ++cur_op_num;
}
}
cur->op_num = cur_op_num;
return cur;
}
示例10: tr
void DictFilterConfig::doMenu(const QAction * i)
{
if (i == addA) {
if ( input.count() == 0 ) {
QMessageBox::information(0, tr("Adding Words"),
tr("<qt>To add words, pick the letters, then "
"open the Add dialog. In that dialog, tap "
"the correct letters from the list "
"(tap twice for capitals).</qt>"));
} else {
PickboardAdd add(parent,capitalize(input));
if ( add.exec() )
generateText(add.word());
input.clear();
matches.clear();
updateRows(0,0);
}
} else if (i == resetA) {
if ( !input.isEmpty() ) {
input.clear();
matches.clear();
StringConfig::doMenu(i);
updateRows(0,1);
} else {
reset();
}
} else {
StringConfig::doMenu(i);
}
shift = 0;
lit0 = -1;
}
示例11: raise
mixed raise(string str, int skill, int cast) {
mixed ob;
if (!str || str == "")
return "You try to raise nothing and fail miserably.\n";
ob = find_match(str, environment(this_player()));
if (sizeof(ob))
ob = ob[0];
else
return "Who is " + capitalize(str) + "?\n";
if (!living(ob))
return (string)ob->query_cap_name() + " refuses to be brought to life.\n";
if (!ob->query_property("dead"))
return (string)ob->query_cap_name() + " is not dead ... yet.\n";
if (ob->query_property("noregen"))
return "Death tells you: HOLD ON, I'M NOT FINISHED WITH THEM YET.\n";
if (cast && (int)this_player()->adjust_gp(-SP_COST) < 0)
return "Too low on power.\n";
write("You call upon the gods to restore " + (string)ob->query_cap_name() +
" from " + (string)ob->query_possessive() + " immaterial state.\n");
tell_object(ob, (string)this_player()->query_cap_name() +
" summons the gods for you.\n");
say((string)this_player()->query_cap_name() + " summons the gods to raise " +
(string)ob->query_cap_name() + " from the dead.\n", ob);
ob->remove_ghost();
return 1;
}
示例12: switch
void CAdministrationWindow::flush(CMySQLServer *m, int flush_type)
{
QString f = QString::null;
switch (flush_type)
{
case FLUSH_HOSTS: f = "HOSTS";
break;
case FLUSH_LOGS: f = "LOGS";
break;
case FLUSH_PRIVILEGES: f = "PRIVILEGES";
break;
case FLUSH_TABLES: f = "TABLES";
break;
case FLUSH_STATUS: f = "STATUS";
break;
case FLUSH_TABLES_RL: f = "TABLES WITH READ LOCK";
break;
case FLUSH_DES_KEY_FILE: f = "DES_KEY_FILE";
break;
case FLUSH_QUERY_CACHE: f = "QUERY CACHE";
break;
case FLUSH_USER_RESOURCES: f = "USER_RESOURCES";
break;
}
CMySQLQuery *qry = new CMySQLQuery(m->mysql());
qry->setEmitMessages(false);
if (qry->execStaticQuery("FLUSH " + f))
m->messagePanel()->information("Flush " + capitalize(f) + " " + tr("successful"));
delete qry;
}
示例13: _query_long
string _query_long()
{
string str;
str=player->name();
return capitalize(str)+" ist "+str+" ist "+str+".\n";
}
示例14: can_cast
int can_cast(object tp, object tgt) {
if (!tp) return 0;
if (environment(tp)->query_property("no attack") ||
environment(tp)->query_property("no magic"))
FAIL("Some force prevents your magic.");
if (tp->query_busy())
FAIL("You are busy.");
if (tp->query_ghost())
FAIL("It is too dangerous to manipulate such "
"powerful magic in your current state.");
if (!tgt)
FAIL("Polymorph who?");
if (!(tgt->is_player() || tgt->is_monster()))
FAIL("This magic only works against living things.");
if (tgt->query_property("no polymorph") ||
tgt->query_property("no magic"))
FAIL(tgt->query_cap_name()+" is immune to such magic.");
if (tgt->query_effect("polymorph"))
FAIL(
(tgt == tp ? "You have" : capitalize(tgt->query_subjective())+" has")+
" already been polymorphed!");
if (tp->query_mp() < 100)
FAIL("Your magic is too low.");
return 1;
}
示例15: capitalize
QString DictFilterConfig::text(int r, int i)
{
QStringList l = r ? sets_a : input.isEmpty() ? othermodes : matches;
return i < (int)l.count() ?
(input.isEmpty() ? l[i] : capitalize(l[i]))
: QString();
}