Bundle jsoncpp with habitat-cpp-connector

pull/1/merge
Daniel Richman 2012-09-04 01:15:12 +01:00
rodzic ff9d343ebb
commit 9a7dbd8f6f
13 zmienionych plików z 6372 dodań i 30 usunięć

Wyświetl plik

@ -2,8 +2,7 @@
# -*- makefile -*-
# Copyright 2011 (C) Daniel Richman. License: GNU GPL 3; see LICENSE.
jsoncpp_cflags := $(shell pkg-config --cflags jsoncpp)
jsoncpp_libs := $(shell pkg-config --libs jsoncpp)
jsoncpp_cflags := -Ijsoncpp/
curl_cflags := $(shell pkg-config --cflags libcurl)
curl_libs := $(shell pkg-config --libs libcurl)
ssl_cflags := $(shell pkg-config --cflags openssl)
@ -12,7 +11,8 @@ ssl_libs := $(shell pkg-config --libs openssl)
CFLAGS = -pthread -O2 -Wall -Werror -pedantic -Wno-long-long \
-Wno-variadic-macros -Isrc \
$(jsoncpp_cflags) $(curl_cflags) $(ssl_cflags)
upl_libs = -pthread $(jsoncpp_libs) $(curl_libs) $(ssl_libs)
CFLAGS_JSONCPP = -pthread -O2 -Wall $(jsoncpp_cflags)
upl_libs = -pthread $(curl_libs) $(ssl_libs)
ext_libs = $(jsoncpp_libs)
rfc_libs = $(jsoncpp_libs)
@ -35,13 +35,17 @@ ext_binary = tests/extractor
ext_mock_cflags = -include tests/test_extractor_mocks.h
CXXFLAGS = $(CFLAGS)
upl_objects = $(patsubst %.cxx,%.o,$(upl_cxxfiles))
ext_objects = $(patsubst %.cxx,%.ext_mock.o,$(ext_cxxfiles))
rfc_objects = $(patsubst %.cxx,%.o,$(rfc_cxxfiles))
CXXFLAGS_JSONCPP = $(CFLAGS_JSONCPP)
upl_objects = jsoncpp/jsoncpp.o $(patsubst %.cxx,%.o,$(upl_cxxfiles))
ext_objects = jsoncpp/jsoncpp.o $(patsubst %.cxx,%.ext_mock.o,$(ext_cxxfiles))
rfc_objects = jsoncpp/jsoncpp.o $(patsubst %.cxx,%.o,$(rfc_cxxfiles))
%.o : %.cxx $(headers)
g++ -c $(CXXFLAGS) -o $@ $<
jsoncpp/jsoncpp.o : jsoncpp/jsoncpp.cpp jsoncpp/jsoncpp.h
g++ -c $(CXXFLAGS_JSONCPP) -o $@ $<
%.threaded.o : %.cxx $(headers)
g++ -c $(CXXFLAGS) $(upl_thr_cflags) -o $@ $<

Wyświetl plik

@ -1,25 +1,29 @@
habitat cpp uploader (see habitat.uploader.Uploader)
====================================================
License
-------
habitat-cpp-uploader is GNU GPL 3 (this excludes the bundled JsonCPP,
see below). The full GNU GPL 3 text can be found in LICENSE
Building dependencies
---------------------
You will need these dependencies:
- [JsonCpp](http://jsoncpp.sourceforge.net/)
- [libcURL](http://curl.haxx.se/)
- habitat (for habitat.utils.rfc3339, to test the Uploader.)
Both build from source fairly easily, but the easiest way to acquire them for
Ubuntu is:
You can build them from source or find install the libcurl4-openssl-dev package
on Debian based systems.
- [JsonCpp (PPA)](https://launchpad.net/~danieljonathanrichman/+archive/ppa)
for Ubuntu oneiric (11.10) and older
- [libjsoncpp-dev (apt)](http://packages.ubuntu.com/precise/libjsoncpp-dev)
- [libcurl4-openssl-dev (apt)](http://packages.ubuntu.com/precise/libcurl4-openssl-dev)
JsonCPP
-------
Or Debian:
- libjsoncpp-dev in wheezy and newer (the wheezy package also works fine on squeeze)
- libcurl4-openssl-dev
JsonCPP has an 'amalgamated' release where all the sources are combined into
two files, one jsoncpp.cpp and a json/json.h, which is renamed to jsoncpp.h
here to avoid conflicts with libjson's json.h.
It's in the jsoncpp/ directory of this repository. JsonCPP is Public Domain
or MIT License and full information can be found at jsoncpp/LICENSE

55
jsoncpp/LICENSE 100644
Wyświetl plik

@ -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.

4367
jsoncpp/jsoncpp.cpp 100644

Plik diff jest za duży Load Diff

1914
jsoncpp/jsoncpp.h 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -3,7 +3,7 @@
#ifndef HABITAT_COUCHDB_H
#define HABITAT_COUCHDB_H
#include <json/json.h>
#include <jsoncpp.h>
#include <string>
#include <iostream>
#include <deque>

Wyświetl plik

@ -4,7 +4,7 @@
#define HABITAT_EXTRACTOR_H
#include <vector>
#include <json/json.h>
#include <jsoncpp.h>
#include "UploaderThread.h"
#include "EZ.h"

Wyświetl plik

@ -1,7 +1,7 @@
/* Copyright 2011 (C) Daniel Richman. License: GNU GPL 3; see COPYING. */
#include "UKHASExtractor.h"
#include <json/json.h>
#include <jsoncpp.h>
#include <stdexcept>
#include <string>
#include <sstream>
@ -347,14 +347,12 @@ Json::Value UKHASExtractor::crude_parse()
if (!settings_ptr)
settings_ptr = &(Json::Value::null);
const Json::Value &settings = *settings_ptr;
if (!settings.isObject())
/* note: Json::Value::null.isObject() == true */
else if (!settings_ptr->isObject())
throw runtime_error("Invalid configuration: "
"settings is not an object");
const Json::Value &settings = *settings_ptr;
string data, checksum;
split_string(buffer, &data, &checksum);

Wyświetl plik

@ -7,7 +7,7 @@
#include <string>
#include <vector>
#include <stdexcept>
#include <json/json.h>
#include <jsoncpp.h>
#include "EZ.h"
#include "CouchDB.h"

Wyświetl plik

@ -6,7 +6,7 @@
#include "EZ.h"
#include "Uploader.h"
#include <memory>
#include <json/json.h>
#include <jsoncpp.h>
using namespace std;

Wyświetl plik

@ -2,7 +2,7 @@
#include <iostream>
#include <stdexcept>
#include <json/json.h>
#include <jsoncpp.h>
#include <memory>
#include "Extractor.h"

Wyświetl plik

@ -38,7 +38,7 @@ public:
#include <iostream>
#include <string>
#include <algorithm>
#include <json/json.h>
#include <jsoncpp.h>
namespace habitat {

Wyświetl plik

@ -2,7 +2,7 @@
#include <iostream>
#include <stdexcept>
#include <json/json.h>
#include <jsoncpp.h>
#include <ctime>
#include "RFC3339.h"