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=dG+f*)^TY;u}qH08$fUqa<0PxYEW<1yE17WIgNJZTViOD-+41qc-th
zX}~lN#whY#O
zW$?byBb!~a(FCsfZeWM|DfoYCDcj68yM{XM+FHZL!E|JTNJo962ch>fE=wnJ!!V}O
qr1n>Ls~ci4SwjT^*dSq{;D7CR!n2#_@y;Zc6*pR<%rw^~+W!IM(>J96
literal 0
HcmV?d00001
diff --git a/feladat3/feladat3/dataset/testin5.dat b/feladat3/feladat3/dataset/testin5.dat
new file mode 100644
index 0000000..0bea184
--- /dev/null
+++ b/feladat3/feladat3/dataset/testin5.dat
@@ -0,0 +1 @@
+”kÜ~:#q/#
\ No newline at end of file
diff --git a/feladat3/feladat3/dataset/testin50.dat b/feladat3/feladat3/dataset/testin50.dat
new file mode 100644
index 0000000..abd7b60
--- /dev/null
+++ b/feladat3/feladat3/dataset/testin50.dat
@@ -0,0 +1 @@
+krc0ŽCÆâ.ri‰HŸH9S*9<
7s)oPMíLHYµ
D-Äy*&øp€O>*r]DFt^PßuXû+á!Ëëißù}±pƒUÎ8™?a'Óp(<
\ No newline at end of file
diff --git a/feladat3/feladat3/datasets.txt b/feladat3/feladat3/datasets.txt
new file mode 100644
index 0000000..9f323d6
--- /dev/null
+++ b/feladat3/feladat3/datasets.txt
@@ -0,0 +1,12 @@
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin5.dat
+
+
+C:\nonexistent.dum
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin10.dat
+
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin50.dat
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin100.dat
+
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin10000.dat
+
+
diff --git a/feladat3/feladat3/feladat3.cpp b/feladat3/feladat3/feladat3.cpp
new file mode 100644
index 0000000..bb1d1b7
--- /dev/null
+++ b/feladat3/feladat3/feladat3.cpp
@@ -0,0 +1,73 @@
+// IFPQYY | Tóth Dániel Mátyás | V1
+#include
+#include
+#include "feladat3.h"
+using namespace std;
+
+int GetFilenames(int argc, char* argv[],
+ char infilenames[MYMAXFILES][MYMAXFN],
+ char outfilenames[MYMAXFILES][MYMAXFN]) {
+ if (argc != 2 || argv == nullptr || infilenames == nullptr
+ || outfilenames == nullptr) {
+ return NOK;
+ }
+
+ cout << "Parameter allomany:\n" << argv[1] << '\n';
+ ifstream argifs(argv[1]);
+ if (!argifs.is_open())
+ {
+ cout << "Nem lehet megnyitni a " << argv[1] << " nevu allomanyt\n";
+ return NOK;
+ }
+ int readAmount = 0;
+ int i = 0;
+ char buf[MYMAXFN-1];
+ cout << "Feldolgozando allomanyok:\n";
+ while (readAmount < 5 && argifs.getline(buf, MYMAXFN-1))
+ {
+ readAmount++;
+ ifstream inputfile(buf);
+ if (!inputfile.fail())
+ {
+ strncpy_s(infilenames[i], buf, strlen(buf)); //if these are not allowed I'm gonna blow up
+ strncpy_s(outfilenames[i], buf, strlen(buf));
+ strcat_s(outfilenames[i], ".srt");
+ cout << infilenames[i] << " " << outfilenames[i] << "\tOK\n";
+ i++;
+ }
+ else
+ {
+ cout << "<" << buf << ">" << "\tNOK\n";
+ }
+ }
+ argifs.close();
+ int status = OK;
+ if (i == 0)
+ {
+ status = NOK;
+ cout << "Ures\tNOK\n";
+ }
+ cout << "*DONE\n";
+ return status;
+}
+int SortFile(char* infn, char* outfn, unsigned char* buf,
+ unsigned short* pmin, unsigned short* pmax,
+ unsigned short* pavg, unsigned short* pn,
+ unsigned short bufsize = MYBUFSIZE, bool test = false) {
+
+ if (infn == nullptr || outfn == nullptr
+ || buf == nullptr || pmin == nullptr
+ || pmax == nullptr || pavg == nullptr
+ || pn == nullptr) // there has to be a better way than this
+ {
+ return NOK;
+ }
+ if (bufsize != 8192) //I guess?
+ {
+ return NOK;
+ }
+}
+
+static int ReadFile(char* filename, int bufsize) {
+
+}
\ No newline at end of file
diff --git a/feladat3/feladat3/feladat3.h b/feladat3/feladat3/feladat3.h
new file mode 100644
index 0000000..97f28e5
--- /dev/null
+++ b/feladat3/feladat3/feladat3.h
@@ -0,0 +1,15 @@
+// IFPQYY | Tóth Dániel Mátyás | V1
+#pragma once
+#define MYBUFSIZE 8192
+#define MYMAXVALUE 65535
+#define MYMAXFILES 5
+#define MYMAXFN 128
+#define OK 0
+#define NOK (-1)
+int GetFilenames(int argc, char* argv[],
+ char infilenames[MYMAXFILES][MYMAXFN],
+ char outfilenames[MYMAXFILES][MYMAXFN]);
+int SortFile(char* infn, char* outfn, unsigned char* buf,
+ unsigned short* pmin, unsigned short* pmax,
+ unsigned short* pavg, unsigned short* pn,
+ unsigned short bufsize = MYBUFSIZE, bool test = false);
diff --git a/feladat3/feladat3/feladat3.vcxproj b/feladat3/feladat3/feladat3.vcxproj
new file mode 100644
index 0000000..f37945e
--- /dev/null
+++ b/feladat3/feladat3/feladat3.vcxproj
@@ -0,0 +1,151 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 18.0
+ Win32Proj
+ {05ad42de-8f96-4351-b07d-784a20d752bd}
+ feladat3
+ 10.0
+
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/feladat3/feladat3/feladat3.vcxproj.filters b/feladat3/feladat3/feladat3.vcxproj.filters
new file mode 100644
index 0000000..fc823c4
--- /dev/null
+++ b/feladat3/feladat3/feladat3.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/feladat3/feladat3/main.cpp b/feladat3/feladat3/main.cpp
new file mode 100644
index 0000000..02deaee
--- /dev/null
+++ b/feladat3/feladat3/main.cpp
@@ -0,0 +1,27 @@
+// IFPQYY | Tóth Dániel Mátyás | V1
+#include "feladat3.h"
+#include
+using namespace std;
+
+int main(int argc, char* argv[]) {
+ char infn[MYMAXFILES][MYMAXFN];
+ char outfn[MYMAXFILES][MYMAXFN];
+ static unsigned char buf[MYBUFSIZE];
+ unsigned short minv, maxv, avgv, nv;
+ if (GetFilenames(argc, argv, infn, outfn) == NOK)
+ {
+ return(NOK);
+ }
+ /*for (int n = 0; (n < MYMAXFILES) && (infn[n][0] != '\0'); n++)
+ {
+ if (SortFile(infn[n], outfn[n], buf, &minv, &maxv, &avgv, &nv) == NOK)
+ return(NOK);
+ }*/
+ /*cout << argc;
+ for (size_t i = 0; i < argc; i++)
+ {
+ cout << '\n';
+ cout << argv[i];
+ }*/
+ return(OK);
+}
\ No newline at end of file