当前位置: 首页>>代码示例>>C++>>正文


C++ TStrings::SetText方法代码示例

本文整理汇总了C++中TStrings::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ TStrings::SetText方法的具体用法?C++ TStrings::SetText怎么用?C++ TStrings::SetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TStrings的用法示例。


在下文中一共展示了TStrings::SetText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_ini_parms

int get_ini_parms(void) {
   char *mainini = (char*)sto_data(STOKEY_INIDATA);
   u32t     size = sto_size(STOKEY_INIDATA);
   u32t  pciscan = 0;
   int        rc = 0;
   spstr  dbcard;
   // init was saved by pointer, not as data copy
   sto_del(STOKEY_INIDATA);

   /* we have root environment here, so just storing keys for any other
      feature apps */
   u32t htype = hlp_hosttype();
   if (htype>=QSHT_BIOS && htype<=QSHT_EFI) {
      // scan all PCI buses on EFI by default
      if (htype==QSHT_EFI) pciscan = 1;
      setenv("HOSTTYPE", hoststrs[htype], 1);
   }

   u32t btype = hlp_boottype();
   if (btype>QSBT_NONE && btype<=QSBT_SINGLE) {
      setenv("BOOTTYPE", bootstrs[btype-1], 1);
      log_printf("boot type: %s!\n", bootstrs[btype-1]);
   }

   if (mainini) {
      log_printf("ini: %d bytes!\n",size);
      TStrings  ifl;
      ifl.SetText(mainini,size);
      hlp_memfree(mainini);
      if (!ifl.SaveToFile(ini_name)) log_printf("failed to copy ini!\n");

      TINIFile  ini(&ifl);
      dbcard    = ini.ReadStr(cfg_section,"DBCARD");
      pciscan   = ini.ReadInt(cfg_section, "PCISCAN_ALL", pciscan);
      no_tgates = ini.ReadInt(cfg_section,"NOTASK");
      msg_name  = ini.ReadStr(shell_section, "MESSAGES");
      ecmd_name = ini.ReadStr(shell_section, "EXTCOMMANDS");
      mod_delay = ini.ReadInt(cfg_section, "UNZALL", 0) ? 0 : 1;
      ctrln_d0  = ini.ReadInt(cfg_section,"CTRLN");
      rc        = ini.ReadInt(cfg_section,"REIPL");
      if (rc>0) reipltime = rc;
      // disable clock in menu
      rc        = ini.ReadInt(cfg_section,"NOCLOCK");
      if (rc>0 || hlp_insafemode()) setenv("MENU_NO_CLOCK", "YES", 1); else
         if (rc<0) env_setvar("MENU_NO_CLOCK", -1);

      u32t heapflags = ini.ReadInt(cfg_section,"HEAPFLAGS");
      mem_setopts(heapflags&0xF);

      rc = 1;
   } else
      log_printf("no file!\n");
   // save value
   sto_savedword(STOKEY_PCISCAN, pciscan);
   // set default names if no ini file or key in it
   if (!msg_name)  msg_name  = msg_path;
   if (!ecmd_name) ecmd_name = ECMD_PATH;
   // call DBCARD processing (only after pciscan was saved!)
   if (dbcard.length()) {
      rc = shl_dbcard(dbcard, log_printf);
      if (rc) log_printf("DBCARD setup err %d!\n", rc);
   }
   return rc;
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:64,代码来源:ldrini.cpp

示例2: str_getlist_local

str_list* _std str_settext(const char *text, u32t len) {
   TStrings lst;
   lst.SetText(text,len);
   for (int ii=0;ii<=lst.Max();ii++) lst[ii].trimright();
   return str_getlist_local(lst.Str);
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:6,代码来源:ldrini.cpp


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