• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ capitalize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中capitalize函数的典型用法代码示例。如果您正苦于以下问题:C++ capitalize函数的具体用法?C++ capitalize怎么用?C++ capitalize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了capitalize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:shentino,项目名称:simud,代码行数:15,代码来源:lockable.c


示例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;
}
开发者ID:shentino,项目名称:simud,代码行数:15,代码来源:lockable.c


示例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;
}
开发者ID:zachflower,项目名称:oasis-mud,代码行数:48,代码来源:act_comm.c


示例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; }
开发者ID:Hobbitron,项目名称:tmi2_fluffos_v3,代码行数:31,代码来源:purge.c


示例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();
}
开发者ID:jeremysalwen,项目名称:douml,代码行数:29,代码来源:UmlOperation.cpp


示例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();
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:16,代码来源:m_drink_container.c


示例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;
    }
  }
}
开发者ID:deadok22,项目名称:shredder-db,代码行数:35,代码来源:main.cpp


示例8: _

String ActionStack::redoName() const {
	if (canRedo()) {
		return _(" ") + capitalize(redo_actions.back()->getName(false));
	} else {
		return wxEmptyString;
	}
}
开发者ID:BestRCH,项目名称:magicseteditor,代码行数:7,代码来源:action_stack.cpp


示例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;
}
开发者ID:ephesus,项目名称:Zasm2,代码行数:30,代码来源:pass.c


示例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;
}
开发者ID:Artox,项目名称:qtmoko,代码行数:32,代码来源:pickboardcfg.cpp


示例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;
}
开发者ID:quixadhal,项目名称:discworld,代码行数:27,代码来源:raise.c


示例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;
}
开发者ID:andrewbasterfield,项目名称:mysqlcc,代码行数:31,代码来源:CAdministrationWindow.cpp


示例13: _query_long

string _query_long()
{
  string str;

  str=player->name();
  return capitalize(str)+" ist "+str+" ist "+str+".\n";
}
开发者ID:Kebap,项目名称:mg-mudlib,代码行数:7,代码来源:tarnhelm_shadow.c


示例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;
}
开发者ID:ehershey,项目名称:pd,代码行数:35,代码来源:_polymorph.c


示例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();
}
开发者ID:Artox,项目名称:qtmoko,代码行数:7,代码来源:pickboardcfg.cpp


示例16: sure_to_suicide

void sure_to_suicide(string pa)
{
    // mixed er;
    string pass, str;
    object ob;
    if(((pass = (string)this_player()->query_password()) != oldcrypt(pa, pass))
      &&
      ((string)this_player()->query_password() != crypt(pa, pass)))
    {
	message("info", "Suicide failed.", this_player());
	return 0;
    }
    ob = this_player();
    str = (string)ob->query_name();
    if (!str) return;
    message("info", "You terminate your existance on Primal Darkness.",ob);
    CHAT_D->do_raw_chat("system", "Suicide <system> "+this_player()->query_name()+" suicided.");

    seteuid(UID_LOG);
    log_file("suicide", "[ " + ctime(time()) + " ] " + capitalize(str)
        + " suicided from IP: " + ob->query_ip() + "\n");
    seteuid(getuid());

    seteuid(UID_USERSAVE);
    rename(DIR_USERS+"/"+str[0..0]+"/"+str+".o",DIR_USERS+"/rid/"+str+".o");
    seteuid(geteuid());
    IDENTITY_D->manage_identity(0, this_player(), "deleting");
    MSQL_D->msql_delete_player("pd", "player_t", (string)ob->query_name());
    BANK_D->remove_all_bank_accounts((string)ob->query_name());
    if(file_exists("/adm/save/boats/"+(string)ob->query_name()+".o"))
        rm("/adm/save/boats/"+(string)ob->query_name()+".o");
    ob->remove();
    if (ob) destruct(ob);
    return;
}
开发者ID:ehershey,项目名称:pd,代码行数:35,代码来源:_suicide.c


示例17: SwallowCB

