Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jespa007 committed Jan 30, 2023
2 parents 104e06e + ee5d558 commit c6d2991
Show file tree
Hide file tree
Showing 11 changed files with 389 additions and 229 deletions.
6 changes: 3 additions & 3 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,19 @@
<target name="CMake Debug" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments/>
<buildTarget>-H. -Bbuild/gcc -DTARGET=debug</buildTarget>
<buildTarget>-H. -Bbuild/gcc -DCMAKE_BUILD_TYPE=Debug</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="CMake Release" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments/>
<buildTarget>-H. -Bbuild/gcc -DTARGET=release</buildTarget>
<buildTarget>-H. -Bbuild/gcc</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cproject>
</cproject>
94 changes: 0 additions & 94 deletions HISTORY

This file was deleted.

102 changes: 102 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@


//----------------------------
Date: 21/12/2022
Version: 2.1.0

- [x] Do not serialize unserialized fields in objects
- [x] use -WSanitizer=Address in linux if memmgr directory not found

//----------------------------
Date: 01/07/2022
Version: 2.0.4

- [x] Compile with pedantic
- [x] Adapt changes memmgr
- [x] JsonVar::__zs_variable__: change std::string type to char[ZJ_MAX_CONST_CHAR]
- [x] reorder dirs

//----------------------------
Date: 10/07/2021
Version: 2.0.3

- [x] Organize files
- [x] Move src dir

//----------------------------
Date: 15/04/2021
Version: 2.0.2

- [x] Fix bug write exception message when filename is null (whn loads in mmeory)
- [x] Improve error exception

//----------------------------
Date: 7/04/2021
Version: 2.0.1

- [x] Fix bug crash when cannot parse json value

//----------------------------
Date: 14/02/2021
Version: 2.0.0

Main features

- [x] Added support for map/dictionary of elements
- [x] Massive code organization and clean up
- [x] Support uft-8 files with bom
- [x] Support for deserialize any json type (i.e number/string/boolean/object, vector or map of elements)

Detail

#19 Support unicode files/strings
#20 throw error instead of if(error)
#21 Removed CBuffer
#22 Changed var/C* to var/JZ_*
#23 organize zetjsoncpp_utils to string and io files
#4 changed CParserVarXXXXArray by CParserVarArrayXXXX
#5 ZJ_Number: Only works with floats
#6 Migrate new c++ style
#10 Change ParseJson name by ZetJsonCpp
#11 Test operator functions for number/string/boolean
#12 Change Json Object names starting by JsonVarXXXXX
#13 Implement JsonVarMap
#14 Specify starting type JsonVar (i.e JsonVarNumber,JsonVarObject, JsonVarArrayObject, ...) instead of fixed JsonVarArrayObject<_T>
#16 create tests test
#17 Support UTF-8 with/out BOM mark Feature
#18 Pre/Post name all variables associated with JsonVar

//----------------------------
Date: 15/05/2018
Version: 1.3.0

- [x] Review version history to new format (MAJOR.MINOR.PATCH)
- [x] Behaviour on error/warning is done through a callback setFunctionOnError, setFunctionOnWarning. If these functions are not set, then the message is printed with fprintf (stderr)
- [x] Added memory leak detection (only for GNU toolchain). It needs memmanager https://github.org/jespa007/memmanager and pass -DMEMMANAGER parameter on cmake
- [x] Fixed compile test_json shared library on MSVC plataform
- [x] improve cmake message prints

//----------------------------
Date: 10/05/2018
Version: 1.2.0

- [x] MSVC Support (v141 Tools or MSVC++ 2015)
- [x] restruct files/dirs new set.
- [x] Added zetjsoncpp namespace
- [x] Renamed fastjsoncpp to zetjsoncpp
- [x] Added feature detect array types
- [x] Changed GPL3 license to MIT

//----------------------------
Date: 29/08/2015
Version: 1.1.0

- [x] Added feature support numbor as cientific notation (i.e 2.1E-10).
- [x] Added feature on detecting property group or property group arrays.
- [x] Fixed carry return line feeds compatible for Windows

//----------------------------
Date: 08/08/2014
Version: 1.0.0

- [x] First version
77 changes: 42 additions & 35 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ cmake_minimum_required(VERSION 3.15)

project(zetjsoncpp)

IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release )
ENDIF()

set(POST_NAME "")
set(IS_DEBUG FALSE)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(IS_DEBUG TRUE)
SET( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -D__DEBUG__ ")
set( POST_NAME "_d")
endif()

MESSAGE ("-- Target: " ${CMAKE_BUILD_TYPE})

file(READ "zetjsoncpp.h" zetjsoncpp_h)

string(REGEX MATCH "ZETJSONCPP_VERSION_MAJOR ([0-9]*)" _ ${zetjsoncpp_h})
Expand Down Expand Up @@ -52,7 +66,7 @@ MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST)

ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)

