Permalink
Browse files

Merge branch 'release-0.6.2'

  • Loading branch information...
2 parents 8b9f7ce + 6adff39 commit a6d8255e1ee33281e6ca317b122d9ac5af135a65 @samueldr samueldr committed May 22, 2015
Showing with 141 additions and 751 deletions.
  1. +11 −7 CMakeLists.txt
  2. +1 −1 Doxyfile
  3. +0 −2 include/JsonBox.h
  4. +0 −145 include/JsonBox/Array.h
  5. +2 −1 include/JsonBox/Convert.h
  6. +0 −138 include/JsonBox/Object.h
  7. +23 −51 include/JsonBox/Value.h
  8. +0 −199 src/Array.cpp
  9. +0 −191 src/Object.cpp
  10. +104 −16 src/Value.cpp
View
@@ -10,30 +10,25 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
set(JSONBOX_SOURCES
src/JsonWritingError.cpp
src/Value.cpp
- src/Array.cpp
src/SolidusEscaper.cpp
src/Escaper.cpp
src/Indenter.cpp
src/IndentCanceller.cpp
src/JsonParsingError.cpp
src/Convert.cpp
- src/Object.cpp
)
set(JSONBOX_HEADERS
- include/JsonBox/Array.h
include/JsonBox/Convert.h
include/JsonBox/Escaper.h
include/JsonBox/Grammar.h
include/JsonBox/IndentCanceller.h
include/JsonBox/Indenter.h
include/JsonBox/JsonParsingError.h
include/JsonBox/JsonWritingError.h
- include/JsonBox/Object.h
include/JsonBox/OutputFilter.h
include/JsonBox/SolidusEscaper.h
include/JsonBox/Value.h
include/JsonBox.h
- ${CMAKE_CURRENT_BINARY_DIR}/Export.h
)
# build library
@@ -55,6 +50,14 @@ export(TARGETS JsonBox
FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
)
+# Macro used to install headers while keeping the directory hierarchy.
+MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST)
+ FOREACH(HEADER ${${HEADER_LIST}})
+ STRING(REGEX MATCH "(.*)[/\\]" DIR ${HEADER})
+ INSTALL(FILES ${HEADER} COMPONENT dev DESTINATION ${DIR})
+ ENDFOREACH(HEADER)
+ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
+
# install
install(TARGETS JsonBox
COMPONENT lib
@@ -64,9 +67,10 @@ install(TARGETS JsonBox
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
-install(FILES ${JSONBOX_HEADERS}
+INSTALL_HEADERS_WITH_DIRECTORY(JSONBOX_HEADERS)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Export.h
COMPONENT dev
- DESTINATION include
+ DESTINATION include/JsonBox
)
install(EXPORT ${PROJECT_NAME}
DESTINATION lib${LIB_SUFFIX}/cmake
View
@@ -32,7 +32,7 @@ PROJECT_NAME = "Json Box"
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 0.6.1
+PROJECT_NUMBER = 0.6.2
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
View
@@ -25,7 +25,5 @@
*/
#include <JsonBox/Value.h>
-#include <JsonBox/Array.h>
-#include <JsonBox/Object.h>
#endif
@@ -1,145 +0,0 @@
-#ifndef JB_ARRAY_H
-#define JB_ARRAY_H
-
-#include <iostream>
-#include <vector>
-
-#include "Value.h"
-
-namespace JsonBox {
- JSONBOX_EXPORT std::ostream &operator<<(std::ostream &output, const Array &a);
-
- /**
- * Represents an array of values in JSON. It's a vector with added methods.
- * So it can be used the same way as a standard STL vector, but can be more
- * easily output in a stream.
- * @see JsonBox::Value
- */
- class JSONBOX_EXPORT Array {
- public:
- typedef std::vector<Value> container;
- typedef container::value_type value_type;
- typedef container::allocator_type allocator_type;
- typedef container::size_type size_type;
- typedef container::difference_type difference_type;
- typedef container::reference reference;
- typedef container::const_reference const_reference;
- typedef container::pointer pointer;
- typedef container::const_pointer const_pointer;
- typedef container::iterator iterator;
- typedef container::const_iterator const_iterator;
- typedef container::reverse_iterator reverse_iterator;
- typedef container::const_reverse_iterator const_reverse_iterator;
-
- Array(const allocator_type &alloc = allocator_type());
-
- explicit Array(size_type count, const_reference value = value_type(), const allocator_type &alloc = allocator_type());
-
- template <typename InputIterator>
- Array(InputIterator first, InputIterator last, const allocator_type &alloc = allocator_type()) : data(first, last) {
- }
-
- Array(const Array &other);
-
- Array &operator=(const Array &other);
-
- bool operator==(const Array &rhs) const;
-
- bool operator!=(const Array &rhs) const;
-
- bool operator<(const Array &rhs) const;
-
- bool operator<=(const Array &rhs) const;
-
- bool operator>(const Array &rhs) const;
-
- bool operator>=(const Array &rhs) const;
-
- void assign(size_type count, const_reference value);
-
- template <typename InputIterator>
- void assign(InputIterator first, InputIterator last) {
- data.assign(first, last);
- }
-
- allocator_type get_allocator() const;
-
- reference at(size_type pos);
-
- const_reference at(size_type pos) const;
-
- reference operator[](size_type pos);
-
- const_reference operator[](size_type pos) const;
-
- reference front();
-
- const_reference front() const;
-
- reference back();
-
- const_reference back() const;
-
- iterator begin();
-
- const_iterator begin() const;
-
- iterator end();
-
- const_iterator end() const;
-
- reverse_iterator rbegin();
-
- const_reverse_iterator rbegin() const;
-
- reverse_iterator rend();
-
- const_reverse_iterator rend() const;
-
- bool empty() const;
-
- size_type size() const;
-
- size_type max_size() const;
-
- void reserve(size_type size);
-
- size_type capacity() const;
-
- void clear();
-
- iterator insert(iterator pos, const_reference value);
-
- void insert(iterator pos, size_type count, const_reference value);
-
- template <typename InputIterator>
- void insert(iterator pos, InputIterator first, InputIterator last) {
- data.insert(pos, first, last);
- }
-
- iterator erase(iterator pos);
-
- iterator erase(iterator first, iterator last);
-
- void push_back(const_reference value);
-
- void pop_back();
-
- void resize(size_type count, const_reference value = value_type());
-
- void swap(Array &other);
- private:
- container data;
- };
-
- /**
- * Output operator overload for the JSON array. Outputs in standard JSON
- * format. Indents the output and esapes the minimum characters.
- * @param output Output stream in which to write the array's JSON.
- * @param a Array to output into the stream.
- * @return Output stream filled with the JSON code.
- */
- std::ostream &operator<<(std::ostream &output, const Array &a);
-}
-
-#endif
@@ -1,12 +1,13 @@
#ifndef JB_CONVERTER_H
#define JB_CONVERTER_H
+#include <vector>
#include <string>
#include <stdint.h>
namespace JsonBox {
- typedef std::basic_string<int32_t> String32;
+ typedef std::vector<int32_t> String32;
/**
* This class is used to encode/decode/transcode UTF8, 16 and 32.
@@ -1,138 +0,0 @@
-#ifndef JB_OBJECT_H
-#define JB_OBJECT_H
-
-#include <iostream>
-#include <map>
-#include <string>
-
-#include "Value.h"
-
-namespace JsonBox {
- JSONBOX_EXPORT std::ostream &operator<<(std::ostream& output, const Object& o);
-
- /**
- * Represents a JSON object. It's a map with added methods. So the JSON
- * object type can be used the same way as a standard STL map of string and
- * Value, but can be more easily output in a stream.
- * @see JsonBox::Value
- */
- class JSONBOX_EXPORT Object {
- public:
- typedef std::map<std::string, Value> container;
- typedef container::key_type key_type;
- typedef container::mapped_type mapped_type;
- typedef container::value_type value_type;
- typedef container::size_type size_type;
- typedef container::difference_type difference_type;
- typedef container::key_compare key_compare;
- typedef container::allocator_type allocator_type;
- typedef container::reference reference;
- typedef container::const_reference const_reference;
- typedef container::pointer pointer;
- typedef container::const_pointer const_pointer;
- typedef container::iterator iterator;
- typedef container::const_iterator const_iterator;
- typedef container::reverse_iterator reverse_iterator;
- typedef container::const_reverse_iterator const_reverse_iterator;
-
- explicit Object(const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type());
-
- template <typename InputIterator>
- explicit Object(InputIterator first, InputIterator last, const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type()) : data(first, last, comp, alloc) {
- }
-
- Object(const Object &other);
-
- Object &operator=(const Object &other);
-
- bool operator==(const Object &rhs) const;
-
- bool operator!=(const Object &rhs) const;
-
- bool operator<(const Object &rhs) const;
-
- bool operator<=(const Object &rhs) const;
-
- bool operator>(const Object &rhs) const;
-
- bool operator>=(const Object &rhs) const;
-
- allocator_type get_allocator() const;
-
- mapped_type &operator[](const key_type &key);
-
- iterator begin();
-
- const_iterator begin() const;
-
- iterator end();
-
- const_iterator end() const;
-
- reverse_iterator rbegin();
-
- const_reverse_iterator rbegin() const;
-
- reverse_iterator rend();
-
- const_reverse_iterator rend() const;
-
- bool empty() const;
-
- size_type size() const;
-
- size_type max_size() const;
-
- void clear();
-
- std::pair<iterator, bool> insert(const_reference value);
-
- iterator insert(iterator hint, const_reference value);
-
- template <typename InputIterator>
- void insert(InputIterator first, InputIterator last) {
- data.insert(first, last);
- }
-
- void erase(iterator position);
-
- void erase(iterator first, iterator last);
-
- size_type erase(const key_type &key);
-
- void swap(Object &other);
-
- size_type count(const key_type &key) const;
-
- iterator find(const key_type &key);
-
- const_iterator find(const key_type &key) const;
-
- std::pair<iterator, iterator> equal_range(const key_type &key);
-
- std::pair<const_iterator, const_iterator> equal_range(const key_type &key) const;
-
- iterator lower_bound(const key_type &key);
-
- const_iterator lower_bound(const key_type &key) const;
-
- iterator upper_bound(const key_type &key);
-
- const_iterator upper_bound(const key_type &key) const;
-
- key_compare key_comp() const;
- private:
- container data;
- };
-
- /**
- * Output operator overload for the JSON object. Outputs in standard JSON
- * format. Indents the output and escapes the minimum characters.
- * @param output Output stream in which to write the object's JSON.
- * @param o Object to output into the stream.
- * @return Output stream filled with the JSON code.
- */
- std::ostream& operator<<(std::ostream& output, const Object& o);
-}
-
-#endif
Oops, something went wrong.

0 comments on commit a6d8255

Please sign in to comment.