本文整理汇总了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;
}
示例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);
}