Skip to content

Commit 861d518

Browse files
authored
Release/1.1.0 (#28)
* Added initial UTF8 support Revert "Added initial UTF8 support" This reverts commit 7abeb98. Readers implemented Reader implementation complete * Added regression test for issue #23 Closes #23 * Documentation updated * Added missing assert.h include Needed for visual studio * Switched assert to test case * Fixed warning regarding static assert Test is now performed at runtime * Fixed GCC compile errors * Fixed missing method in older GNU Closes #27 * Updated version to 1.1.0
1 parent 2b298c3 commit 861d518

File tree

10 files changed

+983
-380
lines changed

10 files changed

+983
-380
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ else()
1111

1212
cmake_minimum_required (VERSION 3.8)
1313

14-
project(simpleson VERSION 1.0.3)
14+
project(simpleson VERSION 1.1.0)
1515

1616
add_library(${PROJECT_NAME}
1717
json.cpp
@@ -31,5 +31,6 @@ else()
3131
enable_testing()
3232
add_subdirectory (test)
3333
add_subdirectory (examples)
34+
add_subdirectory (issues)
3435

3536
endif()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Lightweight C++ JSON parser & serializer that is C++98 compatible with no de
55

66
[Github Repository](https://github.com/gregjesl/simpleson)
77

8-
[Documentation](https://www.oldgreg.net/simpleson/1.0.3)
8+
[Documentation](https://www.oldgreg.net/simpleson/1.1.0)
99

1010
## Why simpleson?
1111
Simpleson is built under the following requirements:

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '1.0.3.{build}'
1+
version: '1.1.0.{build}'
22

33
image:
44
- Visual Studio 2015

issues/23.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include "json.h"
2+
#include "../test/test.h"
3+
#include <iostream>
4+
5+
int main(void)
6+
{
7+
const char *test = "{\"key\":\"value\\\"\"}";
8+
json::jobject result = json::jobject::parse(test);
9+
const std::string echo = result.as_string();
10+
TEST_STRING_EQUAL(test, echo.c_str());
11+
test = "{ \"0\": {\"key\":\"value\\\"\"} }";
12+
std::cout << test;
13+
std::cout << "\n";
14+
result = json::jobject::parse(test);
15+
std::cout << result.as_string() + "\n";
16+
json::jobject inner_obj = result["0"];
17+
std::cout << inner_obj.as_string();
18+
TEST_STRING_EQUAL(inner_obj.as_string().c_str(), "{\"key\":\"value\\\"\"}");
19+
std::string inner = result["0"].as_string();
20+
TEST_STRING_EQUAL(inner.c_str(), "{\"key\":\"value\\\"\"}");
21+
}

issues/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
include_directories(../)
2+
3+
file(GLOB tests
4+
"*.cpp"
5+
)
6+
7+
foreach(test ${tests})
8+
string(REGEX REPLACE ".*/" "" test_name "${test}")
9+
string(REGEX REPLACE ".cpp$" "" test_name "${test_name}")
10+
add_executable ("issue_${test_name}" ${test})
11+
target_link_libraries("issue_${test_name}" simpleson)
12+
if(MSVC)
13+
set_property(TARGET "issue_${test_name}" PROPERTY _CRT_SECURE_NO_WARNINGS)
14+
endif()
15+
add_test(NAME ${test_name} COMMAND "issue_${test_name}")
16+
endforeach()

0 commit comments

Comments
 (0)