diff options
| author | Chanin Timbal <[email protected]> | 2024-06-01 11:55:26 -0700 |
|---|---|---|
| committer | Chanin Timbal <[email protected]> | 2024-06-01 11:55:26 -0700 |
| commit | e57173d536465fe12cea8a605d7b0d0e4f02bbf1 (patch) | |
| tree | 3d00ca12b96b7c62c80d4914bc9b71e3192ff7d3 /CST 126/Homework_2 | |
| parent | attempting rebuild (diff) | |
| download | homework-1-chaninnohea-e57173d536465fe12cea8a605d7b0d0e4f02bbf1.tar.xz homework-1-chaninnohea-e57173d536465fe12cea8a605d7b0d0e4f02bbf1.zip | |
trying to fix!
Diffstat (limited to 'CST 126/Homework_2')
| -rw-r--r-- | CST 126/Homework_2/Base64Converter.hpp | 25 | ||||
| -rw-r--r-- | CST 126/Homework_2/FindingPi.exe | bin | 0 -> 3496762 bytes | |||
| -rw-r--r-- | CST 126/Homework_2/Homework_2.vcxproj | 142 | ||||
| -rw-r--r-- | CST 126/Homework_2/Homework_2.vcxproj.filters | 35 | ||||
| -rw-r--r-- | CST 126/Homework_2/destination_file.txt | 0 | ||||
| -rw-r--r-- | CST 126/Homework_2/helpers.hpp | 88 |
6 files changed, 290 insertions, 0 deletions
diff --git a/CST 126/Homework_2/Base64Converter.hpp b/CST 126/Homework_2/Base64Converter.hpp new file mode 100644 index 0000000..36e55e4 --- /dev/null +++ b/CST 126/Homework_2/Base64Converter.hpp @@ -0,0 +1,25 @@ +#ifndef BASE64_CONVERTER_HPP +#define BASE64_CONVERTER_HPP + +char characterMap[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', +'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', +'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', +'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', +'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '/', '+'}; + + + +inline char* Base64Encode(char* buffer, size_t& size) +{ + + + + + + + + + +} + +#endif
\ No newline at end of file diff --git a/CST 126/Homework_2/FindingPi.exe b/CST 126/Homework_2/FindingPi.exe Binary files differnew file mode 100644 index 0000000..4b128d3 --- /dev/null +++ b/CST 126/Homework_2/FindingPi.exe diff --git a/CST 126/Homework_2/Homework_2.vcxproj b/CST 126/Homework_2/Homework_2.vcxproj new file mode 100644 index 0000000..85f5a4d --- /dev/null +++ b/CST 126/Homework_2/Homework_2.vcxproj @@ -0,0 +1,142 @@ +<?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>17.0</VCProjectVersion> + <Keyword>Win32Proj</Keyword> + <ProjectGuid>{b4079f93-9f2b-440c-ab0d-7774ab0a8635}</ProjectGuid> + <RootNamespace>Homework2</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>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v143</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> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </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> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </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> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="Base64Converter.hpp" /> + <ClInclude Include="helpers.hpp" /> + </ItemGroup> + <ItemGroup> + <Text Include="destination_file.txt" /> + </ItemGroup> + <ItemGroup> + <None Include="FindingPi.exe" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/CST 126/Homework_2/Homework_2.vcxproj.filters b/CST 126/Homework_2/Homework_2.vcxproj.filters new file mode 100644 index 0000000..7f35e06 --- /dev/null +++ b/CST 126/Homework_2/Homework_2.vcxproj.filters @@ -0,0 +1,35 @@ +<?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> + <ClInclude Include="Base64Converter.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="helpers.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <Text Include="destination_file.txt"> + <Filter>Source Files</Filter> + </Text> + </ItemGroup> + <ItemGroup> + <None Include="FindingPi.exe"> + <Filter>Source Files</Filter> + </None> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/CST 126/Homework_2/destination_file.txt b/CST 126/Homework_2/destination_file.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/CST 126/Homework_2/destination_file.txt diff --git a/CST 126/Homework_2/helpers.hpp b/CST 126/Homework_2/helpers.hpp new file mode 100644 index 0000000..e448cc9 --- /dev/null +++ b/CST 126/Homework_2/helpers.hpp @@ -0,0 +1,88 @@ +#ifndef HELPERS_HPP +#define HELPERS_HPP + + +//file reading things +inline char* ReadTextFromFile(const char* fileName, char* buffer) +{ + return buffer; +} + +inline char* ReadFileAsBinary(const char* fileName, char* buffer, size_t& size) +{ + try + { + //open the fstream in input mode, with binary mode + std::fstream file(fileName, std::ios::in | std::ios::binary); + + if (!file.is.open()) + { + std::cerr << "Could not open file for binary input: " << fileName; + return buffer; + } + + file.seekg(0, std::ios::end); + + std::streamsize size = file.tellg(); + + file.seekg(0, std::ios::beg); + + delete[] buffer; + + buffer = nullptr; + + //size the buffer with a new + buffer = new char[size]; + + file.read(buffer, size); + + file.close(); + + return buffer; + } + catch (const std::exception& ex) + { + std::cerr << "Exception during binary file input: " << fileName << "was not successfully streamed to binary"; + ex.what() + return buffer; + } +} + +//file writing things +inline bool WriteTextToFile(const char* fileName, const char* fileContents) +{ + std::ostream file(fileName); + + if (!file.is_open()) + { + std::cerr << "Could not open file: " << fileName; + return false; + } + + file << fileContents; + + file.close(); + + return false; +} + +inline bool WriteFileFromBinary(const char* fileName, const char* buffer) +{ + return false; +} + + + + + + + + + + + + + + + +#endif
\ No newline at end of file |