Beispiel #1
0
void build(DataArchive& a, const char* sBasePath)
{
    char  sPath[256];
    char  sFind[256];

    if (sBasePath && *sBasePath) {
        strcpy(sPath, sBasePath);
        sprintf(sFind, "%s\\*.*", sPath);
    } else {
        sPath[0] = 0;
        strcpy(sFind, "*.*");
    }

    WIN32_FIND_DATA   find;
    std::wstring sTemp;
    std::string sStd = sFind;
    sTemp = ToWideString(sStd);
    HANDLE h = FindFirstFile(sTemp.c_str(), &find);
    if (h != INVALID_HANDLE_VALUE) {
        do buildFile(a, sPath, find);
        while (FindNextFile(h, &find));

    FindClose(h);
    }
}
Beispiel #2
0
    void ZendParser::buildFiles(File file, vector<string> tmpOut, int &processed,
                                vector<DirectoryReader::Item> *readerResult,
                                vector<pair<string, string> > &tmpOutPairs, vector<string> &tmpVector) {
        for (vector<DirectoryReader::Item>::iterator it = readerResult->begin();
             it != readerResult->end(); ++it) {
            if (!it->isFile ||
                it->name.find(".php") == string::npos) { //@todo find php3 and all possible native built in extensions
                continue;
            }

//		if (it->name.compare("Select.php") != 0) {
//			continue;
//		}

            file = buildFile(&(*it), tmpOutPairs, tmpOut, tmpVector);
            processed++;
            if (!file.isValid) {
                continue;
            }
            file.rootPath = it->dir;
            for (PreparedType type : file.prepTypes) {
                typesRegistryUnfiltered->push_back(type);
            }
            for (PreparedType type : file.prepTypesMain) {
                typesRegistryUnfiltered->push_back(type);
            }
            results->push_back(file);
        }
    }
Beispiel #3
0
int main(int argc, char **argv)
{
    new KInstance("makekdewidgets");

    KAboutData about("makekdewidgets", I18N_NOOP("makekdewidgets"), version, description, KAboutData::License_GPL,
                     "(C) 2004-2005 ian reinhart geiser", 0, 0, "*****@*****.**");
    about.addAuthor("ian reinhart geiser", 0, "*****@*****.**");
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if(args->count() < 1)
    {
        args->usage();
        return (1);
    }

    QFileInfo fi(args->arg(args->count() - 1));

    QString outputFile = args->getOption("o");
    QString pluginName = args->getOption("n");
    QString group = args->getOption("g");
    QString iconPath = "";
    if(args->isSet("p"))
        iconPath = args->getOption("p");
    QString fileName = fi.absFilePath();

    if(args->isSet("o"))
    {
        QFile output(outputFile);
        if(output.open(IO_WriteOnly))
        {
            QTextStream ts(&output);
            buildFile(ts, group, fileName, pluginName, iconPath);
        }
        output.close();
    }
    else
    {
        QTextStream ts(stdout, IO_WriteOnly);
        buildFile(ts, group, fileName, pluginName, iconPath);
    }
}
Beispiel #4
0
bool AssemblerY86::compile(std::string input_file, std::string output_file)
{
    dict.erase(dict.begin(),dict.end());
    check.erase(check.begin(),check.end());
    InstructionRegister.erase(InstructionRegister.begin(),InstructionRegister.end());
    readFile(input_file);
    bool result = checkBool();
    if (result) return false;
    buildFile(output_file);
    return true;
}
Beispiel #5
0
int main(){
	char fileName[20];
	char errorLogFileName[20];
	createBotDirectory(errorLogFileName);
	createFileName(fileName, 1);
	genFile(fileName);
	if(buildFile(fileName, errorLogFileName)!=-1){
		runFile(fileName, errorLogFileName);
	}else{
		printf("Build error\n");
	}
}
Beispiel #6
0
/*
 * main function
 * @return EXIT_SUCCESS upon completion
 */
int main(void)
{
    FILE *file; //the file to read and write to

    srand((unsigned int)time(NULL)); //seed for the getRandNum function

    //Calls the buildFile function
    buildFile(&file, NUM_ITEMS);

    //calls the printFile
    printFile(file);

    return EXIT_SUCCESS;
}