diff --git a/AutoInstallScript.ps1 b/AutoInstallScript.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..e015c68b3553dd43287d0bf85457494eb6e245f0 --- /dev/null +++ b/AutoInstallScript.ps1 @@ -0,0 +1,25 @@ +$destinationFolder = ".\NahidaProject-InstallDirectory" + +$files = Get-ChildItem -Path "." -Recurse -File + +mkdir $destinationFolder\bin +mkdir $destinationFolder\include +mkdir $destinationFolder\lib + +foreach ($file in $files) { + if ($file.Extension -eq ".h") { + Copy-Item -Path $file.FullName -Destination $destinationFolder\include + } + + if ($file.Extension -eq ".lib") { + Copy-Item -Path $file.FullName -Destination $destinationFolder\lib + } + + if ($file.Extension -eq ".dll") { + Copy-Item -Path $file.FullName -Destination $destinationFolder\bin + } + + if ($file.Extension -eq ".exe") { + Copy-Item -Path $file.FullName -Destination $destinationFolder\bin + } +} diff --git a/BuildExample/.gitignore b/BuildExample/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..27b4dedb7cf32c7d5be5a1d4248cb2dce0f5c560 --- /dev/null +++ b/BuildExample/.gitignore @@ -0,0 +1,4 @@ +### Microsoft Visual Studio ### +.vs +out +x64 \ No newline at end of file diff --git a/BuildExample/BuildExample.sln b/BuildExample/BuildExample.sln new file mode 100644 index 0000000000000000000000000000000000000000..bc0d34eb345fadcf331b8f5e19ab2773ae6ec6fb --- /dev/null +++ b/BuildExample/BuildExample.sln @@ -0,0 +1,233 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36414.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StaticLibrary", "StaticLibrary", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicLibrary", "DynamicLibrary", "{B805787D-97BB-49ED-A89C-450C399C2EBA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决方案项", "{9FA3D6BD-1EC1-3BA5-80CB-CE02773A58D5}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Console-BuildExample", "StaticLibrary\NahidaProject-Console-BuildExample\NahidaProject-Console-BuildExample.vcxproj", "{1FE1E600-D455-4D87-87DE-09E3DA2B37E9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Database-BuildExample", "StaticLibrary\NahidaProject-Database-BuildExample\NahidaProject-Database-BuildExample.vcxproj", "{611D584B-6C3B-4431-A919-3CD6AA41F537}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Generic-BuildExample", "StaticLibrary\NahidaProject-Generic-BuildExample\NahidaProject-Generic-BuildExample.vcxproj", "{564E3D40-1DBE-474A-9682-E01D5B9DCA3B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Mathematics-BuildExample", "StaticLibrary\NahidaProject-Mathematics-BuildExample\NahidaProject-Mathematics-BuildExample.vcxproj", "{4912051C-E982-480E-AD1E-87DD20992A18}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Other-BuildExample", "StaticLibrary\NahidaProject-Other-BuildExample\NahidaProject-Other-BuildExample.vcxproj", "{0A4A2D60-5612-4073-86A5-A991FD77F2C2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Serialization-BuildExample", "StaticLibrary\NahidaProject-Serialization-BuildExample\NahidaProject-Serialization-BuildExample.vcxproj", "{7B64F4C4-529C-435A-858F-7ACA4DB71A19}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Thread-BuildExample", "StaticLibrary\NahidaProject-Thread-BuildExample\NahidaProject-Thread-BuildExample.vcxproj", "{E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-UnitTest-BuildExample", "StaticLibrary\NahidaProject-UnitTest-BuildExample\NahidaProject-UnitTest-BuildExample.vcxproj", "{4E03C889-0182-44B5-93DE-43ED4E8F674B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NahidaProject-System-BuildExample", "NahidaProject-System-BuildExample", "{3923C0D7-0F63-4BF0-965B-BDEC656090F8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-System-RegisterTable-BuildExample", "StaticLibrary\NahidaProject-System-BuildExample\NahidaProject-System-RegisterTable-BuildExample\NahidaProject-System-RegisterTable-BuildExample.vcxproj", "{B8841332-02B5-40BA-A0D2-C05A77B1F6C2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-System-DynamicInjector-BuildExample", "StaticLibrary\NahidaProject-System-BuildExample\NahidaProject-System-DynamicInjector-BuildExample\NahidaProject-System-DynamicInjector-BuildExample.vcxproj", "{57A71F29-EAC5-4A75-AFF3-59309D746EE1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Console-DynamicBuildExample", "DynamicLibrary\NahidaProject-Console-DynamicBuildExample\NahidaProject-Console-DynamicBuildExample.vcxproj", "{32676108-7AA5-4F1C-AB59-CDF34A4A79F2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Database-DynamicBuildExample", "DynamicLibrary\NahidaProject-Database-DynamicBuildExample\NahidaProject-Database-DynamicBuildExample.vcxproj", "{0C4C9927-FFFD-429A-BF0A-181D534E0334}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Generic-DynamicBuildExample", "DynamicLibrary\NahidaProject-Generic-DynamicBuildExample\NahidaProject-Generic-DynamicBuildExample.vcxproj", "{FF3275AB-A387-4455-9F96-016D9043C4B5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Mathmatics-DynamicBuildExample", "DynamicLibrary\NahidaProject-Mathmatics-DynamicBuildExample\NahidaProject-Mathmatics-DynamicBuildExample.vcxproj", "{4DF6BD22-24EC-433C-A2A6-B993AC97D364}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Other-DynamicBuildExample", "DynamicLibrary\NahidaProject-Other-DynamicBuildExample\NahidaProject-Other-DynamicBuildExample.vcxproj", "{4949239E-B4C4-4062-8DE0-F76CDF292485}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Serialization-DynamicBuildExample", "DynamicLibrary\NahidaProject-Serialization-DynamicBuildExample\NahidaProject-Serialization-DynamicBuildExample.vcxproj", "{A94AF18B-6503-4367-AE83-F8B51E9B013A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-Thread-DynamicBuildExample", "DynamicLibrary\NahidaProject-Thread-DynamicBuildExample\NahidaProject-Thread-DynamicBuildExample.vcxproj", "{8D8FF154-0920-416F-AB6B-30E02EC0F12B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NahidaProject-UnitTest-DynamicBuildExample", "DynamicLibrary\NahidaProject-UnitTest-DynamicBuildExample\NahidaProject-UnitTest-DynamicBuildExample.vcxproj", "{453D2957-FC8E-43AD-9D49-4F30737B213D}" +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 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Debug|x64.ActiveCfg = Debug|x64 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Debug|x64.Build.0 = Debug|x64 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Debug|x86.ActiveCfg = Debug|Win32 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Debug|x86.Build.0 = Debug|Win32 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Release|x64.ActiveCfg = Release|x64 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Release|x64.Build.0 = Release|x64 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Release|x86.ActiveCfg = Release|Win32 + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9}.Release|x86.Build.0 = Release|Win32 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Debug|x64.ActiveCfg = Debug|x64 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Debug|x64.Build.0 = Debug|x64 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Debug|x86.ActiveCfg = Debug|Win32 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Debug|x86.Build.0 = Debug|Win32 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Release|x64.ActiveCfg = Release|x64 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Release|x64.Build.0 = Release|x64 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Release|x86.ActiveCfg = Release|Win32 + {611D584B-6C3B-4431-A919-3CD6AA41F537}.Release|x86.Build.0 = Release|Win32 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Debug|x64.ActiveCfg = Debug|x64 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Debug|x64.Build.0 = Debug|x64 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Debug|x86.ActiveCfg = Debug|Win32 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Debug|x86.Build.0 = Debug|Win32 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Release|x64.ActiveCfg = Release|x64 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Release|x64.Build.0 = Release|x64 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Release|x86.ActiveCfg = Release|Win32 + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B}.Release|x86.Build.0 = Release|Win32 + {4912051C-E982-480E-AD1E-87DD20992A18}.Debug|x64.ActiveCfg = Debug|x64 + {4912051C-E982-480E-AD1E-87DD20992A18}.Debug|x64.Build.0 = Debug|x64 + {4912051C-E982-480E-AD1E-87DD20992A18}.Debug|x86.ActiveCfg = Debug|Win32 + {4912051C-E982-480E-AD1E-87DD20992A18}.Debug|x86.Build.0 = Debug|Win32 + {4912051C-E982-480E-AD1E-87DD20992A18}.Release|x64.ActiveCfg = Release|x64 + {4912051C-E982-480E-AD1E-87DD20992A18}.Release|x64.Build.0 = Release|x64 + {4912051C-E982-480E-AD1E-87DD20992A18}.Release|x86.ActiveCfg = Release|Win32 + {4912051C-E982-480E-AD1E-87DD20992A18}.Release|x86.Build.0 = Release|Win32 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Debug|x64.ActiveCfg = Debug|x64 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Debug|x64.Build.0 = Debug|x64 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Debug|x86.ActiveCfg = Debug|Win32 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Debug|x86.Build.0 = Debug|Win32 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Release|x64.ActiveCfg = Release|x64 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Release|x64.Build.0 = Release|x64 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Release|x86.ActiveCfg = Release|Win32 + {0A4A2D60-5612-4073-86A5-A991FD77F2C2}.Release|x86.Build.0 = Release|Win32 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Debug|x64.ActiveCfg = Debug|x64 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Debug|x64.Build.0 = Debug|x64 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Debug|x86.ActiveCfg = Debug|Win32 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Debug|x86.Build.0 = Debug|Win32 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Release|x64.ActiveCfg = Release|x64 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Release|x64.Build.0 = Release|x64 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Release|x86.ActiveCfg = Release|Win32 + {7B64F4C4-529C-435A-858F-7ACA4DB71A19}.Release|x86.Build.0 = Release|Win32 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Debug|x64.ActiveCfg = Debug|x64 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Debug|x64.Build.0 = Debug|x64 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Debug|x86.ActiveCfg = Debug|Win32 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Debug|x86.Build.0 = Debug|Win32 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Release|x64.ActiveCfg = Release|x64 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Release|x64.Build.0 = Release|x64 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Release|x86.ActiveCfg = Release|Win32 + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264}.Release|x86.Build.0 = Release|Win32 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Debug|x64.ActiveCfg = Debug|x64 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Debug|x64.Build.0 = Debug|x64 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Debug|x86.ActiveCfg = Debug|Win32 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Debug|x86.Build.0 = Debug|Win32 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Release|x64.ActiveCfg = Release|x64 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Release|x64.Build.0 = Release|x64 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Release|x86.ActiveCfg = Release|Win32 + {4E03C889-0182-44B5-93DE-43ED4E8F674B}.Release|x86.Build.0 = Release|Win32 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Debug|x64.ActiveCfg = Debug|x64 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Debug|x64.Build.0 = Debug|x64 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Debug|x86.ActiveCfg = Debug|Win32 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Debug|x86.Build.0 = Debug|Win32 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Release|x64.ActiveCfg = Release|x64 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Release|x64.Build.0 = Release|x64 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Release|x86.ActiveCfg = Release|Win32 + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2}.Release|x86.Build.0 = Release|Win32 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Debug|x64.ActiveCfg = Debug|x64 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Debug|x64.Build.0 = Debug|x64 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Debug|x86.ActiveCfg = Debug|Win32 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Debug|x86.Build.0 = Debug|Win32 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Release|x64.ActiveCfg = Release|x64 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Release|x64.Build.0 = Release|x64 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Release|x86.ActiveCfg = Release|Win32 + {57A71F29-EAC5-4A75-AFF3-59309D746EE1}.Release|x86.Build.0 = Release|Win32 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Debug|x64.ActiveCfg = Debug|x64 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Debug|x64.Build.0 = Debug|x64 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Debug|x86.ActiveCfg = Debug|Win32 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Debug|x86.Build.0 = Debug|Win32 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Release|x64.ActiveCfg = Release|x64 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Release|x64.Build.0 = Release|x64 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Release|x86.ActiveCfg = Release|Win32 + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2}.Release|x86.Build.0 = Release|Win32 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Debug|x64.ActiveCfg = Debug|x64 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Debug|x64.Build.0 = Debug|x64 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Debug|x86.ActiveCfg = Debug|Win32 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Debug|x86.Build.0 = Debug|Win32 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Release|x64.ActiveCfg = Release|x64 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Release|x64.Build.0 = Release|x64 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Release|x86.ActiveCfg = Release|Win32 + {0C4C9927-FFFD-429A-BF0A-181D534E0334}.Release|x86.Build.0 = Release|Win32 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Debug|x64.ActiveCfg = Debug|x64 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Debug|x64.Build.0 = Debug|x64 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Debug|x86.ActiveCfg = Debug|Win32 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Debug|x86.Build.0 = Debug|Win32 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Release|x64.ActiveCfg = Release|x64 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Release|x64.Build.0 = Release|x64 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Release|x86.ActiveCfg = Release|Win32 + {FF3275AB-A387-4455-9F96-016D9043C4B5}.Release|x86.Build.0 = Release|Win32 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Debug|x64.ActiveCfg = Debug|x64 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Debug|x64.Build.0 = Debug|x64 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Debug|x86.ActiveCfg = Debug|Win32 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Debug|x86.Build.0 = Debug|Win32 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Release|x64.ActiveCfg = Release|x64 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Release|x64.Build.0 = Release|x64 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Release|x86.ActiveCfg = Release|Win32 + {4DF6BD22-24EC-433C-A2A6-B993AC97D364}.Release|x86.Build.0 = Release|Win32 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Debug|x64.ActiveCfg = Debug|x64 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Debug|x64.Build.0 = Debug|x64 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Debug|x86.ActiveCfg = Debug|Win32 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Debug|x86.Build.0 = Debug|Win32 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Release|x64.ActiveCfg = Release|x64 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Release|x64.Build.0 = Release|x64 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Release|x86.ActiveCfg = Release|Win32 + {4949239E-B4C4-4062-8DE0-F76CDF292485}.Release|x86.Build.0 = Release|Win32 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Debug|x64.ActiveCfg = Debug|x64 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Debug|x64.Build.0 = Debug|x64 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Debug|x86.ActiveCfg = Debug|Win32 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Debug|x86.Build.0 = Debug|Win32 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Release|x64.ActiveCfg = Release|x64 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Release|x64.Build.0 = Release|x64 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Release|x86.ActiveCfg = Release|Win32 + {A94AF18B-6503-4367-AE83-F8B51E9B013A}.Release|x86.Build.0 = Release|Win32 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Debug|x64.ActiveCfg = Debug|x64 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Debug|x64.Build.0 = Debug|x64 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Debug|x86.ActiveCfg = Debug|Win32 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Debug|x86.Build.0 = Debug|Win32 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Release|x64.ActiveCfg = Release|x64 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Release|x64.Build.0 = Release|x64 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Release|x86.ActiveCfg = Release|Win32 + {8D8FF154-0920-416F-AB6B-30E02EC0F12B}.Release|x86.Build.0 = Release|Win32 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Debug|x64.ActiveCfg = Debug|x64 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Debug|x64.Build.0 = Debug|x64 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Debug|x86.ActiveCfg = Debug|Win32 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Debug|x86.Build.0 = Debug|Win32 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Release|x64.ActiveCfg = Release|x64 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Release|x64.Build.0 = Release|x64 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Release|x86.ActiveCfg = Release|Win32 + {453D2957-FC8E-43AD-9D49-4F30737B213D}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {1FE1E600-D455-4D87-87DE-09E3DA2B37E9} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {611D584B-6C3B-4431-A919-3CD6AA41F537} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {564E3D40-1DBE-474A-9682-E01D5B9DCA3B} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {4912051C-E982-480E-AD1E-87DD20992A18} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {0A4A2D60-5612-4073-86A5-A991FD77F2C2} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {7B64F4C4-529C-435A-858F-7ACA4DB71A19} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {E0A15B33-3D20-499C-9B1A-9FFFDA0FC264} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {4E03C889-0182-44B5-93DE-43ED4E8F674B} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {3923C0D7-0F63-4BF0-965B-BDEC656090F8} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {B8841332-02B5-40BA-A0D2-C05A77B1F6C2} = {3923C0D7-0F63-4BF0-965B-BDEC656090F8} + {57A71F29-EAC5-4A75-AFF3-59309D746EE1} = {3923C0D7-0F63-4BF0-965B-BDEC656090F8} + {32676108-7AA5-4F1C-AB59-CDF34A4A79F2} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + {0C4C9927-FFFD-429A-BF0A-181D534E0334} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + {FF3275AB-A387-4455-9F96-016D9043C4B5} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + {4DF6BD22-24EC-433C-A2A6-B993AC97D364} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + {4949239E-B4C4-4062-8DE0-F76CDF292485} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + {A94AF18B-6503-4367-AE83-F8B51E9B013A} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + {8D8FF154-0920-416F-AB6B-30E02EC0F12B} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + {453D2957-FC8E-43AD-9D49-4F30737B213D} = {B805787D-97BB-49ED-A89C-450C399C2EBA} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1EEC9B8E-6A4D-44AF-983A-614A10CCE3CE} + EndGlobalSection +EndGlobal diff --git a/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..e02b9477a27c88b7c7986f4bd9ce531972f4e893 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {32676108-7aa5-4f1c-ab59-cdf34a4a79f2} + NahidaProjectConsoleDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Console.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/NahidaProject-Console-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3808e6a336cd0c9c021377ae357d3ec72ccff4ad --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Console-DynamicBuildExample/main.cpp @@ -0,0 +1,71 @@ +// NahidaProject-Console-DynamicBuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include +#include +#include + +int main(int argc, char** argv) { + NahidaProject::ChooseDialog::CheckboxMenu cbm(L"Choose 1", 5); + cbm.AddOption(L"Option 1", L"desc1", TRUE); + cbm.AddOption(L"Option 2", L"desc2", TRUE); + cbm.AddOption(L"Option 3", L"desc3", TRUE); + cbm.AddOption(L"Option 4", L"desc4"); + cbm.AddOption(L"Option 5", L"desc5"); + cbm.AddOption(L"Option 6", L"desc6"); + + cbm.Execute(); + NahidaProject::ChooseDialog::MenuState cbmState = cbm.GetState(); + + std::wcout << L"OPTION\t DESCRIPTION\t\t SELECTED" << std::endl; + for (NahidaProject::ChooseDialog::Option opt : cbmState.options) { + std::wcout << opt._displayName << L"\t " << opt._description << L"\t\t " << opt.IsSelected() << std::endl; + } + + NahidaProject::ChooseDialog::RadioMenu radioMenu(L"Choose 2"); + radioMenu.AddOption(L"Option 1", L"Description 1"); + radioMenu.AddOption(L"Option 2", L"Description 2"); + radioMenu.AddOption(L"Option 3", L"Description 3"); + radioMenu.AddOption(L"Option 4", L"Description 4"); + radioMenu.AddOption(L"Option 5", L"Description 5"); + radioMenu.AddOption(L"Option 6", L"Description 6"); + + radioMenu.Execute(); + NahidaProject::ChooseDialog::MenuState rmState = radioMenu.GetState(); + + NahidaProject::ChooseDialog::Option select1 = rmState.GetSelectedOptions()[0]; + std::wcout << "SELECTED OPTION: " << select1._displayName << std::endl; + + NahidaProject::ChooseDialog::PromptMenu promptMenu(L"Question 1"); + promptMenu.AddOption(L"Choose 1", L"Description 1"); + promptMenu.AddOption(L"Choose 2", L"Description 2"); + promptMenu.AddOption(L"Choose 3", L"Description 3"); + + promptMenu.Execute(); + NahidaProject::ChooseDialog::MenuState promptMenuState = promptMenu.GetState(); + + NahidaProject::ChooseDialog::Option select2 = promptMenuState.GetSelectedOptions()[0]; + std::wcout << "\r\nSELECTED OPTION: " << select2._displayName << std::endl; + + NahidaProject::TablePrint tablePrint({ "Column1", "Column2", "Column3", "Column4", "Column5" }, { { "Data1", "Data2", "Data3", "Data4", "Data5"}, {"Data6", "Data7", "Data8", "Data9", "Data10"} }); + tablePrint.PrintTable(); + + std::cout << "我神州," << "称华夏。" << NahidaProject::TerminalColor::Yellow << "山川美," << NahidaProject::TerminalColor::Green << "可入画。" << NahidaProject::TerminalColor::Reset << std::endl; + std::cout << "黄河奔," << "长江涌。" << "长城长," << "珠峰耸。" << std::endl; + std::cout << NahidaProject::TerminalColor::BackgroundRed << "台湾岛," << "隔海峡。" << "与大陆," << "是一家。" << NahidaProject::TerminalColor::Reset << std::endl; + std::cout << NahidaProject::TerminalColor::Cyan << "各民族," << NahidaProject::TerminalColor::Yellow << "齐奋发。" << NahidaProject::TerminalColor::Red << "争朝夕," << "兴中华。" << NahidaProject::TerminalColor::Reset << std::endl; + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..da76f04de422df872143027bbecdb809eb93222a --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {0c4c9927-fffd-429a-bf0a-181d534e0334} + NahidaProjectDatabaseDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Database.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/NahidaProject-Database-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee5c684a5020dec87b5fc6f8ee5d501c567c3d88 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Database-DynamicBuildExample/main.cpp @@ -0,0 +1,41 @@ +// NahidaProject-Database-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include + +#include + +int main(int agc, char** argv) { + NahidaProject::ODBC odbc; + std::cout << odbc.Connect((SQLCHAR*)"SQL Server Datasource", (SQLCHAR*)"sa", (SQLCHAR*)"081105") << std::endl; + std::cout << odbc.ExecuteSQLWithoutResult((SQLCHAR*)"SELECT @@VERSION;") << std::endl; + std::vector> a = odbc.ExecuteSQLWithResult((SQLCHAR*)"SELECT * FROM Northwind.dbo.Products;"); + + for (std::vector item1 : a) { + for (std::string item2 : item1) { + std::cout << item2 << std::endl; + } + } + + odbc.RegisterTransaction("Transaction1", [&]() { + odbc.ExecuteSQLWithoutResult((SQLCHAR*)"DROP TABLE dbo.Products;"); + }); + + odbc.InvokeTransaction("Transaction1"); + odbc.UndoTransaction(); + + odbc.Close(); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..0189c04da3b4cfadd25539e140c2955b56b327e8 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {ff3275ab-a387-4455-9f96-016d9043c4b5} + NahidaProjectGenericDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Generic.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/NahidaProject-Generic-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..30157f8a1753d3c17caeb64aa635c8fc0fc314ab --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Generic-DynamicBuildExample/main.cpp @@ -0,0 +1,84 @@ +// NahidaProject-Generic-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +#include +#include +#include +#include + +int main(int argc, char** argv) { + NahidaProject::BloomFilter<100> bloomFilter; + + bloomFilter.Set("Object A"); + bloomFilter.Set("Object B"); + bloomFilter.Set("Object C"); + + assert(bloomFilter.Test("Object A") == 1); + + assert(bloomFilter.Test("Object A") == 1); + assert(bloomFilter.Test("Object B") == 1); + assert(bloomFilter.Test("Object C") == 1); + assert(bloomFilter.Test("Object D") == 0); + + assert(bloomFilter.EstimateElementCount(), 3); + + std::cout << "Used bits: " << bloomFilter.GetUsedBits() << std::endl; + std::cout << "Load factor: " << bloomFilter.LoadFactor() << std::endl; + std::cout << "False positive rate: " << bloomFilter.EstimateFalsePositiveRate(3) << std::endl; + bloomFilter.Clear(); + assert(bloomFilter.GetUsedBits() == 0); + + NahidaProject::HTTPRequest::AsyncHTTPRequest request; + request.SetHeader("Authorization", "Bearer 123"); + request.SetHeader("User-Agent", "HTTPRequest/1.0"); + + request.Post("http://postman-echo.com/post", [](const std::string& response) { + std::cout << "Echo post:\n\n" << response << "\n\n"; + }, NahidaProject::HTTPRequest::ContentType::json, R"({"name": "olli", "job": "pro coder"})"); + + while (!request.Server()) { + + } + + request.Get("http://postman-echo.com/get", [](const std::string& response) { + std::cout << response << std::endl; + }); + + while (!request.Server()) { + + } + + std::cout << "" << std::endl; + + NahidaProject::Logger::GetInstance()->Open("TestRead.log"); + NahidaProject::Logger::GetInstance()->SetMax(1024); + + Debug("This is a debug imformation"); + Information("This is a imformation imformation"); + Warning("This is a %s imformation", "warning"); + Error("This is a error imformation"); + // FATAL("Hello NahidaProject"); Will be stop and return -1 + + std::vector a = { 5, 6, 7, 2, 1, 4, 3 }; + std::vector b = { 1, 2, 3, 4, 5, 6, 7 }; + + assert(NahidaProject::SortModule::BubbleSort(a) == b); + assert(NahidaProject::SortModule::InsertSort(a) == b); + assert(NahidaProject::SortModule::SelectSort(a) == b); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..376975eda91543859fd400393f21aac60e97ecff --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {4df6bd22-24ec-433c-a2a6-b993ac97d364} + NahidaProjectMathmaticsDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Mathematics.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/NahidaProject-Mathmatics-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c798573f77839fbe49a6bc1354317d88a4ad895a --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Mathmatics-DynamicBuildExample/main.cpp @@ -0,0 +1,66 @@ +// NahidaProject-Mathematics-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include +#include +#include + +#include +#include +#include + +int main(int argc, char** argv) { + NahidaProject::BigInteger bigInteger1("1234567891011121314151617181920"); + NahidaProject::BigInteger bigInteger2("5235786413218674561046854651351"); + + assert((bigInteger1 + bigInteger2) == (NahidaProject::BigInteger)"6470354304229795875198471833271"); + assert((bigInteger1 - bigInteger2) == (NahidaProject::BigInteger)"-4001218522207553246895237469431"); + assert((bigInteger1 * bigInteger2) == (NahidaProject::BigInteger)"6463933789952062400179139910666398683694552102531682740773920"); + + NahidaProject::RandomGenerator random; + + assert(random.Next(42) >= 0 or random.Next(42) <= 42); + assert(random.NextInt(1, 100) >= 1 or random.NextInt(1, 100) <= 100); + assert(random.NextDouble() >= 0.0 or random.NextDouble() <= 1.0); + assert(random.NextDouble(1.5, 3.5) >= 1.5 or random.NextDouble(1.5, 3.5) <= 3.5); + + std::vector vec(10); + random.Fill(vec, -10, 10); + for (int item : vec) { + assert(item >= -10 or item <= 10); + } + + std::vector numbers = { 1, 2, 3, 4, 5 }; + random.Shuffle(numbers); + + for (int number : numbers) { + std::cout << number << " "; + } + std::cout << "" << std::endl; + + std::deque data{ 1, 2, 3, 5, 6, 8, 4, 9, 9, 4, 6, 4, 3, 7, 1, 0, 0, 6, 8, 9 }; + NahidaProject::Statistics statistics(data.begin(), data.end()); + + assert(statistics.Count() == 20); + assert(statistics.Maximum() == 9); + assert(statistics.Mean() == 4); + assert(statistics.Minimum() == 0); + assert(statistics.StandardDeviation() == 3); + assert(statistics.Sum() == 95); + assert(statistics.SumOfSquares() == 625); + assert(statistics.Variance() == 15); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..9719f6e0ebc5786b6a8168d77480560a3420d79a --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {4949239e-b4c4-4062-8de0-f76cdf292485} + NahidaProjectOtherDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Other.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/NahidaProject-Other-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f9ca9135b99f7fc53ab4b2d66511f0b5446f1ce --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Other-DynamicBuildExample/main.cpp @@ -0,0 +1,21 @@ +// NahidaProject-Other-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +int main(int argc, char** argv) { + std::cout << NahidaProject::CowSay::Cow("Moo") << std::endl; + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..b62dee0bddaf53deb0784a7207c4d7f19142ee18 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {a94af18b-6503-4367-ae83-f8b51e9b013a} + NahidaProjectSerializationDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Serialization.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/NahidaProject-Serialization-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c39a66d2d6cdcdaab9ff1a35d748addea61b9fc4 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Serialization-DynamicBuildExample/main.cpp @@ -0,0 +1,126 @@ +// NahidaProject-Serialization-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char** argv) { + std::ofstream ofs("TestRead.csv", std::ios::out | std::ios::app); + ofs << R"(a,b,c +1,2,3 +4,5,6 +7,8,9)" << std::endl; + ofs.close(); + + std::ifstream file("TestRead.csv"); + NahidaProject::CSV::CSV csv(file); + + for (auto& row : csv) { + for (auto& field : row) { + std::cout << field << " | "; + } + std::cout << "" << std::endl; + } + + ::remove("TestRead.csv"); + + NahidaProject::INIWriter writer; + writer.SetFileValue("Section1", "Key1", "Value1"); + writer.SetFileValue("Section1", "Key2", "Value2"); + writer.SetFileValue("Section1", "Key3", "Value3"); + writer.SetFileValue("Section2", "Key1", "Value1"); + writer.SetFileValue("Section2", "Key2", "Value2"); + writer.SetFileValue("Section2", "Key3", "Value3"); + + writer.WriteINIFile("TestRead.ini"); + + NahidaProject::INIReader reader; + reader.ReadFile("TestRead.ini"); + + assert(reader.GetValue("Section1", "Key1") == "Value1"); + assert(reader.GetValue("Section1", "Key2") == "Value2"); + assert(reader.GetValue("Section1", "Key3") == "Value3"); + assert(reader.GetValue("Section2", "Key1") == "Value1"); + assert(reader.GetValue("Section2", "Key2") == "Value2"); + assert(reader.GetValue("Section2", "Key3") == "Value3"); + + ::remove("TestRead.ini"); + + NahidaProject::JSON json; + json.Parse(R"({"name": "Jack", "age": 18, "area": ["c++", "php", "python", "go"], "hobby": {"hobby1": "reading", "hobby2": "coding", "hobby3": "basketball"}})"); + assert(json["name"].ToString() == "\"Jack\""); + assert(json["age"].ToString() == "18"); + assert(json["area"].ToString() == R"(["c++","php","python","go"])"); + assert(json["hobby"]["hobby1"].ToString() == "\"reading\""); + assert(json["hobby"]["hobby2"].ToString() == "\"coding\""); + assert(json["hobby"]["hobby3"].ToString() == "\"basketball\""); + + json.Clear(); + + NahidaProject::XMLWriter xmlWriter; + NahidaProject::XMLWriterNode& documentNode = xmlWriter["DocumentNode"]; + documentNode["Key0"]("Index", "0")("Size", "test"); + documentNode["Key1"]("Index", "1")("Size", "test"); + documentNode["Key2"]("Index", "2")("Size", "test"); + + documentNode["Key0"]["AnotherKey"] = "Value0"; + documentNode["Key1"]["AnotherKey"] = "Value1"; + documentNode["Key2"]["AnotherKey"] = "Value2"; + + documentNode["Key0"]["AnotherKey"]["Another"]("Attribute0", "Value0") = "Test0"; + documentNode["Key1"]["AnotherKey"]["Another"]("Attribute0", "Value0") = "Test1"; + + xmlWriter.OutputFile("TestRead.xml"); + + /* + XMLReader::XMLNode xmlNode; + std::cout << xmlNode.FromFile("TestRead.xml"); + xmlNode.Print(); + XMLReader::XMLNode* node2 = xmlNode.GetChildPtrByName("xml"); + XMLReader::XMLNode* node3 = node2->GetChildPtrByName("DocumentNode"); + XMLReader::XMLNode* node4 = node3->GetChildPtrByName("Key0"); + std::cout << node4->GetAttribute("Index") << std::endl; + */ + ::remove("TestRead.xml"); + + std::ofstream ofs1("TestRead.yml", std::ios::out | std::ios::app); + ofs1 << R"(text: How are you? I am fine Thank you +number: 78.91 +boolValue: true +outer_object: + inner_object: + name: Ningguang + name: Ganyu)" << std::endl; + ofs1.close(); + + NahidaProject::YAML::YAML yaml("TestRead.yml"); + assert(yaml["text"].cast() == "How are you? I am fine Thank you"); + assert(yaml["number"].cast() == 78.91); + assert(yaml["boolValue"].cast()); + assert(yaml["outer_object"]["inner_object"]["name"].cast() == "Ningguang"); + assert(yaml["outer_object"]["name"].cast() == "Ganyu"); + + ::remove("TestRead.yml"); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..5f0d6e69d6b6e9e40621223a11c794ff93abc97c --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {8d8ff154-0920-416f-ab6b-30e02ec0f12b} + NahidaProjectThreadDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Thread.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/NahidaProject-Thread-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cbb010aecb7a21a5d4450d109b23a0627f85d130 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-Thread-DynamicBuildExample/main.cpp @@ -0,0 +1,105 @@ +// NahidaProject-Thread-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +#include +#include +#include +#include + +SetEventBusEvent(TestEvent); + +class HandlerTest : public NahidaProject::EventBus::EventBusHandler { +private: + bool _success; +public: + HandlerTest() : _success(false) { + + } + + void OnEvent(const TestEvent&) override { + _success ^= true; + } + + inline bool isSuccess() const { + return _success; + } +}; + +constexpr float Calculate(float value, int scalar) { + return value * static_cast(scalar); +} + +int main(int argc, char** argv) { + NahidaProject::EventBus::EventBus eventBus; + HandlerTest handler; + TestEvent event; + + eventBus.Subscribe(handler); + eventBus.Publish(event); + + if (!handler.isSuccess()) { + std::cerr << "Failed to execute the handler" << std::endl; + } + + eventBus.Unsubscribe(handler); + eventBus.Publish(event); + if (!handler.isSuccess()) { + std::cerr << "Failed to unsubscribe" << std::endl; + } + + std::cout << "Executed the handler" << std::endl; + + NahidaProject::MemoryPool pool(32, 10); + std::cout << pool.PrintFreeBlocks() << std::endl; + void* ptr1 = pool.Allocate(); + void* ptr2 = pool.Allocate(); + void* ptr3 = pool.Allocate(); + std::cout << pool.PrintFreeBlocks() << std::endl; + pool.Deallocate(ptr2); + std::cout << pool.PrintFreeBlocks() << std::endl; + void* ptr4 = pool.Allocate(); + std::cout << pool.PrintFreeBlocks() << std::endl; + + NahidaProject::Signal signal; + auto connection = signal.Connect([](int a) { + std::cout << "Current Number is " << a << std::endl; + }); + + signal(20); + signal(50); + connection.Disconnect(); + + NahidaProject::ThreadPool::SafeQueue::ThreadPool threadPool{}; + + constexpr float num1 = 12.25f; + constexpr float num2 = 17.75f; + constexpr int scalar = 2; + auto foo = threadPool.Enqueue([num1] { + return num1 * static_cast(scalar); + }); + + auto bar = threadPool.Enqueue(Calculate, num2, scalar); + + const auto result_foo = foo.get(); + const auto result_bar = bar.get(); + + std::cout << result_foo << std::endl; + std::cout << result_bar << std::endl; + std::cout << result_foo + result_bar << std::endl; + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..7aaa1d53daf3c7fd8290d7dda0178283cf19996c --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {453d2957-fc8e-43ad-9d49-4f30737b213d} + NahidaProjectUnitTestDynamicBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-UnitTest.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj.filters b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj.user b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/NahidaProject-UnitTest-DynamicBuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/main.cpp b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f4c22014d25be54d10cc8129fb2119aa92cfdb14 --- /dev/null +++ b/BuildExample/DynamicLibrary/NahidaProject-UnitTest-DynamicBuildExample/main.cpp @@ -0,0 +1,87 @@ +// NahidaProject-UnitTest-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +using namespace std; + +class Calculator { +public: + virtual int Add(int a, int b) = 0; +}; + +class MockCalculator : public Calculator { +public: + MockMethod(int, Add, (int, int)); +}; + +TESTCASE(BenchmarkTestTest) { + string val = "3.141592653589793238462643383279502884"; + int count = 1000000; + + auto rt = NahidaProject::NahidaBenchmarkTest::Time(count, { {"atof", [val]() {double d = atof(val.data()); }},{"strtod", [val]() {double d = strtod(val.data(), nullptr); }},{"sscanf", [val]() {double d; sscanf(val.data(), "%lf", &d); }},{"stod", [val]() {double d = stod(val, nullptr); }} }); + + auto comp = NahidaProject::NahidaBenchmarkTest::Compare(rt); + NahidaProject::NahidaBenchmarkTest::PrintResult(comp); + cout << endl << "runtimes in milliseconds:" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(comp); + cout << endl << "runtimes with min, max, mean, variance and standard deviation" << endl; + cout << endl << "nanoseconds" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(rt); + cout << endl << "microseconds" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(rt, 3); + cout << endl << "milliseconds" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(rt, 5); + + if (NahidaProject::NahidaBenchmarkTest::WriteResult("sample", rt)) { + cout << endl << "successfully wrote runtimes to sample-*.txt files" << endl << endl; + } + else { + cerr << endl << "there were problems: " << strerror(errno) << endl << endl; + } +} + +TESTCASE(MockTestTest) { + MockCalculator calculator; + When(calculator.Add).Return(3); + JUDGE_EQUAL(calculator.Add(1, 2), 3); +} + +TESTCASE(UnitTestMacroTest) { + JUDGE_EQUAL(78 + 13, 91); + JUDGE_NOTEQUAL(1 + 1, 10086); + JUDGE_TRUE(true); + JUDGE_FALSE(false); + JUDGE_THROWEXCEPTION(throw std::runtime_error("This is a test exception"), std::runtime_error); + JUDGE_TIMEOUT([]() { + std::this_thread::sleep_for(std::chrono::seconds(3)); + }, 5000); +} + +int main(int argc, char** argv) { + NahidaProject::NahidaUnitTest::RunAllTests(); + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/README.md b/BuildExample/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a4e200564cb45dc7e2926ae59963753787d11c58 --- /dev/null +++ b/BuildExample/README.md @@ -0,0 +1,22 @@ +# BuildExample + +## + + NahidaProject Microsoft Visual Studio е + +ǿҽÿû NahidaProject ɺִЩĿ̬ӿͶ̬ӿá + +⣬뼰ʱϱ + +û⣬뾡á + +## + +* һĿ > > C/C++ > > ӰĿ¼ include ļС +* > > ӿĿ¼ lib ļС +* ٴε > > +* ھ̬ӿļ `LibNahidaProject-XXX-IMPLEMENT` ׺ľ̬ӿ⡣벢۲н +* ڶ̬ӿļΪ `LibNahidaProject-XXX` ľ̬ӿ⡣ +* ʹö̬ӿʱ bin ļҵӦĶ̬ӿļ붯̬ӿɵĿִļһ𡣲۲н +* ʹĸ롢Ƿ +* 뼰ʱ \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..763cd8c2426fe8bad840664623370d0790431af8 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {1fe1e600-d455-4d87-87de-09e3da2b37e9} + NahidaProjectConsoleBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Console-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/NahidaProject-Console-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d9b57bbbda7fc40d15320b6fb78c8ba88eed41b1 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Console-BuildExample/main.cpp @@ -0,0 +1,70 @@ +// NahidaProject-Console-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 + +#include +#include +#include +#include + +int main(int argc, char **argv) { + NahidaProject::ChooseDialog::CheckboxMenu cbm(L"Choose 1", 5); + cbm.AddOption(L"Option 1", L"desc1", TRUE); + cbm.AddOption(L"Option 2", L"desc2", TRUE); + cbm.AddOption(L"Option 3", L"desc3", TRUE); + cbm.AddOption(L"Option 4", L"desc4"); + cbm.AddOption(L"Option 5", L"desc5"); + cbm.AddOption(L"Option 6", L"desc6"); + + cbm.Execute(); + NahidaProject::ChooseDialog::MenuState cbmState = cbm.GetState(); + + std::wcout << L"OPTION\t DESCRIPTION\t\t SELECTED" << std::endl; + for (NahidaProject::ChooseDialog::Option opt : cbmState.options) { + std::wcout << opt._displayName << L"\t " << opt._description << L"\t\t " << opt.IsSelected() << std::endl; + } + + NahidaProject::ChooseDialog::RadioMenu radioMenu(L"Choose 2"); + radioMenu.AddOption(L"Option 1", L"Description 1"); + radioMenu.AddOption(L"Option 2", L"Description 2"); + radioMenu.AddOption(L"Option 3", L"Description 3"); + radioMenu.AddOption(L"Option 4", L"Description 4"); + radioMenu.AddOption(L"Option 5", L"Description 5"); + radioMenu.AddOption(L"Option 6", L"Description 6"); + + radioMenu.Execute(); + NahidaProject::ChooseDialog::MenuState rmState = radioMenu.GetState(); + + NahidaProject::ChooseDialog::Option select1 = rmState.GetSelectedOptions()[0]; + std::wcout << "SELECTED OPTION: " << select1._displayName << std::endl; + + NahidaProject::ChooseDialog::PromptMenu promptMenu(L"Question 1"); + promptMenu.AddOption(L"Choose 1", L"Description 1"); + promptMenu.AddOption(L"Choose 2", L"Description 2"); + promptMenu.AddOption(L"Choose 3", L"Description 3"); + + promptMenu.Execute(); + NahidaProject::ChooseDialog::MenuState promptMenuState = promptMenu.GetState(); + + NahidaProject::ChooseDialog::Option select2 = promptMenuState.GetSelectedOptions()[0]; + std::wcout << "\r\nSELECTED OPTION: " << select2._displayName << std::endl; + + NahidaProject::TablePrint tablePrint({ "Column1", "Column2", "Column3", "Column4", "Column5" }, { { "Data1", "Data2", "Data3", "Data4", "Data5"}, {"Data6", "Data7", "Data8", "Data9", "Data10"} }); + tablePrint.PrintTable(); + + std::cout << "我神州," << "称华夏。" << NahidaProject::TerminalColor::Yellow << "山川美," << NahidaProject::TerminalColor::Green << "可入画。" << NahidaProject::TerminalColor::Reset << std::endl; + std::cout << "黄河奔," << "长江涌。" << "长城长," << "珠峰耸。" << std::endl; + std::cout << NahidaProject::TerminalColor::BackgroundRed << "台湾岛," << "隔海峡。" << "与大陆," << "是一家。" << NahidaProject::TerminalColor::Reset << std::endl; + std::cout << NahidaProject::TerminalColor::Cyan << "各民族," << NahidaProject::TerminalColor::Yellow << "齐奋发。" << NahidaProject::TerminalColor::Red << "争朝夕," << "兴中华。" << NahidaProject::TerminalColor::Reset << std::endl; + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..694246a0ed08824d1af856065d4fd31969ac37e2 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {611d584b-6c3b-4431-a919-3cd6aa41f537} + NahidaProjectDatabaseBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Database-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/NahidaProject-Database-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..69fd5b7a17e5e88c7affd4ee2ea5bb2e66bb44d5 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Database-BuildExample/main.cpp @@ -0,0 +1,41 @@ +// NahidaProject-Database-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include + +#include + +int main(int agc, char **argv){ + NahidaProject::ODBC odbc; + std::cout << odbc.Connect((SQLCHAR*)"SQL Server Datasource", (SQLCHAR*)"sa", (SQLCHAR*)"081105") << std::endl; + std::cout << odbc.ExecuteSQLWithoutResult((SQLCHAR*)"SELECT @@VERSION;") << std::endl; + std::vector> a = odbc.ExecuteSQLWithResult((SQLCHAR*)"SELECT * FROM Northwind.dbo.Products;"); + + for (std::vector item1 : a) { + for (std::string item2 : item1) { + std::cout << item2 << std::endl; + } + } + + odbc.RegisterTransaction("Transaction1", [&]() { + odbc.ExecuteSQLWithoutResult((SQLCHAR*)"DROP TABLE dbo.Products;"); + }); + + odbc.InvokeTransaction("Transaction1"); + odbc.UndoTransaction(); + + odbc.Close(); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..c367cde7405c4c929a657ba9cd682c0a5b6ed136 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {564e3d40-1dbe-474a-9682-e01d5b9dca3b} + NahidaProjectGenericBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Generic-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/NahidaProject-Generic-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/TestRead.log b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/TestRead.log new file mode 100644 index 0000000000000000000000000000000000000000..be63e250e2fc67d371c1a261ab6a2cc7d51e0023 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/TestRead.log @@ -0,0 +1,4 @@ +[2025-08-25 20:08:35] [DEBUG] main.cpp[LINE 59]This is a debug imformation +[2025-08-25 20:08:35] [INFO] main.cpp[LINE 60]This is a imformation imformation +[2025-08-25 20:08:35] [WARN] main.cpp[LINE 61]This is a warning imformation +[2025-08-25 20:08:35] [ERROR] main.cpp[LINE 62]This is a error imformation diff --git a/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..76731c6a2c259607ac88e676e41cf9d37eb51db9 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Generic-BuildExample/main.cpp @@ -0,0 +1,84 @@ +// NahidaProject-Generic-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +#include +#include +#include +#include + +int main(int argc, char ** argv) { + NahidaProject::BloomFilter<100> bloomFilter; + + bloomFilter.Set("Object A"); + bloomFilter.Set("Object B"); + bloomFilter.Set("Object C"); + + assert(bloomFilter.Test("Object A") == 1); + + assert(bloomFilter.Test("Object A") == 1); + assert(bloomFilter.Test("Object B") == 1); + assert(bloomFilter.Test("Object C") == 1); + assert(bloomFilter.Test("Object D") == 0); + + assert(bloomFilter.EstimateElementCount(), 3); + + std::cout << "Used bits: " << bloomFilter.GetUsedBits() << std::endl; + std::cout << "Load factor: " << bloomFilter.LoadFactor() << std::endl; + std::cout << "False positive rate: " << bloomFilter.EstimateFalsePositiveRate(3) << std::endl; + bloomFilter.Clear(); + assert(bloomFilter.GetUsedBits() == 0); + + NahidaProject::HTTPRequest::AsyncHTTPRequest request; + request.SetHeader("Authorization", "Bearer 123"); + request.SetHeader("User-Agent", "HTTPRequest/1.0"); + + request.Post("http://postman-echo.com/post", [](const std::string& response) { + std::cout << "Echo post:\n\n" << response << "\n\n"; + }, NahidaProject::HTTPRequest::ContentType::json, R"({"name": "olli", "job": "pro coder"})"); + + while (!request.Server()) { + + } + + request.Get("http://postman-echo.com/get", [](const std::string& response) { + std::cout << response << std::endl; + }); + + while (!request.Server()) { + + } + + std::cout << "" << std::endl; + + NahidaProject::Logger::GetInstance()->Open("TestRead.log"); + NahidaProject::Logger::GetInstance()->SetMax(1024); + + Debug("This is a debug imformation"); + Information("This is a imformation imformation"); + Warning("This is a %s imformation", "warning"); + Error("This is a error imformation"); + // FATAL("Hello NahidaProject"); Will be stop and return -1 + + std::vector a = { 5, 6, 7, 2, 1, 4, 3 }; + std::vector b = { 1, 2, 3, 4, 5, 6, 7 }; + + assert(NahidaProject::SortModule::BubbleSort(a) == b); + assert(NahidaProject::SortModule::InsertSort(a) == b); + assert(NahidaProject::SortModule::SelectSort(a) == b); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..cb072f19f69362cf48dcd1cf241b1b936edb85ab --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {4912051c-e982-480e-ad1e-87dd20992a18} + NahidaProjectMathematicsBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Mathematics-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/NahidaProject-Mathematics-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..00c5a342ed7c2f525b3dd7e2e48b1927a9db0d47 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Mathematics-BuildExample/main.cpp @@ -0,0 +1,66 @@ +// NahidaProject-Mathematics-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include +#include +#include + +#include +#include +#include + +int main(int argc, char ** argv) { + NahidaProject::BigInteger bigInteger1("1234567891011121314151617181920"); + NahidaProject::BigInteger bigInteger2("5235786413218674561046854651351"); + + assert((bigInteger1 + bigInteger2) == (NahidaProject::BigInteger)"6470354304229795875198471833271"); + assert((bigInteger1 - bigInteger2) == (NahidaProject::BigInteger)"-4001218522207553246895237469431"); + assert((bigInteger1 * bigInteger2) == (NahidaProject::BigInteger)"6463933789952062400179139910666398683694552102531682740773920"); + + NahidaProject::RandomGenerator random; + + assert(random.Next(42) >= 0 or random.Next(42) <= 42); + assert(random.NextInt(1, 100) >= 1 or random.NextInt(1, 100) <= 100); + assert(random.NextDouble() >= 0.0 or random.NextDouble() <= 1.0); + assert(random.NextDouble(1.5, 3.5) >= 1.5 or random.NextDouble(1.5, 3.5) <= 3.5); + + std::vector vec(10); + random.Fill(vec, -10, 10); + for (int item : vec) { + assert(item >= -10 or item <= 10); + } + + std::vector numbers = { 1, 2, 3, 4, 5 }; + random.Shuffle(numbers); + + for (int number : numbers) { + std::cout << number << " "; + } + std::cout << "" << std::endl; + + std::deque data{ 1, 2, 3, 5, 6, 8, 4, 9, 9, 4, 6, 4, 3, 7, 1, 0, 0, 6, 8, 9 }; + NahidaProject::Statistics statistics(data.begin(), data.end()); + + assert(statistics.Count() == 20); + assert(statistics.Maximum() == 9); + assert(statistics.Mean() == 4); + assert(statistics.Minimum() == 0); + assert(statistics.StandardDeviation() == 3); + assert(statistics.Sum() == 95); + assert(statistics.SumOfSquares() == 625); + assert(statistics.Variance() == 15); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..214f8e7c019697ca86bdf7d0789daa28686d6a45 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj @@ -0,0 +1,134 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {0a4a2d60-5612-4073-86a5-a991fd77f2c2} + NahidaProjectOtherBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Other-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/NahidaProject-Other-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..601305eb079cbee391e4ed12833028c53afc0f94 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Other-BuildExample/main.cpp @@ -0,0 +1,21 @@ +// NahidaProject-Other-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +int main(int argc, char** argv){ + std::cout << NahidaProject::CowSay::Cow("Moo") << std::endl; + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..75a9149670d552529dd5ecfaaf4996a38bb4970c --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {7b64f4c4-529c-435a-858f-7aca4db71a19} + NahidaProjectSerializationBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + stdcpp20 + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Serialization-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/NahidaProject-Serialization-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/TestRead.csv b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/TestRead.csv new file mode 100644 index 0000000000000000000000000000000000000000..071ba6bca8d40d35ee429a8f093af6ded76f8dca --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/TestRead.csv @@ -0,0 +1,8 @@ +a,b,c +1,2,3 +4,5,6 +7,8,9 +a,b,c +1,2,3 +4,5,6 +7,8,9 diff --git a/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c39a66d2d6cdcdaab9ff1a35d748addea61b9fc4 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Serialization-BuildExample/main.cpp @@ -0,0 +1,126 @@ +// NahidaProject-Serialization-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char** argv) { + std::ofstream ofs("TestRead.csv", std::ios::out | std::ios::app); + ofs << R"(a,b,c +1,2,3 +4,5,6 +7,8,9)" << std::endl; + ofs.close(); + + std::ifstream file("TestRead.csv"); + NahidaProject::CSV::CSV csv(file); + + for (auto& row : csv) { + for (auto& field : row) { + std::cout << field << " | "; + } + std::cout << "" << std::endl; + } + + ::remove("TestRead.csv"); + + NahidaProject::INIWriter writer; + writer.SetFileValue("Section1", "Key1", "Value1"); + writer.SetFileValue("Section1", "Key2", "Value2"); + writer.SetFileValue("Section1", "Key3", "Value3"); + writer.SetFileValue("Section2", "Key1", "Value1"); + writer.SetFileValue("Section2", "Key2", "Value2"); + writer.SetFileValue("Section2", "Key3", "Value3"); + + writer.WriteINIFile("TestRead.ini"); + + NahidaProject::INIReader reader; + reader.ReadFile("TestRead.ini"); + + assert(reader.GetValue("Section1", "Key1") == "Value1"); + assert(reader.GetValue("Section1", "Key2") == "Value2"); + assert(reader.GetValue("Section1", "Key3") == "Value3"); + assert(reader.GetValue("Section2", "Key1") == "Value1"); + assert(reader.GetValue("Section2", "Key2") == "Value2"); + assert(reader.GetValue("Section2", "Key3") == "Value3"); + + ::remove("TestRead.ini"); + + NahidaProject::JSON json; + json.Parse(R"({"name": "Jack", "age": 18, "area": ["c++", "php", "python", "go"], "hobby": {"hobby1": "reading", "hobby2": "coding", "hobby3": "basketball"}})"); + assert(json["name"].ToString() == "\"Jack\""); + assert(json["age"].ToString() == "18"); + assert(json["area"].ToString() == R"(["c++","php","python","go"])"); + assert(json["hobby"]["hobby1"].ToString() == "\"reading\""); + assert(json["hobby"]["hobby2"].ToString() == "\"coding\""); + assert(json["hobby"]["hobby3"].ToString() == "\"basketball\""); + + json.Clear(); + + NahidaProject::XMLWriter xmlWriter; + NahidaProject::XMLWriterNode& documentNode = xmlWriter["DocumentNode"]; + documentNode["Key0"]("Index", "0")("Size", "test"); + documentNode["Key1"]("Index", "1")("Size", "test"); + documentNode["Key2"]("Index", "2")("Size", "test"); + + documentNode["Key0"]["AnotherKey"] = "Value0"; + documentNode["Key1"]["AnotherKey"] = "Value1"; + documentNode["Key2"]["AnotherKey"] = "Value2"; + + documentNode["Key0"]["AnotherKey"]["Another"]("Attribute0", "Value0") = "Test0"; + documentNode["Key1"]["AnotherKey"]["Another"]("Attribute0", "Value0") = "Test1"; + + xmlWriter.OutputFile("TestRead.xml"); + + /* + XMLReader::XMLNode xmlNode; + std::cout << xmlNode.FromFile("TestRead.xml"); + xmlNode.Print(); + XMLReader::XMLNode* node2 = xmlNode.GetChildPtrByName("xml"); + XMLReader::XMLNode* node3 = node2->GetChildPtrByName("DocumentNode"); + XMLReader::XMLNode* node4 = node3->GetChildPtrByName("Key0"); + std::cout << node4->GetAttribute("Index") << std::endl; + */ + ::remove("TestRead.xml"); + + std::ofstream ofs1("TestRead.yml", std::ios::out | std::ios::app); + ofs1 << R"(text: How are you? I am fine Thank you +number: 78.91 +boolValue: true +outer_object: + inner_object: + name: Ningguang + name: Ganyu)" << std::endl; + ofs1.close(); + + NahidaProject::YAML::YAML yaml("TestRead.yml"); + assert(yaml["text"].cast() == "How are you? I am fine Thank you"); + assert(yaml["number"].cast() == 78.91); + assert(yaml["boolValue"].cast()); + assert(yaml["outer_object"]["inner_object"]["name"].cast() == "Ningguang"); + assert(yaml["outer_object"]["name"].cast() == "Ganyu"); + + ::remove("TestRead.yml"); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..b07f4ab3a90ff534e7301d5d7ebf3af8a0411691 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj @@ -0,0 +1,134 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {57a71f29-eac5-4a75-aff3-59309d746ee1} + NahidaProjectSystemDynamicInjectorBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-System-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/NahidaProject-System-DynamicInjector-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..689de6bf0cc44f696cb78a41e84f59aeb6363119 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-DynamicInjector-BuildExample/main.cpp @@ -0,0 +1,21 @@ +// NahidaProject-System-DynamicInjector-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +int main(int argc, char** argv){ + NahidaProject::DynamicLibraryInjector dynamicLibraryInjector; + dynamicLibraryInjector.Inject("ExecutableFile", "F:\\52406\\Microsoft Visual Studio Projects\\NahidaProject\\BuildExample\\StaticLibrary\\NahidaProject-System-BuildExample\\TestMaterials\\DynamicLinkedLibrary.dll"); +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..b68f4acb3a1944ea1350774539f9ae7b8380a990 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {b8841332-02b5-40ba-a0d2-c05a77b1f6c2} + NahidaProjectSystemRegisterTableBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-System-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/NahidaProject-System-RegisterTable-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d601d9d01af4ad8edab507e32a4d7f1f7fc9e320 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-RegisterTable-BuildExample/main.cpp @@ -0,0 +1,26 @@ +// NahidaProject-System-RegisterTable-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +int main(int argc, char** argv) { + NahidaProject::RegisterTable registerTable("Software\\ExampleCache"); + registerTable.SetValue("Key1", "Value1"); + registerTable.SetValue("Key2", "Value2"); + std::cout << registerTable.GetValue("Key1") << std::endl; + std::cout << registerTable.GetValue("Key2") << std::endl; + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..514377c6f0298a8bb317b100ea8c7be0ab056ef4 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj @@ -0,0 +1,131 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {1456a6d6-b626-418c-a887-76b317799836} + NahidaProjectSystemServiceBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..29c1c7893006f9fabd492e42f87f1448572267be --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/NahidaProject-System-Service-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a5794facc66b8cd44a1aa9eed0ea5f8678c3262b --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/NahidaProject-System-Service-BuildExample/main.cpp @@ -0,0 +1,93 @@ +// NahidaProject-System-Service-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +class Service : public WindowsService { + using WindowsService::WindowsService; + +protected: + virtual DWORD WINAPI worker(LPVOID) { + // Periodically check if the service has been requested to stop + while (WaitForSingleObject(stopEvent, 0) != WAIT_OBJECT_0) { + + // Pause on pauseEvent + if (WaitForSingleObject(pauseEvent, 0) != WAIT_OBJECT_0) { + + /* + * Perform main service functionality here + */ + + // Simulate work + Sleep(3000); + + } + else { + confirm_pause(); + // Wait for continue to be thrown + WaitForSingleObject(continueEvent, INFINITE); + confirm_continue(); + } + } + + return ERROR_SUCCESS; + } + + // Gets called during startup. + virtual void on_startup() { + /* + * Perform tasks necessary to start the service here. + */ + } + + // Gets called when pause is thrown and pause/continue is enabled. + virtual void on_pause() { + /* + * Perform tasks necessary to pause the service here. + */ + } + + // Gets called when continue is thrown and pause/continue is enabled. + virtual void on_continue() { + /* + * Perform tasks necessary to continue the service here. + */ + } + + // Gets called when the windows service controller tells service to stop, but BEFORE stopEvent is thrown. + virtual void on_stop() { + /* + * Perform tasks necessary to stop the service loop here. + */ + } + + // Gets called all the way at the end of the liecycle. + virtual void on_exit() { + /* + * Perform tasks necessary for cleanup. + */ + } + + // What to do when the service fails to regiser. + // By default it runs test_startStop(); + virtual void on_failedRegistration() { + /* + * what to do when registration fails... + */ + test_startStop(); + } +}; + +int main(int, TCHAR) { + Service testService("TestService", true); + return testService.run(); +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/TestMaterials/DynamicLinkedLibrary.dll b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/TestMaterials/DynamicLinkedLibrary.dll new file mode 100644 index 0000000000000000000000000000000000000000..1952736d9bdcc01b53107cfdfc58399076540edc Binary files /dev/null and b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/TestMaterials/DynamicLinkedLibrary.dll differ diff --git a/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/TestMaterials/ExecutableFile.exe b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/TestMaterials/ExecutableFile.exe new file mode 100644 index 0000000000000000000000000000000000000000..70b3a84d9bf5ed58f2b6fb57d7e0858a29073635 Binary files /dev/null and b/BuildExample/StaticLibrary/NahidaProject-System-BuildExample/TestMaterials/ExecutableFile.exe differ diff --git a/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..b1d96005e8e7ca2acb8aa006cb9afe48e4287175 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {e0a15b33-3d20-499c-9b1a-9fffda0fc264} + NahidaProjectThreadBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-Thread-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/NahidaProject-Thread-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..51f31fd776009e7738fe91b86b52b4cf7d343225 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-Thread-BuildExample/main.cpp @@ -0,0 +1,106 @@ +// NahidaProject-Thread-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include + +#include +#include +#include +#include + +SetEventBusEvent(TestEvent); + +class HandlerTest : public NahidaProject::EventBus::EventBusHandler { +private: + bool _success; +public: + HandlerTest() : _success(false) { + + } + + void OnEvent(const TestEvent&) override { + _success ^= true; + } + + inline bool isSuccess() const { + return _success; + } +}; + +constexpr float Calculate(float value, int scalar) { + return value * static_cast(scalar); +} + +int main(int argc, char** argv) { + NahidaProject::EventBus::EventBus eventBus; + HandlerTest handler; + TestEvent event; + + eventBus.Subscribe(handler); + eventBus.Publish(event); + + if (!handler.isSuccess()) { + std::cerr << "Failed to execute the handler" << std::endl; + } + + eventBus.Unsubscribe(handler); + eventBus.Publish(event); + if (!handler.isSuccess()) { + std::cerr << "Failed to unsubscribe" << std::endl; + } + + std::cout << "Executed the handler" << std::endl; + + NahidaProject::MemoryPool pool(32, 10); + assert(pool.PrintFreeBlocks(), 10); + void* ptr1 = pool.Allocate(); + void* ptr2 = pool.Allocate(); + void* ptr3 = pool.Allocate(); + assert(pool.PrintFreeBlocks(), 7); + pool.Deallocate(ptr1); + pool.Deallocate(ptr2); + assert(pool.PrintFreeBlocks(), 9); + void* ptr4 = pool.Allocate(); + assert(pool.PrintFreeBlocks(), 8); + + NahidaProject::Signal signal; + auto connection = signal.Connect([](int a) { + std::cout << "Current Number is " << a << std::endl; + }); + + signal(20); + signal(50); + connection.Disconnect(); + + NahidaProject::ThreadPool::SafeQueue::ThreadPool threadPool{}; + + constexpr float num1 = 12.25f; + constexpr float num2 = 17.75f; + constexpr int scalar = 2; + auto foo = threadPool.Enqueue([num1] { + return num1 * static_cast(scalar); + }); + + auto bar = threadPool.Enqueue(Calculate, num2, scalar); + + const auto result_foo = foo.get(); + const auto result_bar = bar.get(); + + assert(result_foo, 24.5); + assert(result_bar, 35.5); + assert(result_foo + result_bar, 60); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..d6b8693178bc9b7b57d5394b510a7118481c4ca6 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj @@ -0,0 +1,134 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {4e03c889-0182-44b5-93de-43ed4e8f674b} + NahidaProjectUnitTestBuildExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\include;%(AdditionalIncludeDirectories) + + + Console + true + F:\52406\Microsoft Visual Studio Projects\NahidaProject-BuildProduced\lib;%(AdditionalLibraryDirectories) + LibNahidaProject-UnitTest-IMPLEMENT.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj.filters b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..65fa6d5ae5f9e34ab47b7f510a94b048c38324ac --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.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 + + + + + 源文件 + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj.user b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/NahidaProject-UnitTest-BuildExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/main.cpp b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3e7a26be1660ba2966ed622c8db31429ceb089b2 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/main.cpp @@ -0,0 +1,87 @@ +// NahidaProject-UnitTest-BuildExample.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +using namespace std; + +class Calculator { +public: + virtual int Add(int a, int b) = 0; +}; + +class MockCalculator : public Calculator { +public: + MockMethod(int, Add, (int, int)); +}; + +TESTCASE(BenchmarkTestTest) { + string val = "3.141592653589793238462643383279502884"; + int count = 1000000; + + auto rt = NahidaProject::NahidaBenchmarkTest::Time(count, { {"atof", [val]() {double d = atof(val.data()); }},{"strtod", [val]() {double d = strtod(val.data(), nullptr); }},{"sscanf", [val]() {double d; sscanf(val.data(), "%lf", &d); }},{"stod", [val]() {double d = stod(val, nullptr); }} }); + + auto comp = NahidaProject::NahidaBenchmarkTest::Compare(rt); + NahidaProject::NahidaBenchmarkTest::PrintResult(comp); + cout << endl << "runtimes in milliseconds:" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(comp); + cout << endl << "runtimes with min, max, mean, variance and standard deviation" << endl; + cout << endl << "nanoseconds" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(rt); + cout << endl << "microseconds" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(rt, 3); + cout << endl << "milliseconds" << endl; + NahidaProject::NahidaBenchmarkTest::PrintResult(rt, 5); + + if (NahidaProject::NahidaBenchmarkTest::WriteResult("sample", rt)) { + cout << endl << "successfully wrote runtimes to sample-*.txt files" << endl << endl; + } + else { + cerr << endl << "there were problems: " << strerror(errno) << endl << endl; + } +} + +TESTCASE(MockTestTest) { + MockCalculator calculator; + When(calculator.Add).Return(3); + JUDGE_EQUAL(calculator.Add(1, 2), 3); +} + +TESTCASE(UnitTestMacroTest) { + JUDGE_EQUAL(78 + 13, 91); + JUDGE_NOTEQUAL(1 + 1, 10086); + JUDGE_TRUE(true); + JUDGE_FALSE(false); + JUDGE_THROWEXCEPTION(throw std::runtime_error("This is a test exception"), std::runtime_error); + JUDGE_TIMEOUT([]() { + std::this_thread::sleep_for(std::chrono::seconds(3)); + }, 5000); +} + +int main(int argc, char** argv) { + NahidaProject::NahidaUnitTest::RunAllTests(); + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-atof-dist.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-atof-dist.txt new file mode 100644 index 0000000000000000000000000000000000000000..d7cd41155c8eba1e7b2ac46a90cf7f521a0e7fd4 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-atof-dist.txt @@ -0,0 +1,539 @@ +1300 15547 +1400 632577 +1500 329155 +1600 16069 +1700 2660 +1800 1038 +1900 474 +2000 294 +2100 183 +2200 130 +2300 76 +2400 70 +2500 48 +2600 61 +2700 46 +2800 48 +2900 29 +3000 29 +3100 30 +3200 31 +3300 28 +3400 24 +3500 36 +3600 29 +3700 24 +3800 18 +3900 17 +4000 28 +4100 22 +4200 20 +4300 20 +4400 29 +4500 25 +4600 22 +4700 15 +4800 19 +4900 18 +5000 12 +5100 9 +5200 11 +5300 10 +5400 7 +5500 8 +5600 13 +5700 15 +5800 6 +5900 14 +6000 6 +6100 7 +6200 4 +6300 5 +6400 6 +6500 5 +6600 6 +6700 14 +6800 17 +6900 13 +7000 7 +7100 5 +7200 7 +7300 3 +7400 1 +7600 2 +7700 2 +7800 5 +7900 6 +8000 1 +8100 3 +8200 2 +8300 4 +8400 3 +8500 3 +8600 4 +8700 1 +8800 3 +8900 5 +9000 2 +9100 6 +9200 4 +9300 3 +9400 4 +9500 9 +9600 3 +9800 1 +9900 2 +10000 2 +10100 1 +10200 4 +10300 4 +10400 2 +10600 2 +10700 2 +10800 4 +10900 1 +11000 3 +11100 5 +11200 3 +11400 2 +11500 3 +11600 2 +11700 1 +12000 3 +12100 1 +12300 3 +12400 1 +12600 3 +12700 1 +12900 2 +13000 1 +13200 2 +13300 1 +13500 3 +13700 3 +13800 2 +13900 2 +14000 2 +14100 1 +14200 1 +14300 2 +14400 2 +14600 1 +14700 3 +14800 1 +15000 2 +15100 3 +15200 1 +15600 1 +15800 1 +15900 1 +16000 6 +16100 2 +16200 2 +16300 2 +16400 1 +16500 2 +16600 3 +16700 1 +16800 2 +16900 2 +17100 5 +17200 2 +17400 1 +17500 2 +17600 1 +17800 3 +17900 1 +18000 1 +18100 2 +18400 1 +18700 7 +18800 3 +18900 3 +19100 3 +19200 3 +19300 6 +19400 1 +19500 3 +19600 4 +19700 1 +19800 6 +19900 1 +20000 2 +20100 4 +20200 1 +20300 1 +20400 5 +20500 5 +20600 3 +20700 2 +20800 1 +20900 5 +21100 3 +21200 3 +21300 2 +21400 3 +21500 2 +21600 1 +21700 4 +21800 4 +21900 4 +22000 3 +22100 2 +22200 1 +22300 1 +22500 3 +22600 1 +22700 2 +22800 2 +22900 3 +23000 2 +23100 3 +23300 4 +23400 2 +23500 1 +23600 1 +23700 1 +23800 7 +23900 2 +24100 2 +24200 2 +24300 1 +24500 1 +24600 1 +24700 1 +24800 3 +24900 1 +25000 1 +25100 1 +25200 1 +25300 1 +25400 2 +25700 2 +25800 1 +25900 1 +26000 1 +26200 2 +26300 1 +26400 2 +26500 3 +26700 1 +26800 3 +26900 1 +27000 2 +27100 2 +27200 3 +27300 3 +27400 1 +27500 1 +27600 2 +27700 2 +27800 1 +28000 1 +28200 3 +28300 2 +28400 1 +28500 1 +28700 1 +28800 1 +29200 2 +29300 2 +29400 1 +29500 1 +29600 2 +29800 1 +30000 1 +30100 1 +30400 2 +30500 2 +30700 1 +30900 1 +31000 1 +31200 2 +31400 4 +31600 2 +31700 1 +31800 1 +31900 1 +32000 3 +32100 1 +32200 3 +32400 2 +32700 1 +32800 2 +32900 1 +33100 1 +33200 1 +33400 1 +33600 2 +33800 4 +33900 1 +34100 4 +34200 1 +34300 4 +34600 1 +34700 1 +34800 3 +35000 5 +35100 2 +35200 2 +35300 2 +35400 3 +35500 1 +35600 1 +35900 1 +36000 1 +36200 1 +36400 1 +36500 1 +36600 1 +36700 3 +36800 1 +37000 2 +37100 1 +37200 1 +37300 1 +37700 3 +38000 2 +38100 4 +38200 3 +38400 1 +38500 2 +38600 2 +38700 2 +38800 1 +38900 1 +39000 1 +39200 1 +39400 1 +39800 1 +40200 1 +40300 2 +40400 2 +40600 1 +40700 1 +40800 1 +40900 1 +41100 1 +41300 1 +41700 1 +41800 1 +41900 1 +42200 1 +42400 1 +42500 1 +42700 1 +42800 1 +43300 3 +43400 1 +44000 1 +44700 1 +44800 1 +44900 1 +45300 1 +45600 1 +46400 1 +46500 1 +46600 2 +46700 1 +47000 1 +47200 1 +47400 2 +47600 2 +47700 2 +47800 1 +48400 1 +48900 2 +49000 2 +49100 1 +49600 1 +50500 1 +50700 1 +50800 1 +51000 1 +51400 2 +51500 1 +51800 1 +51900 1 +52400 1 +52600 1 +52700 1 +52800 1 +52900 1 +53500 1 +53700 1 +54000 1 +54100 1 +54200 1 +54600 1 +54800 2 +55000 1 +55100 1 +55200 1 +55300 1 +55400 1 +55700 1 +55900 1 +56100 2 +56200 1 +56300 1 +56500 1 +56600 1 +56700 1 +56800 1 +56900 2 +57700 1 +57900 1 +58100 1 +58300 1 +58500 2 +58600 1 +58700 1 +58800 2 +59100 1 +59200 1 +59300 3 +59500 1 +59800 1 +60000 2 +60200 1 +60600 1 +60700 2 +60800 4 +61000 3 +61200 1 +61500 1 +61600 2 +62000 1 +62100 1 +62300 1 +62500 1 +62800 2 +62900 1 +63600 1 +63700 1 +63900 1 +64000 1 +64400 1 +64600 2 +64800 1 +65100 2 +65300 1 +65800 1 +66100 1 +66400 1 +66500 1 +66800 1 +66900 1 +67000 1 +67200 1 +67800 2 +68000 1 +68600 1 +68700 1 +68800 2 +69600 1 +70300 1 +70600 1 +70700 2 +71500 1 +71600 1 +71900 2 +72800 1 +73200 1 +73800 1 +75200 1 +75600 1 +76200 1 +76700 1 +77100 1 +77200 3 +77400 1 +77600 2 +77700 1 +78100 2 +78400 1 +78600 1 +79300 1 +79600 1 +79900 1 +81600 1 +82000 1 +83300 1 +83400 1 +83700 1 +85100 1 +85400 1 +85500 1 +85600 1 +85700 1 +86600 1 +88000 1 +90000 1 +90200 1 +92900 1 +93400 1 +94900 1 +95000 1 +97100 1 +99300 1 +103800 1 +105900 1 +106000 1 +106100 1 +106400 1 +108300 1 +118600 1 +122000 1 +123000 1 +124000 1 +124400 1 +128600 1 +147900 1 +149800 1 +151000 1 +151100 1 +152000 1 +153000 1 +154500 1 +155400 1 +156500 1 +158800 1 +164900 1 +175700 1 +190100 1 +192800 1 +193500 1 +201400 1 +235300 1 +244100 1 +257200 1 +282800 1 +294200 1 +311600 1 +323000 1 +329400 1 +336700 1 +363900 1 +366200 1 +371800 1 +421100 1 +433800 1 +461100 1 +549200 1 +598900 1 +644600 1 +728200 1 +735600 1 +846400 1 +860100 1 +952400 1 +1026600 1 +1151000 1 +1545700 1 +1585400 1 +1602800 1 +2748000 1 +3387400 1 +6451800 1 +10890800 1 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-atof.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-atof.txt new file mode 100644 index 0000000000000000000000000000000000000000..79dc48e2e5e2f3e4b996e4673565362e57fbc58a --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-atof.txt @@ -0,0 +1 @@ +1507205 1.30000 10890.80000 1.50721 196881.53449 14.03145 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-sscanf-dist.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-sscanf-dist.txt new file mode 100644 index 0000000000000000000000000000000000000000..11207fbbadc9b20c45ab47d7b7e3a7fed19889c8 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-sscanf-dist.txt @@ -0,0 +1,284 @@ +2000 32698 +2100 592650 +2200 353586 +2300 18895 +2400 1014 +2500 193 +2600 82 +2700 51 +2800 50 +2900 28 +3000 23 +3100 18 +3200 5 +3300 18 +3400 17 +3500 9 +3600 8 +3700 18 +3800 13 +3900 8 +4000 9 +4100 12 +4200 8 +4300 17 +4400 9 +4500 9 +4600 13 +4700 12 +4800 8 +4900 10 +5000 7 +5100 2 +5200 8 +5300 8 +5400 7 +5500 9 +5600 2 +5700 2 +5800 8 +5900 3 +6000 4 +6100 5 +6200 6 +6300 7 +6400 9 +6500 17 +6600 6 +6700 9 +6800 8 +6900 8 +7000 5 +7100 5 +7200 6 +7300 6 +7400 3 +7500 4 +7700 7 +7800 4 +7900 5 +8000 7 +8100 1 +8200 1 +8300 3 +8500 1 +8600 3 +8700 3 +8800 7 +8900 2 +9000 3 +9100 7 +9200 3 +9400 2 +9500 4 +9600 2 +9900 1 +10000 1 +10100 1 +10200 2 +10300 2 +10400 1 +10500 2 +10700 2 +10900 3 +11000 1 +11100 2 +11200 1 +11300 3 +11400 1 +11500 2 +11700 1 +11800 1 +12100 1 +12200 3 +12500 1 +12600 3 +12700 3 +13100 1 +13200 2 +13300 1 +13400 1 +13500 2 +13600 2 +13700 2 +13800 1 +14000 3 +14100 1 +14200 5 +14400 1 +14500 1 +14600 2 +14700 1 +14800 1 +15000 1 +15100 1 +15500 1 +15600 3 +15700 3 +15800 1 +16000 1 +16200 1 +16300 1 +16400 1 +16700 1 +16800 2 +17000 1 +17100 2 +17200 1 +17300 2 +17400 2 +17900 3 +18000 2 +18200 1 +18400 3 +18500 1 +18600 4 +18700 2 +18900 1 +19200 1 +19300 1 +19400 1 +19700 2 +19900 1 +20000 2 +20100 1 +20300 2 +20400 1 +20500 1 +20600 1 +20700 2 +20800 4 +20900 1 +21000 1 +21100 1 +21300 3 +21600 1 +21800 1 +21900 1 +22000 1 +22200 1 +22400 2 +22700 1 +22800 1 +22900 1 +23200 1 +23300 1 +23500 1 +23600 1 +23700 1 +23900 1 +24000 2 +24100 1 +24200 2 +24400 2 +24500 1 +24600 1 +24800 1 +25000 1 +25600 1 +25800 1 +25900 1 +26000 1 +26600 3 +26700 1 +27000 1 +27200 1 +27300 2 +27500 1 +27700 1 +28000 2 +28100 1 +28600 1 +29400 1 +29700 1 +30000 1 +30100 1 +30200 1 +30300 1 +30700 1 +30800 1 +31300 1 +31500 2 +31700 2 +32000 1 +32300 1 +33000 1 +33100 2 +33400 1 +33500 1 +33600 2 +33900 2 +34200 1 +34300 1 +34400 1 +34700 1 +35100 1 +35700 1 +36100 2 +36200 1 +36800 1 +37500 1 +38500 1 +39400 1 +39500 1 +41100 1 +42200 1 +43400 2 +44500 1 +46200 1 +50200 2 +50600 1 +50900 2 +53000 1 +53100 1 +54900 1 +55100 1 +55200 1 +57400 1 +57900 1 +58300 1 +59300 1 +59500 1 +60600 1 +60700 1 +61000 1 +61900 1 +62000 1 +64200 1 +66100 1 +67100 1 +67900 1 +68400 1 +71300 1 +75900 1 +76700 1 +78100 1 +78600 1 +81100 1 +81500 1 +84800 1 +84900 1 +89000 1 +91300 1 +94800 1 +104000 1 +106700 1 +115900 1 +119200 1 +123100 1 +131700 1 +134700 1 +138100 1 +141900 1 +145300 1 +148700 1 +153200 1 +166300 1 +170000 1 +186200 1 +248200 1 +345700 1 +458500 1 +479000 1 +581200 1 +2525600 1 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-sscanf.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-sscanf.txt new file mode 100644 index 0000000000000000000000000000000000000000..d29c77ba43cc1f60ece3326bc49e0e8547639037 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-sscanf.txt @@ -0,0 +1 @@ +2151197 2.00000 2525.60000 2.15120 7869.64744 2.80529 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-stod-dist.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-stod-dist.txt new file mode 100644 index 0000000000000000000000000000000000000000..5b543da8ef340dfe4a60bf410760580be1e9f510 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-stod-dist.txt @@ -0,0 +1,260 @@ +1400 43617 +1500 675875 +1600 271798 +1700 7234 +1800 507 +1900 214 +2000 84 +2100 44 +2200 26 +2300 14 +2400 14 +2500 8 +2600 12 +2700 12 +2800 10 +2900 13 +3000 15 +3100 17 +3200 10 +3300 7 +3400 18 +3500 10 +3600 12 +3700 8 +3800 10 +3900 12 +4000 8 +4100 6 +4200 8 +4300 8 +4400 6 +4500 2 +4600 3 +4700 5 +4800 8 +4900 3 +5000 5 +5100 4 +5200 7 +5300 4 +5400 4 +5500 9 +5600 3 +5700 1 +5800 2 +5900 2 +6000 2 +6100 3 +6200 3 +6300 2 +6400 1 +6500 2 +6600 1 +6800 2 +6900 2 +7000 3 +7100 4 +7200 3 +7300 1 +7500 1 +8200 3 +8300 2 +8500 2 +8600 2 +8800 1 +9100 2 +9200 2 +9400 3 +9500 1 +9600 1 +9800 3 +9900 2 +10000 2 +10300 1 +10500 1 +10700 1 +10800 1 +11000 1 +11300 1 +11400 1 +11500 3 +11600 4 +11700 1 +11800 1 +11900 1 +12000 2 +12200 1 +12400 1 +12600 1 +12700 1 +12800 1 +13100 2 +13400 1 +13500 3 +13600 1 +13700 1 +13800 2 +14100 3 +14300 1 +14400 2 +14700 3 +14800 1 +14900 1 +15200 1 +15300 1 +15400 2 +15500 1 +15700 1 +15800 1 +15900 1 +16100 2 +16200 2 +16300 2 +16600 2 +16700 1 +16800 2 +16900 1 +17000 2 +17100 1 +17200 4 +17300 1 +17400 1 +17500 1 +17700 1 +17800 1 +17900 1 +18000 1 +18100 3 +18200 2 +18300 1 +18400 1 +18600 4 +18700 3 +18900 1 +19000 1 +19100 1 +19200 1 +19300 1 +19400 1 +19500 1 +19600 2 +19900 3 +20000 3 +20300 2 +20400 1 +20800 1 +20900 2 +21100 3 +21200 2 +21700 1 +21800 2 +22000 1 +22200 1 +22300 1 +22400 1 +22500 1 +22700 1 +22900 1 +23300 1 +23400 1 +23600 1 +24000 1 +24200 2 +24400 1 +24600 1 +24800 1 +25400 1 +25700 1 +25800 1 +25900 1 +26500 1 +26700 1 +27000 1 +27400 2 +28700 1 +28900 1 +29000 1 +29200 1 +29400 1 +29700 1 +29800 1 +30000 1 +30600 1 +30900 2 +31400 3 +31700 1 +32400 1 +32500 3 +33200 1 +33500 1 +33700 1 +33800 1 +33900 1 +34100 1 +34200 2 +34500 1 +34800 1 +35100 1 +35200 1 +35300 1 +36200 1 +36300 2 +37400 1 +38400 1 +39000 2 +39400 1 +39700 1 +40600 1 +41500 1 +41700 1 +41800 1 +43300 1 +43700 1 +43800 2 +43900 2 +44300 1 +49600 1 +50200 1 +50600 1 +51600 1 +53600 1 +53800 1 +55200 1 +57400 1 +58100 1 +58600 1 +59400 1 +59600 1 +61000 2 +61600 1 +62200 1 +63100 1 +64100 1 +64300 2 +65800 1 +68000 1 +70000 1 +70700 1 +72700 1 +81800 1 +88300 1 +110400 1 +113300 1 +118600 1 +122000 1 +123100 1 +128300 1 +130000 1 +135100 1 +143700 1 +145400 1 +150400 1 +150500 1 +156400 1 +168100 1 +174300 1 +229400 1 +289600 1 +418200 1 +428500 1 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-stod.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-stod.txt new file mode 100644 index 0000000000000000000000000000000000000000..69a8cff5b69abb8748ccb152a7e39814703379d1 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-stod.txt @@ -0,0 +1 @@ +1534767 1.40000 428.50000 1.53477 985.42494 0.99269 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-strtod-dist.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-strtod-dist.txt new file mode 100644 index 0000000000000000000000000000000000000000..cc965c5c850457b7fc5dde9dccbca8b179bbc20d --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-strtod-dist.txt @@ -0,0 +1,272 @@ +1300 16203 +1400 635213 +1500 338594 +1600 8764 +1700 298 +1800 120 +1900 64 +2000 28 +2100 24 +2200 14 +2300 14 +2400 16 +2500 15 +2600 28 +2700 19 +2800 11 +2900 17 +3000 22 +3100 13 +3200 16 +3300 21 +3400 10 +3500 16 +3600 12 +3700 9 +3800 14 +3900 9 +4000 2 +4100 9 +4200 3 +4300 4 +4400 5 +4500 7 +4600 4 +4700 6 +4800 2 +5000 1 +5100 3 +5200 4 +5300 3 +5400 3 +5500 5 +5600 2 +5800 5 +5900 6 +6000 2 +6100 4 +6200 1 +6300 1 +6400 1 +6500 1 +6600 9 +6700 11 +6800 11 +6900 17 +7000 6 +7100 5 +7200 2 +7300 4 +7400 2 +7600 2 +7700 1 +7800 1 +7900 1 +8000 1 +8100 2 +8300 2 +8400 2 +8500 1 +8900 2 +9000 1 +9200 1 +9300 4 +9400 1 +9500 1 +9600 1 +9800 1 +9900 1 +10000 1 +10100 1 +10300 2 +10400 2 +10700 3 +10900 1 +11000 2 +11200 3 +11300 2 +11600 2 +11700 1 +11900 1 +12000 1 +12300 1 +12500 1 +12600 1 +12800 1 +12900 1 +13000 1 +13200 1 +13300 1 +13400 1 +13600 3 +13700 1 +14000 2 +14100 1 +14400 2 +14500 1 +14600 1 +14700 2 +14800 1 +15200 1 +15300 1 +15400 1 +15600 1 +15700 2 +15800 1 +15900 1 +16000 1 +16200 1 +16300 1 +16400 1 +16500 2 +16600 1 +16700 2 +16800 3 +16900 2 +17100 1 +17200 1 +17300 1 +17500 3 +17600 1 +18200 2 +18300 1 +18400 1 +18600 2 +18700 2 +18800 1 +18900 1 +19000 1 +19100 1 +19200 2 +19600 1 +19700 1 +19900 2 +20000 1 +20100 2 +20300 1 +20400 1 +20600 2 +20700 1 +20900 1 +21000 1 +21100 1 +21200 1 +21300 1 +21400 2 +21500 1 +21600 1 +22100 2 +22400 1 +22600 1 +22700 2 +22800 1 +23200 4 +23400 1 +23600 1 +23700 2 +23900 1 +24000 1 +24400 1 +24800 2 +25000 2 +25400 1 +25700 1 +25800 1 +26100 1 +26400 1 +26600 1 +26700 1 +27100 1 +27200 1 +27300 1 +27400 1 +27700 2 +28000 1 +28200 2 +28600 1 +28900 1 +29100 1 +29200 1 +30000 1 +30200 1 +30400 1 +30600 1 +30700 1 +30900 1 +31000 1 +31300 1 +32100 1 +33400 1 +33500 1 +33700 1 +34000 1 +34100 1 +34200 2 +34500 2 +34600 1 +35200 1 +35600 1 +35900 1 +37700 1 +38000 1 +38200 1 +38300 1 +38400 1 +39000 1 +39500 1 +39600 1 +40500 1 +41000 1 +41800 1 +42600 1 +43200 1 +43300 1 +44600 1 +46700 1 +47500 1 +48500 1 +48600 2 +49700 1 +49900 1 +50500 2 +52200 1 +52800 1 +53000 1 +54200 1 +54400 1 +54500 1 +56100 1 +57000 1 +57300 1 +57500 1 +58700 1 +58900 1 +59100 1 +60900 1 +63400 1 +66700 1 +69300 1 +70500 1 +74500 1 +82100 1 +85900 1 +93000 1 +101700 1 +109300 1 +112800 1 +130600 1 +132700 1 +136400 1 +139300 1 +145500 1 +147800 1 +149700 1 +151300 1 +160800 1 +179700 1 +180500 1 +183500 2 +234800 1 +272700 1 +343900 1 +416100 1 diff --git a/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-strtod.txt b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-strtod.txt new file mode 100644 index 0000000000000000000000000000000000000000..2e0c21c5f18298000d2970adb665e4014faefff7 --- /dev/null +++ b/BuildExample/StaticLibrary/NahidaProject-UnitTest-BuildExample/sample-strtod.txt @@ -0,0 +1 @@ +1444729 1.30000 416.10000 1.44473 972.74103 0.98628 diff --git a/NahidaProject-Console/CMakeLists.txt b/NahidaProject-Console/CMakeLists.txt index 56caa00e4ec96b5d60d54ff968a87058da391add..fee75a35877920fdb389d3b9f6d907ed30eff339 100644 --- a/NahidaProject-Console/CMakeLists.txt +++ b/NahidaProject-Console/CMakeLists.txt @@ -9,11 +9,14 @@ FILE(GLOB ALL_SOURCECODE ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/* FILE(GLOB ALL_HEADERFILE ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/*.h) FILE(GLOB ALL_SOURCEANDTESTCODE ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/*.cpp ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/*.h ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Tests/*.cpp) ADD_EXECUTABLE(LibNahidaProject-${MODULEID}Tests ${ALL_SOURCEANDTESTCODE} ${TESTFILE}) -ADD_LIBRARY(LibNahidaProject-${MODULEID} STATIC ${ALL_SOURCECODE}) +ADD_LIBRARY(LibNahidaProject-${MODULEID}-IMPLEMENT STATIC ${ALL_SOURCECODE}) +ADD_LIBRARY(LibNahidaProject-${MODULEID} SHARED ${ALL_SOURCECODE}) IF(CMAKE_VERSION VERSION_GREATER 3.12) SET_PROPERTY(TARGET LibNahidaProject-${MODULEID}Tests PROPERTY CXX_STANDARD 20) + SET_PROPERTY(TARGET LibNahidaProject-${MODULEID}-IMPLEMENT PROPERTY CXX_STANDARD 20) SET_PROPERTY(TARGET LibNahidaProject-${MODULEID} PROPERTY CXX_STANDARD 20) + ENDIF() MESSAGE(STATUS "Build module [${MODULEID}] done.") \ No newline at end of file diff --git a/NahidaProject-Console/Sources/ChooseDialog.h b/NahidaProject-Console/Sources/ChooseDialog.h index 8d60cd72ac1fe2348fd79768ba1e6288ea365711..a1ff3f538db0ee6c4039f3e580642eadeb2467f9 100644 --- a/NahidaProject-Console/Sources/ChooseDialog.h +++ b/NahidaProject-Console/Sources/ChooseDialog.h @@ -1,5 +1,4 @@ -#ifndef CHOOSEDIALOG_H -#define CHOOSEDIALOG_H +#pragma once #include #include @@ -28,11 +27,16 @@ const std::wstring NO_INSTRUCTION = L""; namespace NahidaProject { namespace ChooseDialog { - class Option { + class __declspec(dllexport) Option { public: BOOL IsSelected() const { return _selected; } + + Option& operator=(const NahidaProject::ChooseDialog::Option&) { + Option opt; + return opt; + } const std::wstring _displayName; const std::wstring _description; @@ -59,7 +63,7 @@ namespace NahidaProject { }; - struct MenuState { + struct __declspec(dllexport) MenuState { std::vector