forked from nbsdx/SimpleJSON
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue nbsdx#4, add CMakeLists.txt
- Loading branch information
Showing
9 changed files
with
50 additions
and
16 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,17 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(SimpleJson) | ||
|
||
add_library(SimpleJSON json.cpp) | ||
|
||
foreach (example | ||
array | ||
init | ||
iter | ||
json | ||
load | ||
prim | ||
) | ||
add_executable(SimpleJson_${example}_example examples/${example}_example.cpp) | ||
target_link_libraries(SimpleJson_${example}_example SimpleJSON) | ||
endforeach() |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
#include "json.hpp" | ||
#include "../json.hpp" | ||
#include <iostream> | ||
|
||
using json::JSON; | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
#include "json.hpp" | ||
#include "../json.hpp" | ||
#include <iostream> | ||
#include <cstddef> | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
#include "json.hpp" | ||
#include "../json.hpp" | ||
#include <iostream> | ||
|
||
using json::JSON; | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
#include "json.hpp" | ||
#include "../json.hpp" | ||
#include <iostream> | ||
|
||
using json::JSON; | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
#include "json.hpp" | ||
#include "../json.hpp" | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
#include "json.hpp" | ||
#include "../json.hpp" | ||
#include <iostream> | ||
#include <ios> | ||
|
||
|
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,18 @@ | ||
#include "json.hpp" | ||
|
||
namespace json { | ||
JSON JSON::Load( const string &str ) { | ||
size_t offset = 0; | ||
return std::move( parse_next( str, offset ) ); | ||
} | ||
|
||
JSON Object() { | ||
return std::move( JSON::Make( JSON::Class::Object ) ); | ||
} | ||
|
||
std::ostream& operator<<( std::ostream &os, const JSON &json ) { | ||
os << json.dump(); | ||
return os; | ||
} | ||
|
||
} // namespace json |
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