本文整理汇总了C++中FXString::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ FXString::contains方法的具体用法?C++ FXString::contains怎么用?C++ FXString::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FXString
的用法示例。
在下文中一共展示了FXString::contains方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseLineNumberFromFilename
// Look for line number after filename in the form of FILE.EXT:NNN
static void ParseLineNumberFromFilename(FXString &filename, FXString &line)
{
#ifdef WIN32 // Ignore colon in drive spec on WIN32
FXint colons=filename.contains(':');
if (FXPath::isAbsolute(filename)) {
if (colons>1) {
line=filename.section(':',2);
filename=filename.section(':',0,2);
}
} else {
if (colons>0) {
line=filename.section(':',1) ;
filename=filename.section(':',0);
}
}
#else
if (filename.contains(':')) {
line=filename.section(':',1) ;
filename=filename.section(':',0);
}
#endif
for (FXint i=0; i<line.length(); i++) {
if (!Ascii::isDigit(line[i])) { // If it's not all digits, forget it.
line=FXString::null;
break;
}
}
}
示例2: StripNamespace
// Remove anything containing a colon : from the beginning of the string.
// Returns number of colons removed.
FXint TagParserBase::StripNamespace(FXString &s)
{
FXint rv=s.contains(':');
if (rv) {
s.erase(0,s.rfind(':')+1);
}
return rv;
}
示例3: SaveSysIncPaths
static void SaveSysIncPaths(FXSettings*reg)
{
reg->deleteSection(sysincs_sect);
int n=SysIncs.contains('\n');
if (n>MAX_SYSINC_PATHS) { n=MAX_SYSINC_PATHS; }
for (int i=0; i<n; i++) {
const FXString value=SysIncs.section('\n',i);
if (!value.empty()) {
char key[16];
snprintf(key, sizeof(key)-1 ,"Path_%d", i+1);
reg->writeStringEntry(sysincs_sect,key,value.text());
}
}
}
示例4: OpenSystemIncludeFile
// Look for file in system include directories
static bool OpenSystemIncludeFile(SciDoc*sci, const FXString &filename, const FXString &line)
{
const FXString paths=Settings::SystemIncludePaths();
for (FXint i=0; i<paths.contains('\n'); i++) {
FXString fullpath=paths.section('\n',i);
if (fullpath.empty()) { continue; }
fullpath+=PATHSEPSTRING;
fullpath+=filename;
if (FXStat::exists(fullpath)) {
TopWinPub::OpenFile(fullpath.text(),line.text(),false,true);
return true;
}
}
return false;
}
示例5: appendLine
void CmdIO::appendLine(FXString&s, FXSelector selid)
{
if (target&&message) {
FXint nlines=s.contains('\n');
FXString trailer=s.section('\n', nlines);
s.trunc(s.length()-trailer.length());
if (multiline_mode) {
target->handle(this, FXSEL(selid,message), (void*)(&s));
} else {
for (FXint i=0; i<nlines; i++) {
FXString sect=s.section('\n',i);
target->handle(this, FXSEL(selid,message), (void*)(§));
}
}
s=trailer;
}
}
示例6: 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
}
示例7: 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());
//.........这里部分代码省略.........