本文整理汇总了C++中FXString::prepend方法的典型用法代码示例。如果您正苦于以下问题:C++ FXString::prepend方法的具体用法?C++ FXString::prepend怎么用?C++ FXString::prepend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FXString
的用法示例。
在下文中一共展示了FXString::prepend方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getItemPathname
// Return absolute pathname of item
FXString FXDirList::getItemPathname(const FXTreeItem* item) const {
FXString path;
if(item){
while(1){
path.prepend(item->getText());
item=item->parent;
if(!item) break;
if(item->parent) path.prepend(PATHSEP);
}
}
return path;
}
示例2: getItemPathname
// Return item path
FXString FXDirBox::getItemPathname(FXTreeItem *item) const {
FXString string;
if(item){
while(item->getParent()){
string.prepend(getItemText(item));
item=item->getParent();
if(item->getParent()) string.prepend(PATHSEPSTRING);
}
string.prepend(getItemText(item));
}
return string;
}
示例3: SaveBackup
bool BackupMgr::SaveBackup(SciDoc*sci)
{
FXString savename;
FXString untitled;
untitled.format(FN_FMT, backupdir.text(), abs(getpid()), SciDocUtils::ID(sci));
if (SciDocUtils::Filename(sci).empty()) {
savename=untitled;
} else {
if (FXStat::isFile(untitled)) {
RemoveBackup(untitled);
}
#ifdef WIN32
savename=SciDocUtils::Filename(sci).text();
savename.substitute(':', '%', true);
savename.prepend(backupdir.text());
#else
savename.format("%s%s", backupdir.text(), SciDocUtils::Filename(sci).text());
#endif
}
if (MakePath(FXPath::directory(savename))) {
if (SciDocUtils::SaveToFile(sci,savename.text(),false)) {
SciDocUtils::NeedBackup(sci, false);
return true;
} else {
lasterror=SciDocUtils::GetLastError(sci);
ErrorMessage(_("Failed to save backup"), savename);
return false;
}
} else {
return false;
}
}
示例4: getPathname
FXString ProjectBrowser::getPathname(FXTreeItem* item)
{
FXString path;
FXTreeItem* current = item;
while (true)
{
path.prepend(current->getText());
path.prepend(FS::dirSeparator());
FXTreeItem* parent = current->getParent();
if (parent == NULL)
break;
current = parent;
}
path.prepend(mainWin->settings->getStringValue("baseDir"));
return path;
}
示例5: MigrateConfigDir
void MigrateConfigDir(FXApp*a, const FXString &src, const FXString &dst, FXString &errors)
{
if (!FXStat::isDirectory(src)) { return; }
if (FXStat::isDirectory(dst)) { return; }
FXMessageBox dlg(a,
_("IMPORTANT NOTICE"),
_(
"\n"
"The location of the "APP_NAME" configuration directory has changed.\n"
"\n"
#ifndef WIN32
"This is due to changes in the FOX toolkit, in accordance with\n"
"the freedesktop.org \"XDG base directory specification\".\n"
"\n"
#endif
"Migration options:\n"
" Click [ Yes ] to automatically copy your old settings (recommended).\n"
" Click [ No ] to create a new configuration.\n"
" Click [Cancel] to exit "APP_NAME" now without any changes.\n"
"\n"
"Do you want me to copy your existing configuration?"
),
NULL,MBOX_YES_NO_CANCEL
);
a->create();
FXint rv=dlg.execute(PLACEMENT_SCREEN);
switch (rv) {
case MBOX_CLICKED_YES: {
copyConfigFiles(src,dst,errors,0);
if (!errors.empty()) {
errors.prepend("================================\n");
errors.prepend(_("Settings migration messages:\n"));
errors.prepend("================================\n");
}
a->reg().read();
return;
}
case MBOX_CLICKED_NO: { return; }
default: { ::exit(0); }
}
}
示例6: RemoveBackup
void BackupMgr::RemoveBackup(SciDoc*sci)
{
FXString untitled;
SciDocUtils::NeedBackup(sci,false);
untitled.format(FN_FMT, backupdir.text(), abs(getpid()), SciDocUtils::ID(sci));
RemoveBackup(untitled);
if (!SciDocUtils::Filename(sci).empty()) {
FXString savename;
#ifdef WIN32
savename=SciDocUtils::Filename(sci).text();
savename.substitute(':', '%', true);
savename.prepend(backupdir.text());
#else
savename.format("%s%s", backupdir.text(), SciDocUtils::Filename(sci).text());
#endif
RemoveBackup(savename);
}
}