diff --git a/.gitignore b/.gitignore index e235f0f..f73d91d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ - + ## Ignore custom items out/ @@ -62,6 +62,7 @@ install_manifest.txt compile_commands.json CTestTestfile.cmake _deps +build ## Ignore items for CLion .idea/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dad2f1..d39deea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,4 @@ -# -# Created by Dynesshely on 2023.02.05. -# Changed by ChenPi11 on 2023.03.05. -# Changed by Dynesshely on 2023.04.17 -# - -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.6) project(CppEnhanced) @@ -14,7 +8,6 @@ file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp") include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/public ) add_library(CppEnhanced SHARED ${SOURCE_FILES}) diff --git a/README.md b/README.md index b0b79a7..034c079 100644 --- a/README.md +++ b/README.md @@ -7,51 +7,18 @@ In future, you will be able to import CppEnhanced from vcpkg and other package m # Build -## Get source codes +## Dependencies -```shell -git clone git@github.com:Dynesshely/CppEnhanced.git -``` - -## On Linux, Unix, Cygwin, MacOS or other unix-like OS - -Prepare CMake, C++ compiler and other tool chain first. - -```shell -# Way 1 (Recommended) -./build.sh - -# Way 2 (Manually) -mkdir build -cd build -cmake .. -make -cd .. -``` - -## On Windows (build with MSVC) ++ CMake. ( Version > 3.6 ) ++ C/C++ build toolchains. -Make sure CMake and MSVC environment installed. +## Command ```shell -# You need execute commands in `Developer PowerShell for VS` -# So that path of `MSBuild.exe` can be located -# You can also query path of `MSBuild.exe` by following command - -# Way 1 (Recommended) -./build.ps1 - -# Way 2 (Manually) mkdir build cd build cmake .. -msbuild ./ALL_BUILD.vcxproj -cd .. -``` - -You can also query path of `MSBuild.exe` by following command: -```cmd -reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" /v MSBuildToolsPath +cmake --build . --config=Release ``` # Components diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index 752fe22..0000000 --- a/build.ps1 +++ /dev/null @@ -1,12 +0,0 @@ - -# $query = (reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" /v MSBuildToolsPath) -# $match = $query -match 'C:\\\S*' -# $path = $match -replace 'MSBuildToolsPath','' -replace 'REG_SZ','' -replace ' ','' - -mkdir build -cd build -cmake .. -# & "${path}MSBuild.exe" ./ALL_BUILD.vcxproj -msbuild ./ALL_BUILD.vcxproj -cd .. - diff --git a/build.sh b/build.sh deleted file mode 100755 index 596357f..0000000 --- a/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -mkdir build -cd build -cmake .. -make -cd .. diff --git a/clean.ps1 b/clean.ps1 deleted file mode 100644 index 37ca268..0000000 --- a/clean.ps1 +++ /dev/null @@ -1 +0,0 @@ -rm build -Force \ No newline at end of file diff --git a/clean.sh b/clean.sh deleted file mode 100755 index 07cbd15..0000000 --- a/clean.sh +++ /dev/null @@ -1 +0,0 @@ -rm -r build diff --git a/include/cppfecs.hpp b/include/cppfecs.hpp index df8bd47..23dd967 100644 --- a/include/cppfecs.hpp +++ b/include/cppfecs.hpp @@ -1,4 +1,4 @@ -#ifndef _INC_STDCPP_FECS_HPP_ +#ifndef _INC_STDCPP_FECS_HPP_ #define _INC_STDCPP_FECS_HPP_ #include "libplatform.h" diff --git a/include/datetime.hpp b/include/datetime.hpp index e5a566d..bece104 100644 --- a/include/datetime.hpp +++ b/include/datetime.hpp @@ -1,9 +1,3 @@ -// -// Created by Dynesshely on 2023.02.05 -// Changed by ChenPi11 on 2023.03.05 -// Changed by Dynesshely on 2023.04.17 -// - #ifndef CPPENHANCED_DATETIME_H #define CPPENHANCED_DATETIME_H @@ -168,9 +162,9 @@ namespace CppEnhanced { std::string ToString(int type, char d = '.', char t = ':') const; - std::string ToString(std::string format) const; + std::string ToString(const std::string& format) const; - std::wstring ToString(std::wstring format) const; + std::wstring ToString(const std::wstring& format) const; bool Validate() noexcept; diff --git a/public/stdc++.h b/public/stdc++.h deleted file mode 100644 index 033a3b0..0000000 --- a/public/stdc++.h +++ /dev/null @@ -1,117 +0,0 @@ -// C++ includes used for precompiling -*- C++ -*- - -// Copyright (C) 2003-2013 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file stdc++.h - * This is an implementation file for a precompiled header. - */ - - // 17.4.1.2 Headers - - // C -#ifndef _GLIBCXX_NO_ASSERT -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if __cplusplus >= 201103L -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -// C++ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if __cplusplus >= 201103L -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif \ No newline at end of file diff --git a/source/datetime.cpp b/source/datetime.cpp index 28c8a78..f913ba4 100644 --- a/source/datetime.cpp +++ b/source/datetime.cpp @@ -1,9 +1,3 @@ -// -// Created by Dynesshely on 2023.02.05 -// Changed by ChenPi11 on 2023.03.05 -// Changed by Dynesshely on 2023.04.17 -// - #include namespace CppEnhanced { @@ -129,14 +123,14 @@ namespace CppEnhanced { return _pub_osstream.str(); } - std::string DateTime::ToString(std::string format) const { + std::string DateTime::ToString(const std::string& format) const { // Todo: to string return std::string(""); } - std::wstring DateTime::ToString(std::wstring format) const { + std::wstring DateTime::ToString(const std::wstring& format) const { // Todo: to wstring diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1693f25..fd16eaa 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ - + set(TEST_SOURCES test_datetime.cpp ) diff --git a/tests/test_datetime.cpp b/tests/test_datetime.cpp index 3ce986c..94132b7 100644 --- a/tests/test_datetime.cpp +++ b/tests/test_datetime.cpp @@ -1,4 +1,4 @@ - + #include #include