-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e398ba
commit b146662
Showing
22 changed files
with
1,596 additions
and
1,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,68 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
|
||
jobs: | ||
check-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check Release Commit | ||
run: | | ||
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then | ||
releaseField=$(git log -1 --pretty=format:'%B' | grep -oE 'RELEASE: [^\n]+' | cut -d' ' -f2) | ||
if [[ -n "$releaseField" ]]; then | ||
echo "Release field found. Continuing with subsequent jobs." | ||
else | ||
echo "No release field found. Exiting with code 78." | ||
exit 78 # Exit code 78 skips subsequent jobs | ||
fi | ||
else | ||
echo "Not a push to master branch. Exiting with code 78." | ||
exit 78 # Exit code 78 skips subsequent jobs | ||
fi | ||
shell: bash | ||
build-linux: | ||
needs: check-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: build | ||
run: | | ||
mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build . | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: linux | ||
path: build/json | ||
build-windows: | ||
needs: check-release | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: set up Msys2 | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ucrt64 | ||
install: >- | ||
libiconv-devel | ||
cmake | ||
gcc | ||
ninja | ||
pkg-config | ||
- name: build | ||
shell: msys2 {0} | ||
run: | | ||
mkdir build && cd build | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build . | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: windows | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
|
||
jobs: | ||
check-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check Release Commit | ||
run: | | ||
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then | ||
releaseField=$(git log -1 --pretty=format:'%B' | grep -oE 'RELEASE: [^\n]+' | cut -d' ' -f2) | ||
if [[ -n "$releaseField" ]]; then | ||
echo "Release field found. Continuing with subsequent jobs." | ||
else | ||
echo "No release field found. Exiting with code 78." | ||
exit 78 # Exit code 78 skips subsequent jobs | ||
fi | ||
else | ||
echo "Not a push to master branch. Exiting with code 78." | ||
exit 78 # Exit code 78 skips subsequent jobs | ||
fi | ||
shell: bash | ||
build-linux: | ||
needs: check-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: build | ||
run: | | ||
mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build . | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: linux | ||
path: build/json | ||
build-windows: | ||
needs: check-release | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: set up Msys2 | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ucrt64 | ||
install: >- | ||
libiconv-devel | ||
cmake | ||
gcc | ||
ninja | ||
pkg-config | ||
- name: build | ||
shell: msys2 {0} | ||
run: | | ||
mkdir build && cd build | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build . | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: windows | ||
path: build/json.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
.vs/ | ||
.idea/ | ||
x64/ | ||
cmake-build-debug/ | ||
cmake-build-release/ | ||
cmake-build-debug-mingw/ | ||
*.pdb | ||
|
||
lcui-quick-start.zip | ||
package-lock.json | ||
-g/ | ||
.vs/ | ||
.idea/ | ||
x64/ | ||
cmake-build-debug/ | ||
cmake-build-release/ | ||
cmake-build-debug-mingw/ | ||
*.pdb | ||
|
||
lcui-quick-start.zip | ||
package-lock.json | ||
-g/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
cmake_minimum_required(VERSION 3.27) | ||
|
||
PROJECT(JsonParser C) | ||
set(CMAKE_C_STANDARD 17) | ||
|
||
find_package(Iconv REQUIRED) | ||
add_definitions(-DLOCALEDIR="\"${CMAKE_INSTALL_PREFIX}/share/locale\"") | ||
|
||
|
||
add_library(jsonParserLib | ||
core/Json.h | ||
core/parser/parser.h | ||
core/types/JsonValue.h | ||
core/types/JsonArray.h | ||
core/types/JsonObject.h | ||
core/types/JsonString.h | ||
core/utils/outputer.h | ||
core/utils/outputer.c | ||
core/parser/parser.c | ||
core/types/JsonValue.c | ||
core/types/JsonArray.c | ||
core/types/JsonObject.c | ||
core/types/JsonString.c | ||
) | ||
target_link_libraries(jsonParserLib PRIVATE Iconv::Iconv) | ||
|
||
add_executable(json | ||
cli/main.c | ||
) | ||
target_include_directories(json PRIVATE | ||
core | ||
) | ||
target_link_libraries(json PRIVATE | ||
jsonParserLib | ||
) | ||
|
||
add_library(cutest | ||
cutest/CuTest.h | ||
cutest/CuTest.c | ||
) | ||
|
||
add_executable(string_test | ||
test/stringTest.c | ||
) | ||
|
||
target_include_directories(string_test PRIVATE | ||
core | ||
cutest | ||
) | ||
target_link_libraries(string_test PRIVATE | ||
cutest | ||
jsonParserLib | ||
) | ||
|
||
enable_testing() | ||
add_test( | ||
NAME "String Test" | ||
COMMAND string_test | ||
cmake_minimum_required(VERSION 3.27) | ||
|
||
PROJECT(JsonParser C) | ||
set(CMAKE_C_STANDARD 17) | ||
|
||
find_package(Iconv REQUIRED) | ||
add_definitions(-DLOCALEDIR="\"${CMAKE_INSTALL_PREFIX}/share/locale\"") | ||
|
||
|
||
add_library(jsonParserLib | ||
core/Json.h | ||
core/parser/parser.h | ||
core/types/JsonValue.h | ||
core/types/JsonArray.h | ||
core/types/JsonObject.h | ||
core/types/JsonString.h | ||
core/utils/outputer.h | ||
core/utils/outputer.c | ||
core/parser/parser.c | ||
core/types/JsonValue.c | ||
core/types/JsonArray.c | ||
core/types/JsonObject.c | ||
core/types/JsonString.c | ||
) | ||
target_link_libraries(jsonParserLib PRIVATE Iconv::Iconv) | ||
|
||
add_executable(json | ||
cli/main.c | ||
) | ||
target_include_directories(json PRIVATE | ||
core | ||
) | ||
target_link_libraries(json PRIVATE | ||
jsonParserLib | ||
) | ||
|
||
add_library(cutest | ||
cutest/CuTest.h | ||
cutest/CuTest.c | ||
) | ||
|
||
add_executable(string_test | ||
test/stringTest.c | ||
) | ||
|
||
target_include_directories(string_test PRIVATE | ||
core | ||
cutest | ||
) | ||
target_link_libraries(string_test PRIVATE | ||
cutest | ||
jsonParserLib | ||
) | ||
|
||
enable_testing() | ||
add_test( | ||
NAME "String Test" | ||
COMMAND string_test | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
The MIT License (MIT) | ||
===================== | ||
Copyright © `2023` `undefined-ux` | ||
|
||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the “Software”), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
The MIT License (MIT) | ||
===================== | ||
Copyright © `2023` `undefined-ux` | ||
|
||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the “Software”), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# 大一 C语言大作业 | ||
|
||
## json解析器 | ||
|
||
[下载](https://github.com/undefined-ux/json-parser-homework/releases) [CI构建](https://github.com/undefined-ux/json-parser-homework/actions) | ||
|
||
[文档](https://undefined-ux.github.io/json-parser-homework) | ||
### 命令行版本 | ||
#### 使用 | ||
``` | ||
如果未指定输入或输出文件,则程序将默认使用标准输入或标准输出。 | ||
注意:-c / --compress 和 -f / --format 选项不能同时使用 | ||
-if, --input 指定输入文件(默认为标准输入) | ||
-of, --output 指定输出文件(默认为标准输出) | ||
-f, --format 使用树形缩进输出格式化的JSON | ||
-h, --help 显示此帮助并退出 | ||
-c, --compress 输出压缩的JSON | ||
-u, --utf 启用utf-8编码支持 | ||
``` | ||
|
||
### GUI | ||
<del>GUI目前仍然是饼, 没做</del> | ||
# 大一 C语言大作业 | ||
|
||
## json解析器 | ||
|
||
[下载](https://github.com/undefined-ux/json-parser-homework/releases) [CI构建](https://github.com/undefined-ux/json-parser-homework/actions) | ||
|
||
[文档](https://undefined-ux.github.io/json-parser-homework) | ||
### 命令行版本 | ||
#### 使用 | ||
``` | ||
如果未指定输入或输出文件,则程序将默认使用标准输入或标准输出。 | ||
注意:-c / --compress 和 -f / --format 选项不能同时使用 | ||
-if, --input 指定输入文件(默认为标准输入) | ||
-of, --output 指定输出文件(默认为标准输出) | ||
-f, --format 使用树形缩进输出格式化的JSON | ||
-h, --help 显示此帮助并退出 | ||
-c, --compress 输出压缩的JSON | ||
-u, --utf 启用utf-8编码支持 | ||
``` | ||
|
||
### GUI | ||
<del>GUI目前仍然是饼, 没做</del> |
Oops, something went wrong.