本文整理汇总了C++中FXString::simplify方法的典型用法代码示例。如果您正苦于以下问题:C++ FXString::simplify方法的具体用法?C++ FXString::simplify怎么用?C++ FXString::simplify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FXString
的用法示例。
在下文中一共展示了FXString::simplify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strwlen
void ID3V2::parse_comment_frame(FXint framesize) {
FXString key,field;
const FXuchar & encoding = buffer[p];
const FXchar* textstart = (const FXchar*)(buffer+p+4);
const FXint textlength = framesize - 4;
if (encoding==UTF16_BOM || encoding==UTF16) {
FXint ksize = strwlen(textstart,textlength);
FXint vsize = strwlen(textstart+ksize+2,textlength-ksize-2);
parse_text(encoding,textstart,ksize,key);
parse_text(encoding,textstart+ksize+2,vsize,field);
}
else {
FXint ksize = strnlen(textstart,textlength);
FXint vsize = strnlen(textstart+ksize+1,textlength-ksize-1);
parse_text(encoding,textstart,ksize,key);
parse_text(encoding,textstart+ksize+1,vsize,field);
}
FXString comment = key + " " + field;
if (comment.find("iTunSMPB")>=0) {
comment.simplify().scan("iTunSMPB %*x %hx %hx %lx",&padstart,&padend,&length);
GM_DEBUG_PRINT("[id3v2] found iTunSMPB (padding %d %d, length %ld)\n",padstart,padend,length);
}
}
示例2: GetFilenameFromSelection
// Check for an already-selected filename
static void GetFilenameFromSelection(FXMainWindow*tw,SciDoc*sci, FXString &filename)
{
#ifdef WIN32
sci->GetSelText(filename);
#else // On X11 platforms, try first to get a filename from the X-Selection
FXuchar*xsel=NULL;
FXuint xlen=0;
FXDragType types[] = { tw->textType, tw->utf8Type, tw->stringType, 0 };
for ( FXDragType*type=types; *type; type++ ) {
if (tw->getDNDData(FROM_SELECTION,*type, xsel, xlen) && xsel && *xsel) {
FXuchar*eol=(FXuchar*)memchr(xsel,'\n', xlen);
FXuint n = eol ? (eol-xsel) : xlen;
filename.assign((FXchar*)xsel,n);
filename=filename.simplify();
if (!FXStat::exists(filename.contains(':')?filename.section(':',0):filename)) {
filename=FXString::null;
}
break;
}
if ( filename.empty() ) { sci->GetSelText(filename); }
}
#endif
}