本文整理汇总了C++中processFile函数的典型用法代码示例。如果您正苦于以下问题:C++ processFile函数的具体用法?C++ processFile怎么用?C++ processFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: processFileList
/*
* processFileList - process a possible file list
*/
static void processFileList( const char *ptr )
{
DIR *dirp;
struct dirent *dirent;
const char *tmp;
bool has_wild = false;
char buff1[_MAX_PATH2];
char buff2[_MAX_PATH2];
char *drive;
char *dir;
char *fname;
char *ext;
char path[_MAX_PATH];
tmp = ptr;
while( *tmp != '\0' ) {
if( *tmp == '*' || *tmp == '?' ) {
has_wild = true;
break;
}
tmp++;
}
if( !has_wild ) {
processFile( ptr );
return;
}
_splitpath2( ptr, buff1, &drive, &dir, &fname, &ext );
dirp = opendir( ptr );
if( dirp == NULL ) {
return;
}
while( (dirent = readdir( dirp )) != NULL ) {
#ifdef __UNIX__
{
struct stat buf;
stat( dirent->d_name, &buf );
if ( S_ISDIR( buf.st_mode ) )
continue;
}
#else
if( dirent->d_attr & (_A_SUBDIR | _A_VOLID) ) {
continue;
}
#endif
_splitpath2( dirent->d_name, buff2, NULL, NULL, &fname, &ext );
_makepath( path, drive, dir, fname, ext );
strlwr( path );
processFile( path );
}
closedir( dirp );
} /* processFileList */
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:59,代码来源:ctags.c
示例2: main
int
main(int argc, char *argv[])
{
int i;
int opt;
while(1) {
opt = getopt_long(argc, argv, "DvVTBtPs", long_options, NULL);
if(opt == -1)
break;
switch(opt) {
case 'v':
verbose = 1;
break;
case 's':
rsgt_read_showVerified = 1;
break;
case 'V':
fprintf(stderr, "rsgtutil " VERSION "\n");
exit(0);
case 'D':
mode = MD_DUMP;
break;
case 'B':
mode = MD_SHOW_SIGBLK_PARAMS;
break;
case 'P':
rsgt_read_puburl = optarg;
break;
case 'T':
mode = MD_DETECT_FILE_TYPE;
break;
case 't':
mode = MD_VERIFY;
break;
case 'e':
mode = MD_EXTEND;
break;
case '?':
break;
default:fprintf(stderr, "getopt_long() returns unknown value %d\n", opt);
return 1;
}
}
if(optind == argc)
processFile("-");
else {
for(i = optind ; i < argc ; ++i)
processFile(argv[i]);
}
return 0;
}
开发者ID:ahtotruu,项目名称:rsyslog,代码行数:54,代码来源:rsgtutil.c
示例3: composeFile
void TableGenerator::findComposeFile()
{
bool found = false;
// check if XCOMPOSEFILE points to a Compose file
if (qEnvironmentVariableIsSet("XCOMPOSEFILE")) {
QString composeFile(qgetenv("XCOMPOSEFILE"));
if (composeFile.endsWith(QLatin1String("Compose")))
found = processFile(composeFile);
else
qWarning("Qt Warning: XCOMPOSEFILE doesn't point to a valid Compose file");
#ifdef DEBUG_GENERATOR
if (found)
qDebug() << "Using Compose file from: " << composeFile;
#endif
}
// check if user’s home directory has a file named .XCompose
if (!found && cleanState()) {
QString composeFile = qgetenv("HOME") + QStringLiteral("/.XCompose");
if (QFile(composeFile).exists())
found = processFile(composeFile);
#ifdef DEBUG_GENERATOR
if (found)
qDebug() << "Using Compose file from: " << composeFile;
#endif
}
// check for the system provided compose files
if (!found && cleanState()) {
QString table = composeTableForLocale();
if (cleanState()) {
if (table.isEmpty())
// no table mappings for the system's locale in the compose.dir
m_state = UnsupportedLocale;
else
found = processFile(systemComposeDir() + QLatin1Char('/') + table);
#ifdef DEBUG_GENERATOR
if (found)
qDebug() << "Using Compose file from: " <<
systemComposeDir() + QLatin1Char('/') + table;
#endif
}
}
if (found && m_composeTable.isEmpty())
m_state = EmptyTable;
if (!found)
m_state = MissingComposeFile;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:48,代码来源:qtablegenerator.cpp
示例4: opendir
void MakePageLib::traversDirectoryWithRecursion(const std::string &path)
{
DIR *dir = opendir(path.c_str());
if(dir == NULL)
{
LOG_FATAL << "open dir error:" << path;
}
chdir(path.c_str()); //更改工作目录
struct dirent *pd;
while((pd = readdir(dir)) != NULL)
{
if(pd->d_name[0] == '.') // . ..
continue;
//int lstat(const char *path, struct stat *buf);
struct stat buf;
if(lstat(pd->d_name, &buf) == -1)
{
LOG_ERROR << "lstat file :" << pd->d_name << " error";
continue;
}
if(S_ISDIR(buf.st_mode))
traversDirectoryWithRecursion(pd->d_name);
else if(S_ISREG(buf.st_mode))
processFile(pd->d_name);
}
closedir(dir);
chdir(".."); //退出到上一层
}
开发者ID:sunnyss12,项目名称:minisearch,代码行数:33,代码来源:MakePageLib.cpp
示例5: newStringStackItem
void MagicFolderCache::startElement(XML_CSTR name, const XMLAttributes& atts)
{
if( IN_STATE( PS_FOLDER ) )
{
if( MATCH("MagicFolder") )
{
_depth++;
// Push this folder path onto the path stack...
_pathStack = newStringStackItem(_pathStack, atts.getValue(_T("name")));
// Store a folder object which will hold configuration etc.
_current = new Folder(_pathStack->val.c_str(), _T(""));
_map->insert(MagicFolderCache::FolderMap::value_type(_pathStack->val, _current));
}
else if( MATCH("File") )
{
STATE(PS_FILE);
processFile(atts);
}
else
{
processUserData(name, atts);
}
}
else if( IN_STATE( PS_FILE ) || IN_STATE( PS_USERDATA ) )
{
processUserData(name, atts);
}
}
开发者ID:ALPHAMARIOX,项目名称:pn,代码行数:30,代码来源:magicfolder.cpp
示例6: processFile
/**
Parses the file with the given name and adds it to the database.
@param path: path to the file to process
@param name: name of the file to process
@param parseBody: boolean value stating whether the body must be parsed or not
*/
void DatasetGenerator::parseFile(const string &filePath, const string &fileName, bool parseBody)
{
aParseBody=parseBody;
DB.connect();
processFile(filePath, fileName);
DB.close();
}
开发者ID:marta123456,项目名称:ReferenceRecommendationForScientificArticles,代码行数:13,代码来源:DatasetGenerator.cpp
示例7: processChunk
static void processChunk(Regex* re, SearchOutput* output, unsigned int chunkIndex, const char* data, size_t fileCount, Regex* includeRe, Regex* excludeRe)
{
const DataChunkFileHeader* files = reinterpret_cast<const DataChunkFileHeader*>(data);
OrderedOutput::Chunk* chunk = output->output.begin(chunkIndex);
if (!output->isLimitReached())
{
HighlightBuffer hlbuf;
for (size_t i = 0; i < fileCount; ++i)
{
const DataChunkFileHeader& f = files[i];
if (includeRe && !includeRe->search(data + f.nameOffset, f.nameLength))
continue;
if (excludeRe && excludeRe->search(data + f.nameOffset, f.nameLength))
continue;
processFile(re, output, chunk, hlbuf, data + f.nameOffset, f.nameLength, data + f.dataOffset, f.dataSize, f.startLine);
}
}
output->output.end(chunk);
}
开发者ID:UIKit0,项目名称:qgrep,代码行数:26,代码来源:search.cpp
示例8: CWriteSink
bool CMailViewTpl::SaveToFile( LPCSTR fileName )
{
FarFile f;
if ( !f.CreateForWrite( fileName ) )
return false;
class CWriteSink : public IWriteSink
{
private:
FarFile * f;
public:
CWriteSink( FarFile * ff ) : f( ff )
{
}
virtual ~CWriteSink()
{
}
virtual void write( LPCSTR str, int len )
{
f->Write( str, len );
}
};
CWriteSink ws( &f );
processFile( m_fileName, &ws );
f.Close();
return true;
}
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:30,代码来源:MailViewTpl.cpp
示例9: processFileArgument
void processFileArgument(char* name) {
if (!table.lookup(name)) {
fprintf(stderr, "File %s is not present in baseline.\n", name);
return;
}
File localfile(name);
if (localfile.exists()) {
processFile(name);
} else {
if (forced_revision()) {
File tempfile("forced_mergefile.tmp");
File rcsfile(dirs.baseline, dirs.subdir->path, "RCS",
localfile.path);
char line[LINE_LENGTH];
char* version = forced_revision_number ? forced_revision_number :
rcsfile.getRevisionFromDate(forced_revision_date);
sprintf(line, "co -q -p%s %s,v > %s",
version, rcsfile.path, tempfile.path);
if (execute(line)) {
tempfile.un_link();
exit(-1);
}
localfile.become(tempfile, save);
tempfile.un_link();
} else {
File basefile(dirs.baseline, dirs.subdir->path, localfile.path);
localfile.become(basefile, save);
}
}
}
开发者ID:AdamSpitz,项目名称:self,代码行数:31,代码来源:UpdateFiles.cpp
示例10: processFile
unsigned int CppCheck::check(const std::string &path, const std::string &content)
{
_fileContent = content;
const unsigned int retval = processFile(path,true); //
_fileContent.clear();
return retval;
}
开发者ID:EricZRY,项目名称:TscanCode,代码行数:7,代码来源:cppcheck.cpp
示例11: processFile
bool StorageDistributedDirectoryMonitor::findFiles()
{
std::map<UInt64, std::string> files;
Poco::DirectoryIterator end;
for (Poco::DirectoryIterator it{path}; it != end; ++it)
{
const auto & file_path_str = it->path();
Poco::Path file_path{file_path_str};
if (!it->isDirectory() && startsWith(file_path.getExtension().data(), "bin"))
files[parse<UInt64>(file_path.getBaseName())] = file_path_str;
}
if (files.empty())
return false;
for (const auto & file : files)
{
if (quit)
return true;
processFile(file.second);
}
return true;
}
开发者ID:jacktang,项目名称:ClickHouse,代码行数:27,代码来源:DirectoryMonitor.cpp
示例12: while
void CollectionScanner::scanDirectory(QDir directory) {
QStack<QDir> stack;
stack.push(directory);
while(!stack.empty()) {
const QDir dir = stack.pop();
const QFileInfoList flist = dir.entryInfoList(
QDir::NoDotAndDotDot |
QDir::Dirs | QDir::Files | QDir::Readable
);
QFileInfo fileInfo;
Q_FOREACH(fileInfo, flist) {
if(fileInfo.isFile() ) {
processFile(fileInfo);
} else if (fileInfo.isDir()) {
QString subDirPath = fileInfo.absoluteFilePath();
#ifdef APP_MAC
if (directoryBlacklist.contains(subDirPath)) {
qDebug() << "Skipping directory" << subDirPath;
continue;
}
#endif
QDir subDir(subDirPath);
stack.push(subDir);
}
}
}
}
开发者ID:PhillipMwaniki,项目名称:musique,代码行数:31,代码来源:collectionscanner.cpp
示例13: strlen
AREXPORT void ArDataLogger::addString(
const char *name, ArTypes::UByte2 maxLength,
ArFunctor2<char *, ArTypes::UByte2> *functor)
{
ArTypes::UByte2 len;
myMutex.lock();
if (maxLength < strlen(name))
len = strlen(name);
else
len = maxLength;
if (myMaxMaxLength < len)
myMaxMaxLength = len;
myStrings.push_back(new ArStringInfoHolder(name, len, functor));
bool *boolPtr;
boolPtr = new bool;
// if we've added to config we default to true
if (myAddedToConfig)
*boolPtr = true;
else
*boolPtr = false;
myStringsEnabled.push_back(boolPtr);
myStringsCount++;
myMutex.unlock();
if (myAddedToConfig)
processFile(NULL, 0);
}
开发者ID:Aharobot,项目名称:ArAndroidApp,代码行数:28,代码来源:ArDataLogger.cpp
示例14: showStdIn
/**
* \brief Process the contents of stdin.
* \result 0 if all OK.
*/
void showStdIn (void)
{
/*------------------------------------------------------------------------*
* First display a table with the file name and size. *
*------------------------------------------------------------------------*/
if (!displayColumnInit (1, ptrFileColumn, 0))
{
fprintf (stderr, "ERROR in: displayColumnInit\n");
return;
}
if (!displayQuiet)
{
displayDrawLine (0);
displayHeading (0);
displayNewLine (0);
displayInColumn (0, "stdin");
displayNewLine (DISPLAY_INFO);
displayAllLines ();
}
displayTidy ();
if (!displayColumnInit (displayCols, ptrDumpColumn, displayFlags))
{
fprintf (stderr, "ERROR in: displayColumnInit\n");
return;
}
if (!displayQuiet) displayDrawLine (0);
if (!displayQuiet) displayHeading (0);
processFile (stdin);
++filesFound;
}
开发者ID:cddknight,项目名称:dirutils,代码行数:37,代码来源:hexDump.c
示例15: killOp
void UploadOperation::startUpload()
{
if (isTerminating()) {
killOp();
return ;
} // terminate operation is needed
// Current file info
FileInfo *fileInfo = m_toCopy->getFileInfo();
// Logging
if (m_toCopy->getFirst()->getParent() == NULL) {
StringStorage message;
message.format(_T("Uploading '%s' %s"), m_pathToSourceFile.getString(),
fileInfo->isDirectory() ? _T("folder") : _T("file"));
notifyInformation(message.getString());
} // logging
if (fileInfo->isDirectory()) {
processFolder();
} else {
processFile();
} // if not directory
if (isTerminating()) {
killOp();
return ;
} // terminate operation is needed
} // void
开发者ID:sim0629,项目名称:tightvnc,代码行数:31,代码来源:UploadOperation.cpp
示例16: while
void* CDVToolReaderThread::Entry()
{
// Wait here until we have the essentials to run
while (!m_killed && (m_dongle == NULL || m_soundcard == NULL))
Sleep(500UL); // 1/2 sec
if (m_killed)
return NULL;
m_dongle->Create();
m_dongle->SetPriority(100U);
m_dongle->Run();
while (!m_killed) {
if (m_reader != NULL)
processFile();
Sleep(500UL); // 1/2 sec
}
m_soundcard->close();
delete m_soundcard;
m_dongle->kill();
m_dongle->Wait();
return NULL;
}
开发者ID:KH6VM,项目名称:OpenSystemFusion,代码行数:28,代码来源:DVToolReaderThread.cpp
示例17: tr
int MainWindow::on_evalbutton_clicked()
{
QString filex;
if(ui->line->text() == "")
{
filex = QFileDialog::getOpenFileName(this, tr("Choose a file to open."), QString(), tr("RSBXL2 Files (*.rsbxl2)"));
ui->line->setText(filex);
}
filex = ui->line->text();
QMessageBox box;
box.setText(tr("Error: File was not chosen."));
box.setIcon(QMessageBox::Warning);
int res = processFile(filex);
if(res == -1)
{
box.exec();
}
else if(res == -2)
{
box.setText(tr("Error: Could not open file."));
box.setIcon(QMessageBox::Critical);
box.exec();
}
return 0;
}
开发者ID:Bobhostern,项目名称:JabberSeca,代码行数:28,代码来源:mainwindow.cpp
示例18: killOp
void DownloadOperation::startDownload()
{
if (isTerminating()) {
killOp();
return ;
} // if terminating
FileInfo *fileInfo = m_toCopy->getFileInfo();
// Logging
if (m_toCopy->getFirst()->getParent() == NULL) {
StringStorage message;
message.format(_T("Downloading '%s' %s"), m_pathToTargetFile.getString(),
fileInfo->isDirectory() ? _T("folder") : _T("file"));
notifyInformation(message.getString());
} // logging
if (fileInfo->isDirectory()) {
processFolder();
} else {
processFile();
} // if not directory
if (isTerminating()) {
killOp();
return ;
} // if terminating
}
开发者ID:skbkontur,项目名称:KonturVNC,代码行数:30,代码来源:DownloadOperation.cpp
示例19: while
void ProcessorThread::threadProc()
{
while (!exit && !ctxt.error) {
std::string fn = ctxt.queue.dequeue(dequeueTimeout);
if (!fn.empty()) {
busy = true;
// TODO: Exception handling
try {
processFile(fn, ctxt);
}
catch (const Exceptions::Exception& ex) {
ctxt.error = true;
fprintf(stderr, "%s\n", ex.message.c_str());
}
catch (const std::exception& ex) {
ctxt.error = true;
fprintf(stderr, "Unexpected fatal error: %s\n", ex.what());
}
catch (...) {
ctxt.error = true;
fprintf(stderr, "Unexpected fatal error");
}
busy = false;
}
}
}
开发者ID:jueqingsizhe66,项目名称:semtex-1,代码行数:26,代码来源:ProcessorThread.cpp
示例20: main
int main(int argc, char *argv[])
{
char *fn=NULL,*p=NULL,ch;
FILE *in;
if (argc!=2) {
fprintf(stderr,"usage: %s filename\n",argv[0]);
return 2;
}
fn=strdup(argv[1]);
if ((p=strrchr(fn,'/'))) {
ch=*(p+1);
*(p+1)=0;
path=strdup(fn);
*(p+1)=ch;
}
else path="";
in=fopen(fn,"r");
if (in) processFile(strdup(fn),in,stdout);
else {
fprintf(stderr,"file %s not found\n",fn);
err=1;
}
if (*path) free(path);
if (*fn) free(fn);
return err;
}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:32,代码来源:mofpp.c
注:本文中的processFile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论