// Swallow new GNUPLOT window; search from window created on root.
static void SwallowCB(Widget swallower, XtPointer client_data, 
		      XtPointer call_data)
{
    PlotWindowInfo *plot = (PlotWindowInfo *)client_data;
    assert(plot->swallower == swallower);

    SwallowerInfo *info = (SwallowerInfo *)call_data;

    Window root = info->window;
    Window window = None;
    Display *display = XtDisplay(swallower);

    // Try the exact name as given
    if (window == None)
	window = findWindow(display, root, plot->window_name.chars());

    // Try the capitalized name.  Gnuplot does this.
    if (window == None) {
        const string s1 = capitalize(plot->window_name);
	window = findWindow(display, root, s1.chars());
    }

    // Try any `Gnuplot' window just created
    if (window == None)
	window = findWindow(display, root, app_data.plot_window_class);

    if (window != None)
	swallow(plot, window);
}
开发者ID:fooeybartoni,项目名称:CSI702,代码行数:30,代码来源:plotter.C


示例18: get_python_name

QString get_python_name(const BrowserClass * cl, ShowContextMode mode)
{
    ClassData * d = (ClassData *) cl->get_data();

    if (! d->python_is_external())
        return cl->contextual_name(mode);

    QString name = cl->get_name();
    QString s = d->get_pythondecl();
    int index = s.indexOf('\n');

    s = (index == -1) ? s.trimmed()
        : s.left(index).trimmed();

    if ((index = s.indexOf("${name}")) != -1)
        s.replace(index, 7, name);
    else if ((index = s.indexOf("${Name}")) != -1)
        s.replace(index, 7, capitalize(name));
    else if ((index = s.indexOf("${NAME}")) != -1)
        s.replace(index, 7, name.toUpper());
    else if ((index = s.indexOf("${nAME}")) != -1)
        s.replace(index, 7, name.toLower());

    return s;
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:25,代码来源:DialogUtil.cpp


示例19: SwallowTimeOutCB

// Swallow new GNUPLOT window; search from root window (expensive).
static void SwallowTimeOutCB(XtPointer client_data, XtIntervalId *id)
{
    (void) id;

    PlotWindowInfo *plot = (PlotWindowInfo *)client_data;
    assert(*id == plot->swallow_timer);
    plot->swallow_timer = 0;

    Window root = RootWindowOfScreen(XtScreen(plot->swallower));
    Window window = None;
    Display *display = XtDisplay(plot->swallower);

    // Try the exact name as given
    if (window == None)
	window = findWindow(display, root, plot->window_name.chars());

    // Try the capitalized name.  Gnuplot does this.
    if (window == None) {
        const string s1 = capitalize(plot->window_name);
	window = findWindow(display, root, s1.chars());
    }

    if (window == None)
    {
	// Try again later
	plot->swallow_timer = 
	    XtAppAddTimeOut(XtWidgetToApplicationContext(plot->swallower),
			    app_data.plot_window_delay, 
			    SwallowTimeOutCB, XtPointer(plot));
    }

    if (window != None)
	swallow(plot, window);
}
开发者ID:fooeybartoni,项目名称:CSI702,代码行数:35,代码来源:plotter.C


示例20: end

 MessageHandler_& end(std::string const& msg = "", std::string const& info =
         "") {
     if (name.empty()) return *this;
     indent = --indentLevel * INDENT_SIZE;
     ResourceUsage rusage = ResourceUsage() - initialUsage;
     if (beginLine == lineno) {
         if (!info.empty()) {
             *this << " " << info;
         }
         else if (msg.empty()) {
             *this << " done";
         }
         else {
             *this << " " << msg;
         }
     }
     else {
         if (msg.empty()) {
             *this << "\nDone " << name;
         }
         else {
             *this << "\n" << capitalize(msg);
         }
         if (!info.empty()) *this << " " << info;
     }
     *this << " in " << rusage << ".\n";
     name = "";
     return *this;
 }
开发者ID:an3iitho,项目名称:graphillion,代码行数:29,代码来源:MessageHandler.hpp



注:本文中的capitalize函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ capture函数代码示例发布时间:2022-05-30
下一篇:
C++ capi_addlasterror函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap