⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchpath.cpp

📁 qgo-1.5.4-r3.tar.gz linux下一个很好玩的游戏
💻 CPP
字号:
//// C++ Implementation: searchpath//// Description: ////// Author:  <>, (C) 2005//// Copyright: See COPYING file that comes with this distribution////#include "searchpath.h"#include <qstringlist.h>SearchPath::SearchPath () : QObject (){  directoryList = QPtrList<QDir>();  directoryList.setAutoDelete(true);}SearchPath::~SearchPath (){  directoryList.clear();}QFile * SearchPath::findFile(QFile &file){  QDir *dir = findDirContainingFile(file);  if (dir) {    QFile * filep = new QFile(dir->absFilePath(file.name()));    return filep;  } else {    return NULL;  }}QDir * SearchPath::findDirContainingFile(QFile &file){  QDir *dir;  for (dir = directoryList.first(); dir; dir = directoryList.next()) {    if (! dir->exists() )      continue;    if (dir->exists(file.name()))      return dir;  }  return NULL;}SearchPath& SearchPath::operator<<(const QString& string){  QDir dir(string);  *this << dir;  return *this;}SearchPath& SearchPath::operator<<(const char* string){  QString qstring(string);  *this << qstring;  return *this;}SearchPath& SearchPath::operator<<(QStringList& list){  for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)    {      QString str = *it;      *this << str;    }  return *this;}SearchPath& SearchPath::operator<<(QDir& dir){  QDir * dirp = new QDir(dir);  directoryList.append(dirp);  return *this;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -