Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (47 sloc) 1.964 kb
7bf4398 @pibara Added LGPL comments to the code, added comment and made a few robustness...
authored
1 //JsonMe++ C++ JSON parsing (wrapper) library.
2 //Copyright (C) Rob J Meijer 2011 <jsonme@polacanthus.net>
3 //
4 //This library is free software; you can redistribute it and/or
5 //modify it under the terms of the GNU Lesser General Public
6 //License as published by the Free Software Foundation; either
7 //version 2.1 of the License, or (at your option) any later version.
8 //
9 //This library is distributed in the hope that it will be useful,
10 //but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 //Lesser General Public License for more details.
13 //
14 //You should have received a copy of the GNU Lesser General Public
15 //License along with this library; if not, write to the Free Software
16 //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
94baac2 @pibara Initial commit
authored
17 #include "json-me.hpp"
7bf4398 @pibara Added LGPL comments to the code, added comment and made a few robustness...
authored
18 //Curently the glib implementation is the only one implemented, so USE_GOBJECT_JSON_LIB better be defined.
94baac2 @pibara Initial commit
authored
19 #ifdef USE_GOBJECT_JSON_LIB
20 #define _JSON_LIB_DEFINED_
21 #include "gobj/impl.hpp"
22 namespace jsonme {
23 typedef jsonme::impl::GobjectLibImpl LibImpl;
24 }
25 #endif
7bf4398 @pibara Added LGPL comments to the code, added comment and made a few robustness...
authored
26 //Maybe we can create an second build for jsonme using an application based on boost::property_tree
27 //For now we don't have such an implementation yet.
94baac2 @pibara Initial commit
authored
28 #ifdef USE_BOOST_JSON_LIB
29 #error Boost implementation not yet implemented.
30 #endif
31 #ifndef _JSON_LIB_DEFINED_
32 #error low level lib undefined
33 #endif
34 namespace jsonme {
7bf4398 @pibara Added LGPL comments to the code, added comment and made a few robustness...
authored
35 //Constructor creates a wrapper for a dynamicaly allocated library implementation object.
94baac2 @pibara Initial commit
authored
36 JsonMeLib::JsonMeLib():mLibImpl(new LibImpl()) {}
7bf4398 @pibara Added LGPL comments to the code, added comment and made a few robustness...
authored
37 //Destructor
bdf02c4 @pibara Further cleanup of the API.
authored
38 JsonMeLib::~JsonMeLib() throw() {}
7bf4398 @pibara Added LGPL comments to the code, added comment and made a few robustness...
authored
39 //The pare method gets forwarded to the implementation.
26ffa58 @pibara Addressed constness issues in the API.
authored
40 Node JsonMeLib::parse(std::string const & jsonstring) const {
94baac2 @pibara Initial commit
authored
41 return mLibImpl->parse(jsonstring);
42 }
7bf4398 @pibara Added LGPL comments to the code, added comment and made a few robustness...
authored
43 //The parseFile gets forwarded to the implementation.
26ffa58 @pibara Addressed constness issues in the API.
authored
44 Node JsonMeLib::parseFile(std::string const & path) const {
94baac2 @pibara Initial commit
authored
45 return mLibImpl->parseFile( path);
46 }
47 }
48
Something went wrong with that request. Please try again.