19 Commits

Author SHA1 Message Date
Kun Deng c96ee39c6a Merge pull request #17 from kdeng00/cleanup
Cleanup
2022-08-28 10:53:23 -04:00
Kun Deng 389f41ecea Updates
Updated CMakeLists file, removed conan file, and have all windows configs targeting C++20
2022-08-28 10:53:00 -04:00
Kun Deng 10bf0fb0e1 Clean up and version change 2022-08-28 10:49:28 -04:00
Kun Deng 4429f7e766 Merge pull request #16 from kdeng00/bug_fix
Bug fix
2022-08-28 10:36:11 -04:00
Kun Deng e5d119d343 Bug fix 2022-08-28 10:34:27 -04:00
Kun Deng 1d88a3ccf6 Update README.md 2022-08-07 21:40:23 -04:00
Kun Deng 2768c1e351 Update README.md 2022-08-07 21:40:01 -04:00
Kun Deng 3955942988 Merge pull request #15 from kdeng00/v0.3
V0.3
2022-08-07 21:37:39 -04:00
Kun Deng bfd7a02970 Merge pull request #14 from kdeng00/vs
Vs
2022-08-07 21:35:55 -04:00
kdeng00 77acd15105 Able to debug with Visual Studio 2022-08-07 21:34:41 -04:00
kdeng00 435a0df941 Added build files
Added Visual studio build files
2022-08-07 21:15:54 -04:00
kdeng00 c624c4de51 Missing include 2022-08-07 21:15:07 -04:00
Kun Deng 1d6cd804be Merge pull request #13 from kdeng00/vcpkg
Vcpkg
2022-08-07 20:46:24 -04:00
kdeng00 2743543102 Clean up 2022-08-07 20:44:37 -04:00
kdeng00 3195011f99 vcpkg is operational 2022-08-07 20:42:11 -04:00
kdeng00 ed5ceedb44 vcpkg version
Version 2022.07.25
2022-08-07 20:04:57 -04:00
kdeng00 f70acba704 Added vcpkg 2022-08-07 20:04:02 -04:00
Kun Deng f224b5738b Merge pull request #12 from kdeng00/build_fix
Fixed build issue
2022-08-07 19:59:29 -04:00
kdeng00 c41cd9dbb7 Fixed build issue 2022-08-07 19:51:29 -04:00
18 changed files with 550 additions and 67 deletions
+3
View File
@@ -0,0 +1,3 @@
/.vs/*
/build
/x64
+3
View File
@@ -0,0 +1,3 @@
[submodule "3rdparty/vcpkg"]
path = 3rdparty/vcpkg
url = https://github.com/microsoft/vcpkg
Vendored Submodule
+1
Submodule 3rdparty/vcpkg added at f93ba152d5
+46 -27
View File
@@ -1,41 +1,63 @@
cmake_minimum_required(VERSION 3.14) cmake_minimum_required(VERSION 3.23.3)
set(VCPKG_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/vcpkg)
message("The vcpkg root path ${VCPKG_ROOT_PATH}")
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(TOOLCHAIN_PATH ${VCPKG_ROOT_PATH}/scripts/buildsystems/vcpkg.cmake)
set(CMAKE_TOOLCHAIN_FILE
"${TOOLCHAIN_PATH}"
CACHE STRING "Vcpkg toolchain file")
message("Using default toolchain file")
endif()
project(IcarusDownloadManager) set(SOFTWARE_DESCRIPTION
"A tool to interact with the Icarus Music streaming API")
set(SOFTWARE_VERSION
"0.3.2")
project(IcarusDownloadManager VERSION ${SOFTWARE_VERSION} DESCRIPTION ${SOFTWARE_DESCRIPTION} LANGUAGES CXX)
message(STATUS "Checking compiler flags for C++17 support.")
# Set C++17 support flags for various compilers message(STATUS "Checking compiler flags for C++20 support.")
# Set C++20 support flags for various compilers
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
if(WIN32) if(WIN32)
message("Windows") message("Windows environment")
set(vs_ver 19.29.30138)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL ${vs_ver}) if (MSVC_VERSION GREATER_EQUAL "1900")
message("Visual Studio version is at least ${vs_ver}") message("Visual Studio version is at least ${vs_ver}")
set(CMAKE_CXX_STANDARD_COMPILE_OPTION "-std:c++latest") include(CheckCXXCompilerFlag)
set(CMAKE_CXX_EXTENSION_COMPILE_OPTION "-std:c++latest") CHECK_CXX_COMPILER_FLAG("/std:c++20" _cpp_latest_flag_supported)
if (_cpp_latest_flag_supported)
add_compile_options("/std:c++20")
endif()
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif() endif()
else() else()
check_cxx_compiler_flag("-std=c++17" COMPILER_SUPPORTS_CXX17) check_cxx_compiler_flag("-std=c++20" COMPILER_SUPPORTS_CXX20)
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X) check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX17) if(COMPILER_SUPPORTS_CXX20)
message(STATUS "C++17 is supported.") message(STATUS "C++20 is supported.")
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20 -stdlib=libc++")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
endif() endif()
elseif(COMPILER_SUPPORTS_CXX0X) elseif(COMPILER_SUPPORTS_CXX0X)
message(STATUS "C++0x is supported.") message(STATUS "C++0x is supported.")
@@ -45,7 +67,7 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif() endif()
else() else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.") message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++20 support. Please use a different C++ compiler.")
endif() endif()
endif() endif()
@@ -69,19 +91,16 @@ set(SOURCES
set(IDM_INCLUDE_DIR set(IDM_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/include") "${CMAKE_CURRENT_SOURCE_DIR}/include")
# conan include_directories(${IDM_INCLUDE_DIR})
set(CONAN_BUILDINFO
${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
message("conan build info ${CONAN_BUILDINFO}")
include(${CONAN_BUILDINFO})
conan_basic_setup()
include_directories(${CPR_INCLUDE_DIRS} ${IDM_INCLUDE_DIR})
set(USE_SYSTEM_CURL OFF) set(USE_SYSTEM_CURL OFF)
set(BUILD_CPR_TESTS OFF) set(BUILD_CPR_TESTS OFF)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
find_package(cpr CONFIG REQUIRED)
add_executable(icd ${SOURCES}) add_executable(icd ${SOURCES})
target_link_libraries(icd PUBLIC ${CONAN_LIBS}) target_link_libraries(icd PRIVATE nlohmann_json::nlohmann_json OpenSSL::SSL OpenSSL::Crypto CURL::libcurl cpr::cpr)
+99
View File
@@ -0,0 +1,99 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,3,2,0
PRODUCTVERSION 0,3,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Tool to interact with Icarus API"
VALUE "FileVersion", "0.3.2.0"
VALUE "InternalName", "IcarusDo.exe"
VALUE "LegalCopyright", "Copyright (C) 2022"
VALUE "OriginalFilename", "IcarusDo.exe"
VALUE "ProductName", "IcarusDownloadManager"
VALUE "ProductVersion", "0.3.2.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+31
View File
@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32630.192
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IcarusDownloadManager", "IcarusDownloadManager.vcxproj", "{12955990-643F-4A99-95E5-4752AFA179B0}"
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
{12955990-643F-4A99-95E5-4752AFA179B0}.Debug|x64.ActiveCfg = Debug|x64
{12955990-643F-4A99-95E5-4752AFA179B0}.Debug|x64.Build.0 = Debug|x64
{12955990-643F-4A99-95E5-4752AFA179B0}.Debug|x86.ActiveCfg = Debug|Win32
{12955990-643F-4A99-95E5-4752AFA179B0}.Debug|x86.Build.0 = Debug|Win32
{12955990-643F-4A99-95E5-4752AFA179B0}.Release|x64.ActiveCfg = Release|x64
{12955990-643F-4A99-95E5-4752AFA179B0}.Release|x64.Build.0 = Release|x64
{12955990-643F-4A99-95E5-4752AFA179B0}.Release|x86.ActiveCfg = Release|Win32
{12955990-643F-4A99-95E5-4752AFA179B0}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EA22B463-3EA6-4452-9AF1-D300C3BDE72D}
EndGlobalSection
EndGlobal
+165
View File
@@ -0,0 +1,165 @@
<?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>
<ProjectGuid>{12955990-643F-4A99-95E5-4752AFA179B0}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<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>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</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" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(ProjectDir)include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(ProjectDir)include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\Main.cpp" />
<ClCompile Include="src\managers\ActionManager.cpp" />
<ClCompile Include="src\managers\CommitManager.cpp" />
<ClCompile Include="src\managers\FileManager.cpp" />
<ClCompile Include="src\managers\TokenManager.cpp" />
<ClCompile Include="src\managers\UserManager.cpp" />
<ClCompile Include="src\models\Song.cpp" />
<ClCompile Include="src\parsers\APIParser.cpp" />
<ClCompile Include="src\syncers\Delete.cpp" />
<ClCompile Include="src\syncers\Download.cpp" />
<ClCompile Include="src\syncers\RetrieveRecords.cpp" />
<ClCompile Include="src\syncers\Upload.cpp" />
<ClCompile Include="src\utilities\Conversions.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\managers\ActionManager.h" />
<ClInclude Include="include\managers\CommitManager.h" />
<ClInclude Include="include\managers\FileManager.h" />
<ClInclude Include="include\managers\TokenManager.h" />
<ClInclude Include="include\managers\UserManager.h" />
<ClInclude Include="include\models\API.h" />
<ClInclude Include="include\models\Flags.h" />
<ClInclude Include="include\models\IcarusAction.h" />
<ClInclude Include="include\models\Song.h" />
<ClInclude Include="include\models\Token.h" />
<ClInclude Include="include\models\UploadForm.h" />
<ClInclude Include="include\models\User.h" />
<ClInclude Include="include\parsers\APIParser.h" />
<ClInclude Include="include\syncers\Delete.h" />
<ClInclude Include="include\syncers\Download.h" />
<ClInclude Include="include\syncers\RetrieveRecords.h" />
<ClInclude Include="include\syncers\SyncerBase.h" />
<ClInclude Include="include\syncers\Upload.h" />
<ClInclude Include="include\utilities\Checks.h" />
<ClInclude Include="include\utilities\Conversions.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="IcarusDownloadManager.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+120
View File
@@ -0,0 +1,120 @@
<?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;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;hm;inl;inc;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</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\managers\ActionManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\managers\CommitManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\managers\FileManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\managers\TokenManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\managers\UserManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\models\Song.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\parsers\APIParser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\syncers\Delete.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\syncers\Download.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\syncers\RetrieveRecords.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\syncers\Upload.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\utilities\Conversions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\managers\ActionManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\managers\CommitManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\managers\FileManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\managers\TokenManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\managers\UserManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\models\API.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\models\Flags.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\models\IcarusAction.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\models\Song.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\models\Token.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\models\UploadForm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\models\User.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\parsers\APIParser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\syncers\Delete.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\syncers\Download.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\syncers\RetrieveRecords.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\syncers\SyncerBase.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\syncers\Upload.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\utilities\Checks.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\utilities\Conversions.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommandArguments>upload-meta -u kverse -p demolaugh -h http://localhost:5002 -smca "D:\OneDrive\media\music\mp3\bb_king\paying_the_cost_to_be_the_boss"</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerCommandArguments>upload-meta -u kverse -p demolaugh -h http://localhost:5002 -smca "D:\OneDrive\media\music\mp3\bb_king\paying_the_cost_to_be_the_boss"</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
+19 -6
View File
@@ -5,10 +5,10 @@ IcarusDownloadManager is a Linux CLI software client application that has the fe
## Built With ## Built With
* C++ with C++17 features * C++ with C++20 features
* CMake * CMake
* GCC >= 9 or Visual Studio >= 16 [2019] * GCC >= 10 or Visual Studio >= 17 [2022]
* [conan](https://github.com/conan-io/conan) * [vcpkg](https://github.com/microsoft/vcpkg)
* [json](https://github.com/nlohmann/json) * [json](https://github.com/nlohmann/json)
* [openssl](https://github.com/openssl/openssl) * [openssl](https://github.com/openssl/openssl)
* [curl](https://github.com/curl/curl) * [curl](https://github.com/curl/curl)
@@ -17,17 +17,29 @@ IcarusDownloadManager is a Linux CLI software client application that has the fe
### Getting Started ### Getting Started
Build the project: Clone the repo
``` ```
git clone --recursive https://github.com/kdeng00/IcarusDownloadManager git clone --recursive https://github.com/kdeng00/IcarusDownloadManager
```
Install packages
```
vcpkg install nlohman-json
vcpkg install openssl
vcpkg install curl
vcpkg install cpr
```
Build the project:
```
cd IcarusDownloadManager
mkdir build mkdir build
cd build cd build
conan install .. --build
cmake .. cmake ..
cmake --build . --config release -j cmake --build . --config release -j
``` ```
@@ -78,6 +90,7 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the code of conduc
## Versioning ## Versioning
[v0.3.0](https://github.com/kdeng00/IcarusDownloadManager/releases/tag/v0.3.0)
[v0.2.0](https://github.com/kdeng00/IcarusDownloadManager/releases/tag/v0.2.0) [v0.2.0](https://github.com/kdeng00/IcarusDownloadManager/releases/tag/v0.2.0)
[v0.1.1](https://github.com/kdeng00/IcarusDownloadManager/releases/tag/v0.1.1) [v0.1.1](https://github.com/kdeng00/IcarusDownloadManager/releases/tag/v0.1.1)
[v0.1.0](https://github.com/kdeng00/IcarusDownloadManager/releases/tag/0.1.0) [v0.1.0](https://github.com/kdeng00/IcarusDownloadManager/releases/tag/0.1.0)
-20
View File
@@ -1,20 +0,0 @@
[requires]
nlohmann_json/3.10.4
openssl/1.1.1l
libcurl/7.80.0
cpr/1.7.2
[generators]
cmake
[options]
openssl:shared=False
libcurl:shared=False
cpr:shared=False
libcurl:with_ssl=openssl
libcurl:with_ftp=False
libcurl:with_gopher=False
libcurl:with_imap=False
libcurl:with_pop3=False
libcurl:with_smb=False
libcurl:with_smtp=False
+10 -5
View File
@@ -3,6 +3,7 @@
#include<map> #include<map>
#include<iostream> #include<iostream>
#include<filesystem>
#include<string> #include<string>
#include<string_view> #include<string_view>
@@ -92,6 +93,8 @@ private:
// If 1 go with first standard, if 2 go with the second, if 0 then will default to 1 for disc and track // If 1 go with first standard, if 2 go with the second, if 0 then will default to 1 for disc and track
auto mode = 0; auto mode = 0;
const Str &songPath = song.songPath; const Str &songPath = song.songPath;
auto file = std::filesystem::path(songPath);
auto filename = file.filename().string();;
auto trd = song.songPath.find("trackd"); auto trd = song.songPath.find("trackd");
auto tr = song.songPath.find("track"); auto tr = song.songPath.find("track");
@@ -107,15 +110,16 @@ private:
} }
auto dl = [](char c, char t){ return c == t; }; auto dl = [](char c, char t){ return c == t; };
auto d = Utilities::Checks::itemIterInContainer<char, Str>(songPath, 'd', dl); auto d = Utilities::Checks::itemIterInContainer<char, Str>(filename, 'd', dl);
auto k = Utilities::Checks::itemIterInContainer<char, Str>(songPath, 'k', dl); auto k = Utilities::Checks::itemIterInContainer<char, Str>(filename, 'k', dl);
auto dot = Utilities::Checks::itemIterInContainer<char, Str>(songPath, '.', dl); auto dot = Utilities::Checks::itemIterInContainer<char, Str>(filename, '.', dl);
switch(mode) switch(mode)
{ {
case 1: case 1:
{ {
if (k != songPath.end() && dot != songPath.end()) // if (k != songPath.end() && dot != songPath.end())
if (k != filename.end() && dot != filename.end())
{ {
auto tStr = std::string(++k, dot); auto tStr = std::string(++k, dot);
std::cout << "TStr: " << tStr<<"\n"; std::cout << "TStr: " << tStr<<"\n";
@@ -129,7 +133,8 @@ private:
} }
case 2: case 2:
{ {
if (k != songPath.end() && dot != songPath.end() && d != songPath.end()) // if (k != songPath.end() && dot != songPath.end() && d != songPath.end())
if (k != filename.end() && dot != filename.end() && d != filename.end())
{ {
auto tStr = std::string(++k, d); auto tStr = std::string(++k, d);
auto dStr = std::string(++d, dot); auto dStr = std::string(++d, dot);
+2 -3
View File
@@ -2,6 +2,7 @@
#define CHECKS_H_ #define CHECKS_H_
#include<algorithm> #include<algorithm>
#include<string>
#include<cstdlib> #include<cstdlib>
#include<ctype.h> #include<ctype.h>
@@ -43,16 +44,14 @@ namespace Utilities
static auto itemIterInContainer(const Container &container, const Item &item, Func func) static auto itemIterInContainer(const Container &container, const Item &item, Func func)
{ {
auto result = false; auto result = false;
// std::cout<<container<<"\n";
auto ii = std::find_if(container.begin(), container.end(), [&](Item i) auto ii = std::find_if(container.begin(), container.end(), [&](Item i)
{ {
// std::cout<<"iter "<<i<<" target "<<item<<"\n";
return func(i, item); return func(i, item);
}); });
if (ii == container.end()) if (ii == container.end())
{ {
// std::cout<<item<<" not found in container\n";
ii = container.end(); ii = container.end();
} }
+14
View File
@@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by IcarusDownloadManager.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
+9 -1
View File
@@ -14,7 +14,7 @@ using Managers::CommitManager;
constexpr static auto IcarusDownloadManager_version() constexpr static auto IcarusDownloadManager_version()
{ {
return "v0.2.0"; return "v0.3.2";
} }
void printHelp() void printHelp()
@@ -24,6 +24,7 @@ void printHelp()
cout<<"Actions\n"; cout<<"Actions\n";
cout<<"download\n"; cout<<"download\n";
cout<<"upload\n"; cout<<"upload\n";
cout<<"upload-meta\n";
cout<<"retrieve\n"; cout<<"retrieve\n";
cout<<"delete\n\n"; cout<<"delete\n\n";
@@ -39,6 +40,13 @@ void printHelp()
cout<<"-sr directory where to recursively search for songs to upload (Optional)\n"; cout<<"-sr directory where to recursively search for songs to upload (Optional)\n";
cout<<"-nc will not prompt the user when uploading from a directory\n\n"; cout<<"-nc will not prompt the user when uploading from a directory\n\n";
cout<<"Required for upload with metadata\n";
cout<<"-s path of song\n";
cout<<"-t track number\n";
cout<<"-m metadata filepath\n";
cout<<"-ca coverart filepath\n";
cout<<"-scma directory where songs, metadata, and cover art exists and will be uploaded (Optional)\n\n";
cout<<"Required for download\n"; cout<<"Required for download\n";
cout<<"-b song id\n"; cout<<"-b song id\n";
cout<<"-d path to download song (Optional)\n\n"; cout<<"-d path to download song (Optional)\n\n";
+1 -1
View File
@@ -48,7 +48,7 @@ void ActionManager::initialize()
} }
void ActionManager::validateFlags() void ActionManager::validateFlags()
{ {
cout<<"Validating flags\n"; cout<<"Validating flags\n";
const auto flagVals = parsedFlags(); const auto flagVals = parsedFlags();
+15 -3
View File
@@ -308,8 +308,8 @@ void CommitManager::singTargetUpload(const std::string &songPath, const std::str
} }
song = *sng; song = *sng;
const auto p = fs::path(songPath); const auto p = filesystem::path(songPath);
song.directory = p.parent_path.string(); song.directory = p.parent_path().string();
song.generate_filename_from_track(); song.generate_filename_from_track();
Models::CoverArt cover; Models::CoverArt cover;
@@ -345,6 +345,17 @@ void CommitManager::multiTargetUpload(const std::string &sourcePath)
cout<<"Stem "<<stem<<" Extension "<<extension<<"\n"; cout<<"Stem "<<stem<<" Extension "<<extension<<"\n";
auto validImg = [](const std::string& ext)
{
std::vector<string> extensions;
extensions.reserve(3);
extensions.push_back(".jpg");
extensions.push_back(".jpeg");
extensions.push_back(".");
return ext.compare(extensions[0]) == 0 || ext.compare(extensions[1]) == 0 || ext.compare(extensions[2]) == 0;
};
if (extension.compare(".mp3") == 0) if (extension.compare(".mp3") == 0)
{ {
Song song; Song song;
@@ -354,7 +365,8 @@ void CommitManager::multiTargetUpload(const std::string &sourcePath)
songs.emplace_back(std::move(song)); songs.emplace_back(std::move(song));
} }
else if (extension.compare(".jpg") == 0 || extension.compare(".png") == 0) // else if (extension.compare(".jpg") == 0 || extension.compare(".png") == 0)
else if (validImg(extension.string()))
{ {
cover.path.assign(pp.string()); cover.path.assign(pp.string());
} }
+1 -1
View File
@@ -43,7 +43,7 @@ void APIParser::parseAPI()
} }
} }
// TODO: For now I will hard code // NOTE: For now I will hard code
// the api version since I am only // the api version since I am only
// on version 1 // on version 1
api.version = "v1"; api.version = "v1";