#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#--------------
#
# COMMON PARAMS
#
Expand All @@ -65,7 +79,6 @@ message("-- Install drectory: " ${CMAKE_INSTALL_PREFIX})

set(ZETJSONCPP_LIB_SRCS "")


if(MSVC)
MESSAGE ("-- Plataform: MSVC" )

Expand All @@ -83,44 +96,55 @@ if(MSVC)

else()

SET( COMMON_CXX_PARAMS " ${COMMON_CXX_PARAMS} -D__STDC_CONSTANT_MACROS -std=gnu++0x -I -Wall -Wextra -pedantic ")
SET( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS -std=gnu++0x -I -Wall -Wextra -pedantic ")

if (MINGW)
MESSAGE("-- Plataform: MINGW" )
else()
SET( COMMON_CXX_PARAMS " ${COMMON_CXX_PARAMS} -fPIC ")
if(GNU)
MESSAGE ("-- Plataform: GNU" )
else()
MESSAGE ("-- Plataform: Unknown" )
SET( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -fPIC ")
if(UNIX)
MESSAGE ("-- Plataform: Unix" )
file(READ "/etc/issue" ETC_ISSUE )
string(REGEX MATCH "Debian|Ubuntu|Alpine" DIST ${ETC_ISSUE})
MESSAGE ("-- Dist: " ${DIST} )
else()
MESSAGE ("-- Plataform: Unknown" )
endif()
endif()

IF ( "${TARGET}" STREQUAL "debug")
IF ( IS_DEBUG)

set(COMMON_CXX_PARAMS " ${COMMON_CXX_PARAMS} -O0 -g -D__DEBUG__ ")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -O0 -g -D__DEBUG__ ")

IF( EXISTS ${PROJECT_SOURCE_DIR}/../../memmgr )
message("-- Memmanager: ON")
SET( COMMON_CXX_PARAMS " ${COMMON_CXX_PARAMS} -D__MEMMANAGER__")
SET( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -D__MEMMANAGER__")
include_directories (
${PROJECT_SOURCE_DIR}/../../memmgr
)
set(ZETJSONCPP_LIB_SRCS ${ZETJSONCPP_LIB_SRCS} ${PROJECT_SOURCE_DIR}/../../memmgr/memmgr.cpp)
else()
message("-- Memmanager: OFF (../../memmgr not exist)")
if(UNIX)
if( NOT "${DIST}" STREQUAL "Alpine")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -fsanitize=address ")
message("-- Memmanager: -fsanitize=address")
else()
message("-- Memmanager: -fsanitize NOT supported")
endif()
else()
message("-- Memmanager: OFF ($ENV{EIPM_DEVELOP_LIBS_CPP}/memmgr not exist)")
endif()
endif()

ELSE()
set(TARGET "release")
message("-- Memmanager: OFF")
set(COMMON_CXX_PARAMS " ${COMMON_CXX_PARAMS} -O2 ")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -O2 ")
ENDIF()

#Redefine output dir ...
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${TARGET})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${TARGET})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${TARGET})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
LINK_DIRECTORIES(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})


Expand All @@ -135,24 +159,10 @@ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
endif()



IF ( "${TARGET}" STREQUAL "")
SET ( TARGET "release" )
ENDIF ()

set( POST_NAME "")
IF ( "${TARGET}" STREQUAL "debug")
set( POST_NAME "_d")
ENDIF()

MESSAGE ("-- Target: " ${TARGET})

SET(CMAKE_CXX_FLAGS " ${COMMON_CXX_PARAMS} " )

#
# COMMON PARAMS
#
#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#---------------
#
# COMPILE PARAMS
#
Expand Down Expand Up @@ -181,20 +191,17 @@ message("-- Library type: " ${LIBRARY_TYPE_CREATION})
# json2cpplib
add_library( ${ZETJSONCPP_LIB_NAME}${POST_NAME} ${LIBRARY_TYPE_CREATION} ${ZETJSONCPP_LIB_SRCS} )


#JSON TEST executable
set(JSON_TEST_SRCS ${PROJECT_SOURCE_DIR}/../test/test.cpp)

#JSON TEST_FILE executable
set(JSON_TEST_FILE_SRCS ${PROJECT_SOURCE_DIR}/../test/test_file.cpp)


if(MSVC)
#only for msvc...
set_target_properties(${ZETJSONCPP_LIB_NAME}${POST_NAME} PROPERTIES COMPILE_DEFINITIONS ZETJSONCPP_EXPORTS)
endif()


SET(
HS
util/zj_strutils.h
Expand Down
6 changes: 1 addition & 5 deletions src/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* This file is distributed under the MIT License.
* See LICENSE file for details.
*/
#ifndef __ZJ_EXCEPTION_H__
#define __ZJ_EXCEPTION_H__
#pragma once

namespace zetjsoncpp {

Expand Down Expand Up @@ -31,8 +30,5 @@ namespace zetjsoncpp {
return (const char *)what_msg;
}
};


}

#endif
Loading

0 comments on commit c6d2991

Please sign in to comment.