![]() |
PhoenixLecture
2.0.0
Set of tools to make lectures
|
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include "OptionParser.h"
#include "PFileParser.h"
Go to the source code of this file.
Functions | |
OptionParser | createOptionParser () |
Create the OptionParser of this program. More... | |
int | main (int argc, char **argv) |
bool | processFile (const PPath &inputFile, const PString &command, size_t firstToken, size_t lastToken, size_t incrementToken, const PString &delimitor, bool isNoFail) |
Process the file. More... | |
bool | processVecFile (const PVecPath &vecInputFile, const PString &command, size_t firstToken, size_t lastToken, size_t incrementToken, const PString &delimitor, bool isNoFail) |
Process the program. More... | |
OptionParser createOptionParser | ( | ) |
Create the OptionParser of this program.
Definition at line 18 of file main.cpp.
References OptionParser::addOption(), OptionType::FILENAME, OptionType::NONE, OptionParser::setExampleLongOption(), OptionParser::setExampleShortOption(), and OptionType::STRING.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 121 of file main.cpp.
References createOptionParser(), OptionParser::getDefaultMode(), OptionMode::getValue(), OptionMode::isOptionExist(), OptionParser::parseArgument(), and processVecFile().
bool processFile | ( | const PPath & | inputFile, |
const PString & | command, | ||
size_t | firstToken, | ||
size_t | lastToken, | ||
size_t | incrementToken, | ||
const PString & | delimitor, | ||
bool | isNoFail | ||
) |
Process the file.
inputFile | : input file |
command | : command to be used |
firstToken | : Index of the first token to be tested |
lastToken | : Index of the last token to be tested |
incrementToken | : Increment of the index to be used |
delimitor | : All delimitor characters to be used to tokenise the input file |
isNoFail | : true to ignore if the tested program failed or not, false for normal behaviour |
Definition at line 49 of file main.cpp.
References PPath::getExtension(), PFileParser::getNextToken(), PFileParser::isEndOfFile(), PFileParser::open(), PString::replace(), PPath::saveFileContent(), and PFileParser::setSeparator().
Referenced by main(), processFileOrDir(), and processVecFile().
bool processVecFile | ( | const PVecPath & | vecInputFile, |
const PString & | command, | ||
size_t | firstToken, | ||
size_t | lastToken, | ||
size_t | incrementToken, | ||
const PString & | delimitor, | ||
bool | isNoFail | ||
) |
Process the program.
vecInputFile | : vector of input files |
command | : command to be used |
firstToken | : Index of the first token to be tested |
lastToken | : Index of the last token to be tested |
incrementToken | : Increment of the index to be used |
delimitor | : All delimitor characters to be used to tokenise the input file |
isNoFail | : true to ignore if the tested program failed or not, false for normal behaviour |
Definition at line 110 of file main.cpp.
References processFile().
Referenced by main().