Skip to content

Commit

Permalink
Merge pull request #6 from ChenPi11/main
Browse files Browse the repository at this point in the history
[Pull Request] Optimize structures and fix some bugs.
  • Loading branch information
Dynesshely authored Aug 26, 2023
2 parents f2c8985 + c4aaaeb commit d52c719
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 202 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


## Ignore custom items
out/

Expand Down Expand Up @@ -62,6 +62,7 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
build

## Ignore items for CLion
.idea/
Expand Down
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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})
Expand Down
43 changes: 5 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]: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
Expand Down
12 changes: 0 additions & 12 deletions build.ps1

This file was deleted.

5 changes: 0 additions & 5 deletions build.sh

This file was deleted.

1 change: 0 additions & 1 deletion clean.ps1

This file was deleted.

1 change: 0 additions & 1 deletion clean.sh

This file was deleted.

2 changes: 1 addition & 1 deletion include/cppfecs.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef _INC_STDCPP_FECS_HPP_
#ifndef _INC_STDCPP_FECS_HPP_
#define _INC_STDCPP_FECS_HPP_
#include "libplatform.h"

Expand Down
10 changes: 2 additions & 8 deletions include/datetime.hpp
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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;

Expand Down
117 changes: 0 additions & 117 deletions public/stdc++.h

This file was deleted.

10 changes: 2 additions & 8 deletions source/datetime.cpp
Original file line number Diff line number Diff line change
@@ -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 <datetime.hpp>

namespace CppEnhanced {
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


set(TEST_SOURCES
test_datetime.cpp
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_datetime.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


#include <datetime.hpp>
#include <stdio.h>

Expand Down

0 comments on commit d52c719

Please sign in to comment.