本文整理汇总了C++中XString::left方法的典型用法代码示例。如果您正苦于以下问题:C++ XString::left方法的具体用法?C++ XString::left怎么用?C++ XString::left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XString
的用法示例。
在下文中一共展示了XString::left方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFilenameWithoutPathAndExtension
XString getFilenameWithoutPathAndExtension(XString s)
{
XString k = getFilenameWithoutPath(s);
int i = k.findRev('.');
k = k.left(i);
return k;
}
示例2: kbc
//.........这里部分代码省略.........
sProjectType = "With Forms MainWindow (you must have myMenuBar created)";
sTranslation = "&Window;Help;C&ontents;A&bout;Cl&ose;Close &All;&Tile;&Cascade;Arrange &icons;Ne&xt;Pre&vious;";
sSQL = "QPSQL;localhost;test;postgres;test";
*/
// if (bUseCache) printf("!!!!!");
// sprintf(ac, "");
//if (MAIN_argc > 1 && i <= MAIN_argc) sprintf(ac, "%s", MAIN_argv[i]);
//sprintf(ac, "C:/kbasic16/kbide/examples/kbasic/builtin/__class__.kbasic");
//if (utility::my_stricmp(ac, "") == 0) return 0;
//bUseCache = false;
{
sKBasicPath = MAIN_argv[0];
bool bDebug = false;
#ifdef WINDOWS // HIDE
bDebug = sKBasicPath.contains("Debug"); // HIDE
#endif // HIDE
sKBasicPath = sKBasicPath.replace("\\", "/");
#ifdef WINDOWS // HIDE
sKBasicPath = sKBasicPath.replace("/Debug", "", false); // HIDE
sKBasicPath = sKBasicPath.replace("/Release", "", false); // HIDE
sKBasicPath = sKBasicPath.replace(".exe", "", false); // HIDE
#endif // HIDE
if (bDebug){
int n = sKBasicPath.findRev("/");
if (n >= 0) sKBasicPath = sKBasicPath.left(n);
sKBasicPath = sKBasicPath.replace("kbc", "kbide/ide/cache");
} else {
sKBasicPath = sKBasicPath.replace("kbc", "ide/cache");
}
if (sKBasicPath.isEmpty()) return 0;
}
// if (checkLicense(acLicense) == false) return 0;
// checkSerialNo();
textbuffer *myTextbuffer = new textbuffer(); // needed to truncate big input strings or zero terminate them
cache *my_cache = new cache();
token *myToken = new token();
scanner *myScanner = new scanner(myToken, my_cache);
char *acText;
bool b = true;
if (utility::readSourceFile(&acText, cachePath("project.name").ascii(), myTextbuffer)){
acText = utility::eatUTF16DOM(acText);
sProjectName = acText;
}
// if (b && (b = utility::readSourceFile(&acText, "c:/kbasic16/kbide/ide/cache/C__kbasic16_kbide_examples_kbasic_builtin___class__.kbasic.scanner", myTextbuffer))){}
{ // delete runtime.parser file