Releases: WTCa100/Tofik
v1.0.0
Tester.cpp and FileSpammer.exe
In order to check how the program works I decided to create a different small program that will spam, a bunch of barren files with user defined extentions.
FileSpammer.exe is basically compiled Tester.cpp that I decided to include in the project.
Usage:
FileSpammer.exe [Number of files] [Name of the files] [Files extention] -[path location]
Note that you are prohibited to use "." and any other prohibited symbols in [File extention] and [File name] argument
There are only two avilable path locations:
-x
- This will output the provided files inside ./xlsxRawFiles/
-c
- This will output the provided files inside ./csvOutFiles/
-h
- Help page, with the list of all paths and usage examples.
Example usage:
.\FileSpammer 10 MakeIt Rain -x # This will output 10 MakeIt.Rain files in .\xlsxRawFiles\
.\FileSpammer 5 Dummy Dum -c # This will output 5 Dummy.Dum files in .\csvOutFiles\
When we get into the details you may see that the non-.xlsx
file creation works in pretty easy to get way:
Inside Spam
Class we have CreateExtendedFiles
method.
i == 0 ? tmpFile.open(FileOutputPathXLSX + this->strFinalFileName) : tmpFile.open(FileOutputPathXLSX + this->strFinalFileName + '(' + std::to_string(i+1) + ')';
[FileSpammer.zip](https://github.com/WTCa100/Tofik/files/9561205/FileSpammer.zip)
tmpFile.close();
The .xlsx
file creation is quite different than the other extentions. Since there is no external library required and the premise was to make it as
simple as possible it uses quite an bizzare technique. In folder exlTemplate
there is a file simply named template.xlsx
, the program takes it as... well
template and copies it N times (where N is the user defined value).
Path-finding
const std::string strXlsxPathX = "xlsxRawFiles\\"; // For system(const char* _Command)
const std::string strXlsxPathC = "csvOutFiles\\"; // For system(const char* _Command)
Copying
std::string strCommandCopy = "copy exlTemplate\\template.xlsx ";
system((strCommandCopy + strXlsxPathX + this->strFileName + this->strFileExtention).c_str());