-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
225 changed files
with
24,506 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
# BasedOnStyle: LLVM | ||
AccessModifierOffset: -2 | ||
ConstructorInitializerIndentWidth: 4 | ||
AlignEscapedNewlinesLeft: false | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakTemplateDeclarations: false | ||
AlwaysBreakBeforeMultilineStrings: false | ||
BreakBeforeBinaryOperators: false | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BinPackParameters: false | ||
ColumnLimit: 80 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
DerivePointerBinding: false | ||
ExperimentalAutoDetectBinPacking: false | ||
IndentCaseLabels: false | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 60 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
PointerBindsToType: true | ||
SpacesBeforeTrailingComments: 1 | ||
Cpp11BracedListStyle: false | ||
Standard: Cpp03 | ||
IndentWidth: 2 | ||
TabWidth: 8 | ||
UseTab: Never | ||
BreakBeforeBraces: Attach | ||
IndentFunctionDeclarationAfterType: false | ||
SpacesInParentheses: false | ||
SpacesInAngles: false | ||
SpaceInEmptyParentheses: false | ||
SpacesInCStyleCastParentheses: false | ||
SpaceAfterControlStatementKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
ContinuationIndentWidth: 4 | ||
... | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* text=auto | ||
*.h text | ||
*.cpp text | ||
*.json text | ||
*.in text | ||
*.sh eol=lf | ||
*.bat eol=crlf | ||
*.vcproj eol=crlf | ||
*.vcxproj eol=crlf | ||
*.sln eol=crlf | ||
devtools/agent_vm* eol=crlf |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/build/ | ||
*.pyc | ||
*.swp | ||
*.actual | ||
*.actual-rewrite | ||
*.process-output | ||
*.rewrite | ||
/bin/ | ||
/buildscons/ | ||
/libs/ | ||
/doc/doxyfile | ||
/dist/ | ||
#/version | ||
#/include/json/version.h | ||
|
||
# MSVC project files: | ||
*.sln | ||
*.vcxproj | ||
*.filters | ||
*.user | ||
*.sdf | ||
*.opensdf | ||
*.suo | ||
|
||
# MSVC build files: | ||
*.lib | ||
*.obj | ||
*.tlog/ | ||
*.pdb | ||
|
||
# CMake-generated files: | ||
CMakeFiles/ | ||
CTestTestFile.cmake | ||
cmake_install.cmake | ||
pkg-config/jsoncpp.pc | ||
jsoncpp_lib_static.dir/ | ||
|
||
# In case someone runs cmake in the root-dir: | ||
/CMakeCache.txt | ||
/Makefile | ||
/include/Makefile | ||
/src/Makefile | ||
/src/jsontestrunner/Makefile | ||
/src/jsontestrunner/jsontestrunner_exe | ||
/src/lib_json/Makefile | ||
/src/test_lib_json/Makefile | ||
/src/test_lib_json/jsoncpp_test | ||
|
||
# eclipse project files | ||
.project | ||
.cproject | ||
/.settings/ |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Build matrix / environment variable are explained on: | ||
# http://about.travis-ci.org/docs/user/build-configuration/ | ||
# This file can be validated on: | ||
# http://lint.travis-ci.org/ | ||
# See also | ||
# http://stackoverflow.com/questions/22111549/travis-ci-with-clang-3-4-and-c11/30925448#30925448 | ||
# to allow C++11, though we are not yet building with -std=c++11 | ||
|
||
install: | ||
# /usr/bin/gcc is 4.6 always, but gcc-X.Y is available. | ||
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi | ||
# /usr/bin/clang is our version already, and clang-X.Y does not exist. | ||
#- if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi | ||
- echo ${PATH} | ||
- ls /usr/local | ||
- ls /usr/local/bin | ||
- export PATH=/usr/local/bin:/usr/bin:${PATH} | ||
- echo ${CXX} | ||
- ${CXX} --version | ||
- which valgrind | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- gcc-4.9 | ||
- g++-4.9 | ||
- clang | ||
- valgrind | ||
os: | ||
- linux | ||
language: cpp | ||
compiler: | ||
- gcc | ||
- clang | ||
script: ./travis.sh | ||
env: | ||
matrix: | ||
- SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false | ||
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE | ||
notifications: | ||
email: false | ||
sudo: false |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Baptiste Lepilleur <[email protected]> |
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 |
---|---|---|
@@ -0,0 +1,154 @@ | ||
# vim: et ts=4 sts=4 sw=4 tw=0 | ||
|
||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) | ||
PROJECT(jsoncpp) | ||
ENABLE_TESTING() | ||
|
||
OPTION(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" OFF) | ||
OPTION(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" OFF) | ||
OPTION(JSONCPP_WITH_WARNING_AS_ERROR "Force compilation to fail if a warning occurs" OFF) | ||
OPTION(JSONCPP_WITH_STRICT_ISO "Issue all the warnings demanded by strict ISO C and ISO C++" ON) | ||
OPTION(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" OFF) | ||
OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" OFF) | ||
OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF) | ||
OPTION(BUILD_STATIC_LIBS "Build jsoncpp_lib static library." ON) | ||
|
||
# Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix | ||
IF(NOT WIN32) | ||
IF(NOT CMAKE_BUILD_TYPE) | ||
SET(CMAKE_BUILD_TYPE Release CACHE STRING | ||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage." | ||
FORCE) | ||
ENDIF() | ||
ENDIF() | ||
|
||
SET(DEBUG_LIBNAME_SUFFIX "" CACHE STRING "Optional suffix to append to the library name for a debug build") | ||
SET(LIB_SUFFIX "" CACHE STRING "Optional arch-dependent suffix for the library installation directory") | ||
|
||
SET(RUNTIME_INSTALL_DIR bin | ||
CACHE PATH "Install dir for executables and dlls") | ||
SET(ARCHIVE_INSTALL_DIR lib${LIB_SUFFIX} | ||
CACHE PATH "Install dir for static libraries") | ||
SET(LIBRARY_INSTALL_DIR lib${LIB_SUFFIX} | ||
CACHE PATH "Install dir for shared libraries") | ||
SET(INCLUDE_INSTALL_DIR include | ||
CACHE PATH "Install dir for headers") | ||
SET(PACKAGE_INSTALL_DIR lib${LIB_SUFFIX}/cmake | ||
CACHE PATH "Install dir for cmake package config files") | ||
MARK_AS_ADVANCED( RUNTIME_INSTALL_DIR ARCHIVE_INSTALL_DIR INCLUDE_INSTALL_DIR PACKAGE_INSTALL_DIR ) | ||
|
||
# Set variable named ${VAR_NAME} to value ${VALUE} | ||
FUNCTION(set_using_dynamic_name VAR_NAME VALUE) | ||
SET( "${VAR_NAME}" "${VALUE}" PARENT_SCOPE) | ||
ENDFUNCTION() | ||
|
||
# Extract major, minor, patch from version text | ||
# Parse a version string "X.Y.Z" and outputs | ||
# version parts in ${OUPUT_PREFIX}_MAJOR, _MINOR, _PATCH. | ||
# If parse succeeds then ${OUPUT_PREFIX}_FOUND is TRUE. | ||
MACRO(jsoncpp_parse_version VERSION_TEXT OUPUT_PREFIX) | ||
SET(VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9_]+)?") | ||
IF( ${VERSION_TEXT} MATCHES ${VERSION_REGEX} ) | ||
STRING(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${VERSION_TEXT}) | ||
LIST(GET VERSION_PARTS 0 ${OUPUT_PREFIX}_MAJOR) | ||
LIST(GET VERSION_PARTS 1 ${OUPUT_PREFIX}_MINOR) | ||
LIST(GET VERSION_PARTS 2 ${OUPUT_PREFIX}_PATCH) | ||
set_using_dynamic_name( "${OUPUT_PREFIX}_FOUND" TRUE ) | ||
ELSE( ${VERSION_TEXT} MATCHES ${VERSION_REGEX} ) | ||
set_using_dynamic_name( "${OUPUT_PREFIX}_FOUND" FALSE ) | ||
ENDIF() | ||
ENDMACRO() | ||
|
||
# Read out version from "version" file | ||
#FILE(STRINGS "version" JSONCPP_VERSION) | ||
#SET( JSONCPP_VERSION_MAJOR X ) | ||
#SET( JSONCPP_VERSION_MINOR Y ) | ||
#SET( JSONCPP_VERSION_PATCH Z ) | ||
SET( JSONCPP_VERSION 1.7.4 ) | ||
jsoncpp_parse_version( ${JSONCPP_VERSION} JSONCPP_VERSION ) | ||
#IF(NOT JSONCPP_VERSION_FOUND) | ||
# MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z") | ||
#ENDIF(NOT JSONCPP_VERSION_FOUND) | ||
SET( JSONCPP_USE_SECURE_MEMORY "0" CACHE STRING "-D...=1 to use memory-wiping allocator for STL" ) | ||
|
||
MESSAGE(STATUS "JsonCpp Version: ${JSONCPP_VERSION_MAJOR}.${JSONCPP_VERSION_MINOR}.${JSONCPP_VERSION_PATCH}") | ||
# File version.h is only regenerated on CMake configure step | ||
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/src/lib_json/version.h.in" | ||
"${PROJECT_SOURCE_DIR}/include/json/version.h" | ||
NEWLINE_STYLE UNIX ) | ||
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/version.in" | ||
"${PROJECT_SOURCE_DIR}/version" | ||
NEWLINE_STYLE UNIX ) | ||
|
||
macro(UseCompilationWarningAsError) | ||
if ( MSVC ) | ||
# Only enabled in debug because some old versions of VS STL generate | ||
# warnings when compiled in release configuration. | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX ") | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") | ||
if (JSONCPP_WITH_STRICT_ISO) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors") | ||
endif () | ||
endif() | ||
endmacro() | ||
|
||
# Include our configuration header | ||
INCLUDE_DIRECTORIES( ${jsoncpp_SOURCE_DIR}/include ) | ||
|
||
if ( MSVC ) | ||
# Only enabled in debug because some old versions of VS STL generate | ||
# unreachable code warning when compiled in release configuration. | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4 ") | ||
endif() | ||
|
||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
# using regular Clang or AppleClang | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Werror=conversion -Werror=sign-compare") | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
# using GCC | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra") | ||
# not yet ready for -Wsign-conversion | ||
|
||
if (JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion -pedantic") | ||
endif () | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") | ||
# using Intel compiler | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra -Werror=conversion") | ||
|
||
if (JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") | ||
endif () | ||
endif() | ||
|
||
find_program(CCACHE_FOUND ccache) | ||
if(CCACHE_FOUND) | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) | ||
endif(CCACHE_FOUND) | ||
|
||
IF(JSONCPP_WITH_WARNING_AS_ERROR) | ||
UseCompilationWarningAsError() | ||
ENDIF() | ||
|
||
IF(JSONCPP_WITH_PKGCONFIG_SUPPORT) | ||
CONFIGURE_FILE( | ||
"pkg-config/jsoncpp.pc.in" | ||
"pkg-config/jsoncpp.pc" | ||
@ONLY) | ||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/pkg-config/jsoncpp.pc" | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") | ||
ENDIF() | ||
|
||
IF(JSONCPP_WITH_CMAKE_PACKAGE) | ||
INSTALL(EXPORT jsoncpp | ||
DESTINATION ${PACKAGE_INSTALL_DIR}/jsoncpp | ||
FILE jsoncppConfig.cmake) | ||
ENDIF() | ||
|
||
# Build the different applications | ||
ADD_SUBDIRECTORY( src ) | ||
|
||
#install the includes | ||
ADD_SUBDIRECTORY( include ) |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
The JsonCpp library's source code, including accompanying documentation, | ||
tests and demonstration applications, are licensed under the following | ||
conditions... | ||
|
||
The author (Baptiste Lepilleur) explicitly disclaims copyright in all | ||
jurisdictions which recognize such a disclaimer. In such jurisdictions, | ||
this software is released into the Public Domain. | ||
|
||
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of | ||
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is | ||
released under the terms of the MIT License (see below). | ||
|
||
In jurisdictions which recognize Public Domain property, the user of this | ||
software may choose to accept it either as 1) Public Domain, 2) under the | ||
conditions of the MIT License (see below), or 3) under the terms of dual | ||
Public Domain/MIT License conditions described here, as they choose. | ||
|
||
The MIT License is about as close to Public Domain as a license can get, and is | ||
described in clear, concise terms at: | ||
|
||
http://en.wikipedia.org/wiki/MIT_License | ||
|
||
The full text of the MIT License follows: | ||
|
||
======================================================================== | ||
Copyright (c) 2007-2010 Baptiste Lepilleur | ||
|
||
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. | ||
======================================================================== | ||
(END LICENSE TEXT) | ||
|
||
The MIT license is compatible with both the GPL and commercial | ||
software, affording one all of the rights of Public Domain with the | ||
minor nuisance of being required to keep the above copyright notice | ||
and license text in the source code. Note also that by accepting the | ||
Public Domain "license" you can re-license your copy using whatever | ||
license you like. |
Oops, something went wrong.