This commit is contained in:
Damimani 2026-10-24 09:35:47 +02:00
commit 67a2391619
37 changed files with 2388 additions and 0 deletions

7
feladat3/feladat3.slnx Normal file
View file

@ -0,0 +1,7 @@
<Solution>
<Configurations>
<Platform Name="x64" />
<Platform Name="x86" />
</Configurations>
<Project Path="feladat3/feladat3.vcxproj" />
</Solution>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
婆ワ~:#q/#

View file

@ -0,0 +1 @@
krc0ŽCÆâ.ri‰HŸH9S*9< 7s)oPMíLHYµ D-Äy*&øp€O>*r]DFt^PßuXû+á!Ëëiß<!ézF>ù}±pƒUÎ8™?a'Óp(<

View file

@ -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

View file

@ -0,0 +1,73 @@
// IFPQYY | Tóth Dániel Mátyás | V1
#include <iostream>
#include <fstream>
#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) {
}

View file

@ -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);

View file

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>18.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{05ad42de-8f96-4351-b07d-784a20d752bd}</ProjectGuid>
<RootNamespace>feladat3</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Manifest>
<EnableSegmentHeap>true</EnableSegmentHeap>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Manifest>
<EnableSegmentHeap>true</EnableSegmentHeap>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Manifest>
<EnableSegmentHeap>true</EnableSegmentHeap>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Manifest>
<EnableSegmentHeap>true</EnableSegmentHeap>
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="feladat3.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="feladat3.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="feladat3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="feladat3.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -0,0 +1,27 @@
// IFPQYY | Tóth Dániel Mátyás | V1
#include "feladat3.h"
#include <iostream>
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);
}