diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/agstools.sln b/agstools.sln new file mode 100644 index 0000000..f9368a3 --- /dev/null +++ b/agstools.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33122.133 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arctool", "arctool\arctool.vcxproj", "{A3583B8D-F786-4FB5-A47A-3F662DB19F1E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Debug|x64.ActiveCfg = Debug|x64 + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Debug|x64.Build.0 = Debug|x64 + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Debug|x86.ActiveCfg = Debug|Win32 + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Debug|x86.Build.0 = Debug|Win32 + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Release|x64.ActiveCfg = Release|x64 + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Release|x64.Build.0 = Release|x64 + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Release|x86.ActiveCfg = Release|Win32 + {A3583B8D-F786-4FB5-A47A-3F662DB19F1E}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8242B60A-FD63-4564-9793-BECC1AE03468} + EndGlobalSection +EndGlobal diff --git a/arctool/arctool.vcxproj b/arctool/arctool.vcxproj new file mode 100644 index 0000000..7ad7b9d --- /dev/null +++ b/arctool/arctool.vcxproj @@ -0,0 +1,145 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {a3583b8d-f786-4fb5-a47a-3f662db19f1e} + arctool + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + ..\bin\ + $(ProjectName)_$(Configuration) + ..\build\ + + + ..\bin\ + $(ProjectName)_$(Configuration) + ..\build\ + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/arctool/arctool.vcxproj.filters b/arctool/arctool.vcxproj.filters new file mode 100644 index 0000000..4095799 --- /dev/null +++ b/arctool/arctool.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {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 + + + \ No newline at end of file diff --git a/arctool/arctool_cli.cpp b/arctool/arctool_cli.cpp new file mode 100644 index 0000000..c14255d --- /dev/null +++ b/arctool/arctool_cli.cpp @@ -0,0 +1,106 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Project: agstools +// Program: archive_tool +// Purpose: + +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Function: archive_info +// Purpose: Displays info about provided archive. +void archive_info(std::string& input_path) +{ + //Struct --NOTE: May move to global if other functions use it or create overall archive class + struct file_node + { + std::string name; + int size = 0; + int location = 0; + }; + + //Local Variables + std::ifstream input_file; + char* p_buffer = NULL; + file_node* p_files_array = NULL; + + + //Assumes exists --NOTE: Replace with check to check if exists, then what type. + input_file.open(input_path); + p_buffer = new char[8]; + + input_file.read(p_buffer, 8); + + /* + if (p_buffer == MAGIC) + { + + } + else + { + //Not correct format! + } + + + */ + ; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Function: main +// Purpose: Program entry point +int main(int arg_count, char* p_arg_array[]) +{ + //Initial argument debug +#ifdef _DEBUG + printf("\nDEBUG: Number of arguments: %i\n", arg_count); + for (int a = 0; a < arg_count; a++) + { + printf("DEBUG: [%i] %s\n", a, p_arg_array[a]); + } +#endif + + //Local Variables + std::string temp; + std::string input_path; + std::string output_path; + + //Start program + if (arg_count > 1) + { + if (arg_count < 5) + { + temp = p_arg_array[1]; + + if (temp == "-info" || temp == "-i") + { + input_path = p_arg_array[2]; + if (arg_count >= 3) + { + //Set output path + } + archive_info(input_path); + + return 0; //We good? + } + else + { + printf("\nError! Unknown argument!"); + } + } + else + { + printf("\nError! Too many arguments!"); + } + } + else + { + printf("\nError! Not enough arguments!"); + } + + //Usage branding + printf("\n\nUsage: