本文整理汇总了C++中FXString::find方法的典型用法代码示例。如果您正苦于以下问题:C++ FXString::find方法的具体用法?C++ FXString::find怎么用?C++ FXString::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FXString
的用法示例。
在下文中一共展示了FXString::find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ap_parse_pls
void ap_parse_pls(const FXString & data,FXStringList & mrl) {
FXint start=0,end=0,pos,next;
for (FXint i=0;i<data.length();i++) {
if (data[i]=='\n') {
end=i;
next=i+1;
/// Skip white space
while(start<end && Ascii::isSpace(data[start])) start++;
/// Skip white space
while(end>start && Ascii::isSpace(data[end])) end--;
/// Parse the actual line.
if ((end-start)>6) {
if (compare(&data[start],"File",4)==0) {
pos = data.find('=',start+4);
if (pos==-1) continue;
pos++;
if (end-pos>0) {
mrl.append(data.mid(pos,1+end-pos));
}
}
}
start=next;
}
}
}
示例3: frameFromFilename
// Get frame number from filename
static FXint frameFromFilename(const FXString& file){
FXint head=file.rfind(PATHSEP)+1;
FXint tail=file.find('.',head);
FXint frame=0;
if(0<tail){
FXint wgt=1;
while(head<tail && Ascii::isDigit(file[tail-1])){
frame+=wgt*Ascii::digitValue(file[--tail]); wgt*=10;
}
}
return frame;
}
示例4: if
/** The text entered in the command textfield is sent (enter key pressed)
*
*
* \param o A parameter used for FOX callbacks
* \param s A parameter used for FOX callbacks
* \param v The text comming from the command textfield
*
* \return Always 1
*
*/
long RainbruRPG::Gui::FtpClientWindow::
treatNewCommand(FXObject* o,FXSelector s,void* v){
FXString str;
str=(FX::FXchar*)v;
FXString filename=(FX::FXchar*)v;
// If the entered text is not empty
if (!str.empty()){
fxText->appendText( "> " );
fxText->appendText( str );
fxText->appendText( "\n" );
FXTextField* a=(FXTextField*)o;
a->setText("");
str=str.upper();
if (str.contains("HELP")!=0){
if (str.contains("USER")!=0){
showHelpUser();
}
else if (str.contains("PASS")!=0){
showHelpPass();
}
else if (str.contains("PASV")!=0){
showHelpPasv();
}
else if (str.contains("PWD")!=0){
showHelpPwd();
}
else if (str.contains("LIST")!=0){
showHelpList();
}
else if (str.contains("SYST")!=0){
showHelpSyst();
}
else if (str.contains("BINARY")!=0){
showHelpBinary();
}
else if (str.contains("ASCII")!=0){
showHelpAscii();
}
else if (str.contains("STOR")!=0){
showHelpStore();
}
else if (str.contains("RETR")!=0){
showHelpRetrieve();
}
else{
onHelp(NULL,0,NULL);
}
}
else if (str.contains("LIST")!=0){
string s=ftpClient->commandLIST();
FXString str=s.c_str();
str.substitute('\r', ' ', true );
logMessage(str);
}
else if (str.contains("PASV")!=0){
ftpClient->toggleTransferMode();
string s=ftpClient->waitControlResponse();
logMessage(s.c_str());
}
else if (str.contains("PWD")!=0){
string s=ftpClient->commandPWD();
logMessage(s.c_str());
}
else if (str.contains("SYST")!=0){
string s=ftpClient->commandSYST();
logMessage(s.c_str());
}
else if (str.contains("BINARY")!=0){
string s=ftpClient->commandBINARY();
logMessage(s.c_str());
}
else if (str.contains("ASCII")!=0){
string s=ftpClient->commandASCII();
logMessage(s.c_str());
}
else if (str.contains("STOR")!=0){
// because str is in UPPER case
// I get the no-upper string
int pos = str.find("STOR", 0);
filename.erase( pos, 5 );
LOGCATS("Filename :");
LOGCATS(filename.text());
//.........这里部分代码省略.........
示例5: onParseAllSources
// When BuildClassTree() is called, ctags parses all source files in the directory list.
// This routine is called by the CmdIO object, once for each line of output from ctags.
long TagParserBase::onParseAllSources(FXObject*o, FXSelector sel, void*p)
{
const FXString* s=(const FXString*)p;
if (FXSELTYPE(sel)==SEL_IO_EXCEPT) { return 1; }
LocationIndex dirindex=(LocationIndex)((FXuval)((CmdIO*)o)->getUserData());
FXString ancestor=FXString::null;
FXString scopename=FXString::null;
FXint linenum=ExtractLineNumber(s);
FXchar kind=s->section('\t', 3)[0];
FXString tagname=s->section('\t',0);
FXString filename=s->section('\t',1);
if (current_filename!=filename) {
current_filename=filename;
dirs[dirindex]->append(filename);
}
const FXchar ext=Ascii::toLower(FXPath::extension(filename)[0]);
if ( (kind=='n') ) {
if (ext=='c') { return 1; } // namespaces are only interesting if they are in a public header
}
for (FXint i=4; i<=s->contains('\t'); i++) {
const FXString sect=s->section('\t', i);
if (sect.find(':')>0) {
const FXString key=sect.section(':',0);
if ((kind=='s')&&(key=="access")) { // ignore structs defined inside a class
return 1;
} else if ((kind=='f')&&((key=="class")||(key=="namespace"))) {
scopename=sect.section(':',1,1024);
StripNamespace(scopename);
} else if (key=="inherits") {
ancestor=sect.section(':',1);
if (ancestor.find(',')>0) {
ancestor=ancestor.section(',',0); // can't do multiple inheritence
}
StripNamespace(ancestor);
}
}
}
switch (kind) {
case 'c':
case 'n':
case 's': {
tag_info_list->append(kind, tagname, ancestor, dirindex, dirs[dirindex]->no()-1, linenum);
break;
}
default: {
FXString* entry = new FXString();
entry->format(
"%c\t%s%s%s\t%d",
kind,
scopename.text(),
scopename.empty()?"":"::",
tagname.text(),
linenum
);
dirs[dirindex]->tail()->append(entry);
break;
}
}
return 1;
}