Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master a17c7e1bc -> fd280b5c4


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/include/rapidjson/stringbuffer.h
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/include/rapidjson/stringbuffer.h 
b/thirdparty/rapidjson-1.1.0/include/rapidjson/stringbuffer.h
new file mode 100644
index 0000000..78f34d2
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/include/rapidjson/stringbuffer.h
@@ -0,0 +1,117 @@
+// Tencent is pleased to support the open source community by making RapidJSON 
available.
+// 
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All 
rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file 
except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software 
distributed 
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the 
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_STRINGBUFFER_H_
+#define RAPIDJSON_STRINGBUFFER_H_
+
+#include "stream.h"
+#include "internal/stack.h"
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+#include <utility> // std::move
+#endif
+
+#include "internal/stack.h"
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(c++98-compat)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Represents an in-memory output stream.
+/*!
+    \tparam Encoding Encoding of the stream.
+    \tparam Allocator type for allocating memory buffer.
+    \note implements Stream concept
+*/
+template <typename Encoding, typename Allocator = CrtAllocator>
+class GenericStringBuffer {
+public:
+    typedef typename Encoding::Ch Ch;
+
+    GenericStringBuffer(Allocator* allocator = 0, size_t capacity = 
kDefaultCapacity) : stack_(allocator, capacity) {}
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+    GenericStringBuffer(GenericStringBuffer&& rhs) : 
stack_(std::move(rhs.stack_)) {}
+    GenericStringBuffer& operator=(GenericStringBuffer&& rhs) {
+        if (&rhs != this)
+            stack_ = std::move(rhs.stack_);
+        return *this;
+    }
+#endif
+
+    void Put(Ch c) { *stack_.template Push<Ch>() = c; }
+    void PutUnsafe(Ch c) { *stack_.template PushUnsafe<Ch>() = c; }
+    void Flush() {}
+
+    void Clear() { stack_.Clear(); }
+    void ShrinkToFit() {
+        // Push and pop a null terminator. This is safe.
+        *stack_.template Push<Ch>() = '\0';
+        stack_.ShrinkToFit();
+        stack_.template Pop<Ch>(1);
+    }
+
+    void Reserve(size_t count) { stack_.template Reserve<Ch>(count); }
+    Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
+    Ch* PushUnsafe(size_t count) { return stack_.template 
PushUnsafe<Ch>(count); }
+    void Pop(size_t count) { stack_.template Pop<Ch>(count); }
+
+    const Ch* GetString() const {
+        // Push and pop a null terminator. This is safe.
+        *stack_.template Push<Ch>() = '\0';
+        stack_.template Pop<Ch>(1);
+
+        return stack_.template Bottom<Ch>();
+    }
+
+    size_t GetSize() const { return stack_.GetSize(); }
+
+    static const size_t kDefaultCapacity = 256;
+    mutable internal::Stack<Allocator> stack_;
+
+private:
+    // Prohibit copy constructor & assignment operator.
+    GenericStringBuffer(const GenericStringBuffer&);
+    GenericStringBuffer& operator=(const GenericStringBuffer&);
+};
+
+//! String buffer with UTF8 encoding
+typedef GenericStringBuffer<UTF8<> > StringBuffer;
+
+template<typename Encoding, typename Allocator>
+inline void PutReserve(GenericStringBuffer<Encoding, Allocator>& stream, 
size_t count) {
+    stream.Reserve(count);
+}
+
+template<typename Encoding, typename Allocator>
+inline void PutUnsafe(GenericStringBuffer<Encoding, Allocator>& stream, 
typename Encoding::Ch c) {
+    stream.PutUnsafe(c);
+}
+
+//! Implement specialized version of PutN() with memset() for better 
performance.
+template<>
+inline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {
+    std::memset(stream.stack_.Push<char>(n), c, n * sizeof(c));
+}
+
+RAPIDJSON_NAMESPACE_END
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_STRINGBUFFER_H_

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/include/rapidjson/writer.h
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/include/rapidjson/writer.h 
b/thirdparty/rapidjson-1.1.0/include/rapidjson/writer.h
new file mode 100644
index 0000000..94f22dd
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/include/rapidjson/writer.h
@@ -0,0 +1,610 @@
+// Tencent is pleased to support the open source community by making RapidJSON 
available.
+// 
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All 
rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file 
except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software 
distributed 
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the 
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_WRITER_H_
+#define RAPIDJSON_WRITER_H_
+
+#include "stream.h"
+#include "internal/stack.h"
+#include "internal/strfunc.h"
+#include "internal/dtoa.h"
+#include "internal/itoa.h"
+#include "stringbuffer.h"
+#include <new>      // placement new
+
+#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
+#include <intrin.h>
+#pragma intrinsic(_BitScanForward)
+#endif
+#ifdef RAPIDJSON_SSE42
+#include <nmmintrin.h>
+#elif defined(RAPIDJSON_SSE2)
+#include <emmintrin.h>
+#endif
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+RAPIDJSON_DIAG_OFF(unreachable-code)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// WriteFlag
+
+/*! \def RAPIDJSON_WRITE_DEFAULT_FLAGS 
+    \ingroup RAPIDJSON_CONFIG
+    \brief User-defined kWriteDefaultFlags definition.
+
+    User can define this as any \c WriteFlag combinations.
+*/
+#ifndef RAPIDJSON_WRITE_DEFAULT_FLAGS
+#define RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags
+#endif
+
+//! Combination of writeFlags
+enum WriteFlag {
+    kWriteNoFlags = 0,              //!< No flags are set.
+    kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings.
+    kWriteNanAndInfFlag = 2,        //!< Allow writing of Infinity, -Infinity 
and NaN.
+    kWriteDefaultFlags = RAPIDJSON_WRITE_DEFAULT_FLAGS  //!< Default write 
flags. Can be customized by defining RAPIDJSON_WRITE_DEFAULT_FLAGS
+};
+
+//! JSON writer
+/*! Writer implements the concept Handler.
+    It generates JSON text by events to an output os.
+
+    User may programmatically calls the functions of a writer to generate JSON 
text.
+
+    On the other side, a writer can also be passed to objects that generates 
events, 
+
+    for example Reader::Parse() and Document::Accept().
+
+    \tparam OutputStream Type of output stream.
+    \tparam SourceEncoding Encoding of source string.
+    \tparam TargetEncoding Encoding of output stream.
+    \tparam StackAllocator Type of allocator for allocating memory of stack.
+    \note implements Handler concept
+*/
+template<typename OutputStream, typename SourceEncoding = UTF8<>, typename 
TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned 
writeFlags = kWriteDefaultFlags>
+class Writer {
+public:
+    typedef typename SourceEncoding::Ch Ch;
+
+    static const int kDefaultMaxDecimalPlaces = 324;
+
+    //! Constructor
+    /*! \param os Output stream.
+        \param stackAllocator User supplied allocator. If it is null, it will 
create a private one.
+        \param levelDepth Initial capacity of stack.
+    */
+    explicit
+    Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t 
levelDepth = kDefaultLevelDepth) : 
+        os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), 
maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
+
+    explicit
+    Writer(StackAllocator* allocator = 0, size_t levelDepth = 
kDefaultLevelDepth) :
+        os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), 
maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
+
+    //! Reset the writer with a new stream.
+    /*!
+        This function reset the writer with a new stream and default settings,
+        in order to make a Writer object reusable for output multiple JSONs.
+
+        \param os New output stream.
+        \code
+        Writer<OutputStream> writer(os1);
+        writer.StartObject();
+        // ...
+        writer.EndObject();
+
+        writer.Reset(os2);
+        writer.StartObject();
+        // ...
+        writer.EndObject();
+        \endcode
+    */
+    void Reset(OutputStream& os) {
+        os_ = &os;
+        hasRoot_ = false;
+        level_stack_.Clear();
+    }
+
+    //! Checks whether the output is a complete JSON.
+    /*!
+        A complete JSON has a complete root object or array.
+    */
+    bool IsComplete() const {
+        return hasRoot_ && level_stack_.Empty();
+    }
+
+    int GetMaxDecimalPlaces() const {
+        return maxDecimalPlaces_;
+    }
+
+    //! Sets the maximum number of decimal places for double output.
+    /*!
+        This setting truncates the output with specified number of decimal 
places.
+
+        For example, 
+
+        \code
+        writer.SetMaxDecimalPlaces(3);
+        writer.StartArray();
+        writer.Double(0.12345);                 // "0.123"
+        writer.Double(0.0001);                  // "0.0"
+        writer.Double(1.234567890123456e30);    // "1.234567890123456e30" (do 
not truncate significand for positive exponent)
+        writer.Double(1.23e-4);                 // "0.0"                  (do 
truncate significand for negative exponent)
+        writer.EndArray();
+        \endcode
+
+        The default setting does not truncate any decimal places. You can 
restore to this setting by calling
+        \code
+        writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces);
+        \endcode
+    */
+    void SetMaxDecimalPlaces(int maxDecimalPlaces) {
+        maxDecimalPlaces_ = maxDecimalPlaces;
+    }
+
+    /*!@name Implementation of Handler
+        \see Handler
+    */
+    //@{
+
+    bool Null()                 { Prefix(kNullType);   return 
EndValue(WriteNull()); }
+    bool Bool(bool b)           { Prefix(b ? kTrueType : kFalseType); return 
EndValue(WriteBool(b)); }
+    bool Int(int i)             { Prefix(kNumberType); return 
EndValue(WriteInt(i)); }
+    bool Uint(unsigned u)       { Prefix(kNumberType); return 
EndValue(WriteUint(u)); }
+    bool Int64(int64_t i64)     { Prefix(kNumberType); return 
EndValue(WriteInt64(i64)); }
+    bool Uint64(uint64_t u64)   { Prefix(kNumberType); return 
EndValue(WriteUint64(u64)); }
+
+    //! Writes the given \c double value to the stream
+    /*!
+        \param d The value to be written.
+        \return Whether it is succeed.
+    */
+    bool Double(double d)       { Prefix(kNumberType); return 
EndValue(WriteDouble(d)); }
+
+    bool RawNumber(const Ch* str, SizeType length, bool copy = false) {
+        (void)copy;
+        Prefix(kNumberType);
+        return EndValue(WriteString(str, length));
+    }
+
+    bool String(const Ch* str, SizeType length, bool copy = false) {
+        (void)copy;
+        Prefix(kStringType);
+        return EndValue(WriteString(str, length));
+    }
+
+#if RAPIDJSON_HAS_STDSTRING
+    bool String(const std::basic_string<Ch>& str) {
+        return String(str.data(), SizeType(str.size()));
+    }
+#endif
+
+    bool StartObject() {
+        Prefix(kObjectType);
+        new (level_stack_.template Push<Level>()) Level(false);
+        return WriteStartObject();
+    }
+
+    bool Key(const Ch* str, SizeType length, bool copy = false) { return 
String(str, length, copy); }
+
+    bool EndObject(SizeType memberCount = 0) {
+        (void)memberCount;
+        RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));
+        RAPIDJSON_ASSERT(!level_stack_.template Top<Level>()->inArray);
+        level_stack_.template Pop<Level>(1);
+        return EndValue(WriteEndObject());
+    }
+
+    bool StartArray() {
+        Prefix(kArrayType);
+        new (level_stack_.template Push<Level>()) Level(true);
+        return WriteStartArray();
+    }
+
+    bool EndArray(SizeType elementCount = 0) {
+        (void)elementCount;
+        RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));
+        RAPIDJSON_ASSERT(level_stack_.template Top<Level>()->inArray);
+        level_stack_.template Pop<Level>(1);
+        return EndValue(WriteEndArray());
+    }
+    //@}
+
+    /*! @name Convenience extensions */
+    //@{
+
+    //! Simpler but slower overload.
+    bool String(const Ch* str) { return String(str, internal::StrLen(str)); }
+    bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); }
+
+    //@}
+
+    //! Write a raw JSON value.
+    /*!
+        For user to write a stringified JSON as a value.
+
+        \param json A well-formed JSON value. It should not contain null 
character within [0, length - 1] range.
+        \param length Length of the json.
+        \param type Type of the root of json.
+    */
+    bool RawValue(const Ch* json, size_t length, Type type) { Prefix(type); 
return EndValue(WriteRawValue(json, length)); }
+
+protected:
+    //! Information for each nested level
+    struct Level {
+        Level(bool inArray_) : valueCount(0), inArray(inArray_) {}
+        size_t valueCount;  //!< number of values in this level
+        bool inArray;       //!< true if in array, otherwise in object
+    };
+
+    static const size_t kDefaultLevelDepth = 32;
+
+    bool WriteNull()  {
+        PutReserve(*os_, 4);
+        PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); 
PutUnsafe(*os_, 'l'); return true;
+    }
+
+    bool WriteBool(bool b)  {
+        if (b) {
+            PutReserve(*os_, 4);
+            PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); 
PutUnsafe(*os_, 'e');
+        }
+        else {
+            PutReserve(*os_, 5);
+            PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); 
PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e');
+        }
+        return true;
+    }
+
+    bool WriteInt(int i) {
+        char buffer[11];
+        const char* end = internal::i32toa(i, buffer);
+        PutReserve(*os_, static_cast<size_t>(end - buffer));
+        for (const char* p = buffer; p != end; ++p)
+            PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+        return true;
+    }
+
+    bool WriteUint(unsigned u) {
+        char buffer[10];
+        const char* end = internal::u32toa(u, buffer);
+        PutReserve(*os_, static_cast<size_t>(end - buffer));
+        for (const char* p = buffer; p != end; ++p)
+            PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+        return true;
+    }
+
+    bool WriteInt64(int64_t i64) {
+        char buffer[21];
+        const char* end = internal::i64toa(i64, buffer);
+        PutReserve(*os_, static_cast<size_t>(end - buffer));
+        for (const char* p = buffer; p != end; ++p)
+            PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+        return true;
+    }
+
+    bool WriteUint64(uint64_t u64) {
+        char buffer[20];
+        char* end = internal::u64toa(u64, buffer);
+        PutReserve(*os_, static_cast<size_t>(end - buffer));
+        for (char* p = buffer; p != end; ++p)
+            PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+        return true;
+    }
+
+    bool WriteDouble(double d) {
+        if (internal::Double(d).IsNanOrInf()) {
+            if (!(writeFlags & kWriteNanAndInfFlag))
+                return false;
+            if (internal::Double(d).IsNan()) {
+                PutReserve(*os_, 3);
+                PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 
'N');
+                return true;
+            }
+            if (internal::Double(d).Sign()) {
+                PutReserve(*os_, 9);
+                PutUnsafe(*os_, '-');
+            }
+            else
+                PutReserve(*os_, 8);
+            PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f');
+            PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); 
PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y');
+            return true;
+        }
+
+        char buffer[25];
+        char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
+        PutReserve(*os_, static_cast<size_t>(end - buffer));
+        for (char* p = buffer; p != end; ++p)
+            PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+        return true;
+    }
+
+    bool WriteString(const Ch* str, SizeType length)  {
+        static const typename TargetEncoding::Ch hexDigits[16] = { '0', '1', 
'2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+        static const char escape[256] = {
+#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+            //0    1    2    3    4    5    6    7    8    9    A    B    C    
D    E    F
+            'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 
'r', 'u', 'u', // 00
+            'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 
'u', 'u', 'u', // 10
+              0,   0, '"',   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   
0,   0,   0, // 20
+            Z16, Z16,                                                          
             // 30~4F
+              0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,'\\',   
0,   0,   0, // 50
+            Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16                   
             // 60~FF
+#undef Z16
+        };
+
+        if (TargetEncoding::supportUnicode)
+            PutReserve(*os_, 2 + length * 6); // "\uxxxx..."
+        else
+            PutReserve(*os_, 2 + length * 12);  // "\uxxxx\uyyyy..."
+
+        PutUnsafe(*os_, '\"');
+        GenericStringStream<SourceEncoding> is(str);
+        while (ScanWriteUnescapedString(is, length)) {
+            const Ch c = is.Peek();
+            if (!TargetEncoding::supportUnicode && static_cast<unsigned>(c) >= 
0x80) {
+                // Unicode escaping
+                unsigned codepoint;
+                if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, 
&codepoint)))
+                    return false;
+                PutUnsafe(*os_, '\\');
+                PutUnsafe(*os_, 'u');
+                if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint 
<= 0xFFFF)) {
+                    PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]);
+                    PutUnsafe(*os_, hexDigits[(codepoint >>  8) & 15]);
+                    PutUnsafe(*os_, hexDigits[(codepoint >>  4) & 15]);
+                    PutUnsafe(*os_, hexDigits[(codepoint      ) & 15]);
+                }
+                else {
+                    RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 
0x10FFFF);
+                    // Surrogate pair
+                    unsigned s = codepoint - 0x010000;
+                    unsigned lead = (s >> 10) + 0xD800;
+                    unsigned trail = (s & 0x3FF) + 0xDC00;
+                    PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]);
+                    PutUnsafe(*os_, hexDigits[(lead >>  8) & 15]);
+                    PutUnsafe(*os_, hexDigits[(lead >>  4) & 15]);
+                    PutUnsafe(*os_, hexDigits[(lead      ) & 15]);
+                    PutUnsafe(*os_, '\\');
+                    PutUnsafe(*os_, 'u');
+                    PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]);
+                    PutUnsafe(*os_, hexDigits[(trail >>  8) & 15]);
+                    PutUnsafe(*os_, hexDigits[(trail >>  4) & 15]);
+                    PutUnsafe(*os_, hexDigits[(trail      ) & 15]);            
        
+                }
+            }
+            else if ((sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256) && 
RAPIDJSON_UNLIKELY(escape[static_cast<unsigned char>(c)]))  {
+                is.Take();
+                PutUnsafe(*os_, '\\');
+                PutUnsafe(*os_, static_cast<typename 
TargetEncoding::Ch>(escape[static_cast<unsigned char>(c)]));
+                if (escape[static_cast<unsigned char>(c)] == 'u') {
+                    PutUnsafe(*os_, '0');
+                    PutUnsafe(*os_, '0');
+                    PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) >> 
4]);
+                    PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) & 
0xF]);
+                }
+            }
+            else if (RAPIDJSON_UNLIKELY(!(writeFlags & 
kWriteValidateEncodingFlag ? 
+                Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) 
:
+                Transcoder<SourceEncoding, 
TargetEncoding>::TranscodeUnsafe(is, *os_))))
+                return false;
+        }
+        PutUnsafe(*os_, '\"');
+        return true;
+    }
+
+    bool ScanWriteUnescapedString(GenericStringStream<SourceEncoding>& is, 
size_t length) {
+        return RAPIDJSON_LIKELY(is.Tell() < length);
+    }
+
+    bool WriteStartObject() { os_->Put('{'); return true; }
+    bool WriteEndObject()   { os_->Put('}'); return true; }
+    bool WriteStartArray()  { os_->Put('['); return true; }
+    bool WriteEndArray()    { os_->Put(']'); return true; }
+
+    bool WriteRawValue(const Ch* json, size_t length) {
+        PutReserve(*os_, length);
+        for (size_t i = 0; i < length; i++) {
+            RAPIDJSON_ASSERT(json[i] != '\0');
+            PutUnsafe(*os_, json[i]);
+        }
+        return true;
+    }
+
+    void Prefix(Type type) {
+        (void)type;
+        if (RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is 
not at root
+            Level* level = level_stack_.template Top<Level>();
+            if (level->valueCount > 0) {
+                if (level->inArray) 
+                    os_->Put(','); // add comma if it is not the first element 
in array
+                else  // in object
+                    os_->Put((level->valueCount % 2 == 0) ? ',' : ':');
+            }
+            if (!level->inArray && level->valueCount % 2 == 0)
+                RAPIDJSON_ASSERT(type == kStringType);  // if it's in object, 
then even number should be a name
+            level->valueCount++;
+        }
+        else {
+            RAPIDJSON_ASSERT(!hasRoot_);    // Should only has one and only 
one root.
+            hasRoot_ = true;
+        }
+    }
+
+    // Flush the value if it is the top level one.
+    bool EndValue(bool ret) {
+        if (RAPIDJSON_UNLIKELY(level_stack_.Empty()))   // end of json text
+            os_->Flush();
+        return ret;
+    }
+
+    OutputStream* os_;
+    internal::Stack<StackAllocator> level_stack_;
+    int maxDecimalPlaces_;
+    bool hasRoot_;
+
+private:
+    // Prohibit copy constructor & assignment operator.
+    Writer(const Writer&);
+    Writer& operator=(const Writer&);
+};
+
+// Full specialization for StringStream to prevent memory copying
+
+template<>
+inline bool Writer<StringBuffer>::WriteInt(int i) {
+    char *buffer = os_->Push(11);
+    const char* end = internal::i32toa(i, buffer);
+    os_->Pop(static_cast<size_t>(11 - (end - buffer)));
+    return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteUint(unsigned u) {
+    char *buffer = os_->Push(10);
+    const char* end = internal::u32toa(u, buffer);
+    os_->Pop(static_cast<size_t>(10 - (end - buffer)));
+    return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteInt64(int64_t i64) {
+    char *buffer = os_->Push(21);
+    const char* end = internal::i64toa(i64, buffer);
+    os_->Pop(static_cast<size_t>(21 - (end - buffer)));
+    return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteUint64(uint64_t u) {
+    char *buffer = os_->Push(20);
+    const char* end = internal::u64toa(u, buffer);
+    os_->Pop(static_cast<size_t>(20 - (end - buffer)));
+    return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteDouble(double d) {
+    if (internal::Double(d).IsNanOrInf()) {
+        // Note: This code path can only be reached if 
(RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag).
+        if (!(kWriteDefaultFlags & kWriteNanAndInfFlag))
+            return false;
+        if (internal::Double(d).IsNan()) {
+            PutReserve(*os_, 3);
+            PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N');
+            return true;
+        }
+        if (internal::Double(d).Sign()) {
+            PutReserve(*os_, 9);
+            PutUnsafe(*os_, '-');
+        }
+        else
+            PutReserve(*os_, 8);
+        PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f');
+        PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); 
PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y');
+        return true;
+    }
+    
+    char *buffer = os_->Push(25);
+    char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
+    os_->Pop(static_cast<size_t>(25 - (end - buffer)));
+    return true;
+}
+
+#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
+template<>
+inline bool Writer<StringBuffer>::ScanWriteUnescapedString(StringStream& is, 
size_t length) {
+    if (length < 16)
+        return RAPIDJSON_LIKELY(is.Tell() < length);
+
+    if (!RAPIDJSON_LIKELY(is.Tell() < length))
+        return false;
+
+    const char* p = is.src_;
+    const char* end = is.head_ + length;
+    const char* nextAligned = reinterpret_cast<const 
char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
+    const char* endAligned = reinterpret_cast<const 
char*>(reinterpret_cast<size_t>(end) & static_cast<size_t>(~15));
+    if (nextAligned > end)
+        return true;
+
+    while (p != nextAligned)
+        if (*p < 0x20 || *p == '\"' || *p == '\\') {
+            is.src_ = p;
+            return RAPIDJSON_LIKELY(is.Tell() < length);
+        }
+        else
+            os_->PutUnsafe(*p++);
+
+    // The rest of string using SIMD
+    static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', 
'\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
+    static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', 
'\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
+    static const char space[16]  = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 
0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 };
+    const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i 
*>(&dquote[0]));
+    const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i 
*>(&bslash[0]));
+    const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i 
*>(&space[0]));
+
+    for (; p != endAligned; p += 16) {
+        const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
+        const __m128i t1 = _mm_cmpeq_epi8(s, dq);
+        const __m128i t2 = _mm_cmpeq_epi8(s, bs);
+        const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 
0x20 <=> max(s, 0x19) == 0x19
+        const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
+        unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
+        if (RAPIDJSON_UNLIKELY(r != 0)) {   // some of characters is escaped
+            SizeType len;
+#ifdef _MSC_VER         // Find the index of first escaped
+            unsigned long offset;
+            _BitScanForward(&offset, r);
+            len = offset;
+#else
+            len = static_cast<SizeType>(__builtin_ffs(r) - 1);
+#endif
+            char* q = reinterpret_cast<char*>(os_->PushUnsafe(len));
+            for (size_t i = 0; i < len; i++)
+                q[i] = p[i];
+
+            p += len;
+            break;
+        }
+        _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s);
+    }
+
+    is.src_ = p;
+    return RAPIDJSON_LIKELY(is.Tell() < length);
+}
+#endif // defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_RAPIDJSON_H_

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/include_dirs.js
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/include_dirs.js 
b/thirdparty/rapidjson-1.1.0/include_dirs.js
new file mode 100644
index 0000000..b373e85
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/include_dirs.js
@@ -0,0 +1,2 @@
+var path = require('path');
+console.log(path.join(path.relative('.', __dirname), 'include'));

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/library.json
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/library.json 
b/thirdparty/rapidjson-1.1.0/library.json
new file mode 100644
index 0000000..47fd352
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/library.json
@@ -0,0 +1,12 @@
+{
+  "name": "RapidJSON",
+  "keywords": "json, sax, dom, parser, generator",
+  "description": "A fast JSON parser/generator for C++ with both SAX/DOM style 
API",
+  "include": "include",
+  "examples": "example/*/*.cpp",
+  "repository":
+  {
+    "type": "git",
+    "url": "https://github.com/miloyip/rapidjson";
+  }
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/license.txt
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/license.txt 
b/thirdparty/rapidjson-1.1.0/license.txt
new file mode 100644
index 0000000..7ccc161
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/license.txt
@@ -0,0 +1,57 @@
+Tencent is pleased to support the open source community by making RapidJSON 
available. 
+ 
+Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.  All 
rights reserved.
+
+If you have downloaded a copy of the RapidJSON binary from Tencent, please 
note that the RapidJSON binary is licensed under the MIT License.
+If you have downloaded a copy of the RapidJSON source code from Tencent, 
please note that RapidJSON source code is licensed under the MIT License, 
except for the third-party components listed below which are subject to 
different license terms.  Your integration of RapidJSON into your own projects 
may require compliance with the MIT License, as well as the other licenses 
applicable to the third-party components included within RapidJSON. To avoid 
the problematic JSON license in your own projects, it's sufficient to exclude 
the bin/jsonchecker/ directory, as it's the only code under the JSON license.
+A copy of the MIT License is included in this file.
+
+Other dependencies and licenses:
+
+Open Source Software Licensed Under the BSD License:
+--------------------------------------------------------------------
+
+The msinttypes r29 
+Copyright (c) 2006-2013 Alexander Chemeris 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer. 
+* Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following disclaimer in the documentation 
and/or other materials provided with the distribution.
+* Neither the name of  copyright holder nor the names of its contributors may 
be used to endorse or promote products derived from this software without 
specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Open Source Software Licensed Under the JSON License:
+--------------------------------------------------------------------
+
+json.org 
+Copyright (c) 2002 JSON.org
+All Rights Reserved.
+
+JSON_checker
+Copyright (c) 2002 JSON.org
+All Rights Reserved.
+
+       
+Terms of the JSON License:
+---------------------------------------------------
+
+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 shall be used for Good, not Evil.
+
+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.
+
+
+Terms of the MIT License:
+--------------------------------------------------------------------
+
+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.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/package.json
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/package.json 
b/thirdparty/rapidjson-1.1.0/package.json
new file mode 100644
index 0000000..cc6087a
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/package.json
@@ -0,0 +1,24 @@
+{
+  "name": "rapidjson",
+  "version": "1.0.4",
+  "description": "![](doc/logo/rapidjson.png)",
+  "main": "include_dirs.js",
+  "directories": {
+    "doc": "doc",
+    "example": "example",
+    "test": "test"
+  },
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/miloyip/rapidjson.git";
+  },
+  "author": "",
+  "license": "ISC",
+  "bugs": {
+    "url": "https://github.com/miloyip/rapidjson/issues";
+  },
+  "homepage": "https://github.com/miloyip/rapidjson#readme";
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/rapidjson.autopkg
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/rapidjson.autopkg 
b/thirdparty/rapidjson-1.1.0/rapidjson.autopkg
new file mode 100644
index 0000000..70eb0d8
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/rapidjson.autopkg
@@ -0,0 +1,75 @@
+nuget {
+       //Usage:  Write-NuGetPackage rapidjson.autopkg -defines:MYVERSION=1.1.0
+       //Be sure you are running Powershell 3.0 and have the CoApp powershell 
extensions installed properly.
+       nuspec {
+               id = rapidjson;
+               version : ${MYVERSION};
+               title: "rapidjson";
+               authors: 
{"https://github.com/miloyip/rapidjson/releases/tag/v1.1.0"};
+               owners: {"@lsantos (github)"};
+               licenseUrl: 
"https://github.com/miloyip/rapidjson/blob/master/license.txt";;
+               projectUrl: "https://github.com/miloyip/rapidjson/";;
+               iconUrl: 
"https://cdn1.iconfinder.com/data/icons/fatcow/32x32/json.png";;
+               requireLicenseAcceptance:false;
+               summary: @"A fast JSON parser/generator for C++ with both 
SAX/DOM style API";
+               
+               // if you need to span several lines you can prefix a string 
with an @ symbol (exactly like c# does).
+               description: @"Rapidjson is an attempt to create the fastest 
JSON parser and generator.
+
+              - Small but complete. Supports both SAX and DOM style API. SAX 
parser only a few hundred lines of code.
+              - Fast. In the order of magnitude of strlen(). Optionally 
supports SSE2/SSE4.2 for acceleration.
+              - Self-contained. Minimal dependency on standard libraries. No 
BOOST, not even STL.
+              - Compact. Each JSON value is 16 or 20 bytes for 32 or 64-bit 
machines respectively (excluding text string storage). With the custom memory 
allocator, parser allocates memory compactly during parsing.
+              - Full  RFC4627 compliance. Supports UTF-8, UTF-16 and UTF-32.
+              - Support both in-situ parsing (directly decode strings into the 
source JSON text) and non-destructive parsing (decode strings into new buffers).
+              - Parse number to int/unsigned/int64_t/uint64_t/double depending 
on input
+              - Support custom memory allocation. Also, the default memory 
pool allocator can also be supplied with a user buffer (such as a buffer 
allocated on user's heap or - programme stack) to minimize allocation.
+
+              As the name implies, rapidjson is inspired by rapidxml.";
+               
+               releaseNotes: @"
+Added
+       Add Value::XXXMember(...) overloads for std::string (#335)
+
+Fixed
+       Include rapidjson.h for all internal/error headers.
+       Parsing some numbers incorrectly in full-precision mode 
(kFullPrecisionParseFlag) (#342)
+       Fix alignment of 64bit platforms (#328)
+       Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502)
+
+Changed
+       CMakeLists for include as a thirdparty in projects (#334, #337)
+       Change Document::ParseStream() to use stack allocator for Reader 
(ffbe386)";
+
+               copyright: "Copyright 2015";
+               tags: { native, coapp, JSON, nativepackage };
+               language: en-US;
+       };
+       
+       dependencies {
+               packages : {
+                       //TODO:  Add dependecies here in [pkg.name]/[version] 
form per newline          
+                       //zlib/[1.2.8],                 
+               };
+       }
+       
+       // the files that go into the content folders
+       files { 
+               #defines {
+                       SDK_ROOT         = .\;                  
+               }
+
+               // grab all the files in the include folder
+               // the folder that contains all the .h files will 
+               // automatically get added to the Includes path.
+               nestedinclude += {
+                       #destination = ${d_include}rapidjson;
+                       "${SDK_ROOT}include\rapidjson\**\*.h"
+               };
+       };
+       
+       targets {
+               // We're trying to be standard about these sorts of thing. 
(Will help with config.h later :D)
+               //Defines += HAS_EQCORE;
+       };
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/readme.md
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/readme.md 
b/thirdparty/rapidjson-1.1.0/readme.md
new file mode 100644
index 0000000..4a1d64d
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/readme.md
@@ -0,0 +1,160 @@
+![](doc/logo/rapidjson.png)
+
+![](https://img.shields.io/badge/release-v1.1.0-blue.png)
+
+## A fast JSON parser/generator for C++ with both SAX/DOM style API 
+
+Tencent is pleased to support the open source community by making RapidJSON 
available.
+
+Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All 
rights reserved.
+
+* [RapidJSON GitHub](https://github.com/miloyip/rapidjson/)
+* RapidJSON Documentation
+  * [English](http://rapidjson.org/)
+  * [简体中文](http://rapidjson.org/zh-cn/)
+  * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/) with 
downloadable PDF/EPUB/MOBI, without API reference.
+
+## Build status
+
+| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] |
+| :---------------: | :-----------------: | :-------------------: |
+| ![lin-badge]      | ![win-badge]        | ![cov-badge]          |
+
+[lin-badge]: https://travis-ci.org/miloyip/rapidjson.png?branch=master "Travis 
build status"
+[lin-link]:  https://travis-ci.org/miloyip/rapidjson "Travis build status"
+[win-badge]: 
https://ci.appveyor.com/api/projects/status/u658dcuwxo14a8m9/branch/master 
"AppVeyor build status"
+[win-link]:  https://ci.appveyor.com/project/miloyip/rapidjson/branch/master 
"AppVeyor build status"
+[cov-badge]: 
https://coveralls.io/repos/miloyip/rapidjson/badge.png?branch=master
+[cov-link]:  https://coveralls.io/r/miloyip/rapidjson?branch=master
+
+## Introduction
+
+RapidJSON is a JSON parser and generator for C++. It was inspired by 
[RapidXml](http://rapidxml.sourceforge.net/).
+
+* RapidJSON is **small** but **complete**. It supports both SAX and DOM style 
API. The SAX parser is only a half thousand lines of code.
+
+* RapidJSON is **fast**. Its performance can be comparable to `strlen()`. It 
also optionally supports SSE2/SSE4.2 for acceleration.
+
+* RapidJSON is **self-contained** and **header-only**. It does not depend on 
external libraries such as BOOST. It even does not depend on STL.
+
+* RapidJSON is **memory-friendly**. Each JSON value occupies exactly 16 bytes 
for most 32/64-bit machines (excluding text string). By default it uses a fast 
memory allocator, and the parser allocates memory compactly during parsing.
+
+* RapidJSON is **Unicode-friendly**. It supports UTF-8, UTF-16, UTF-32 (LE & 
BE), and their detection, validation and transcoding internally. For example, 
you can read a UTF-8 file and let RapidJSON transcode the JSON strings into 
UTF-16 in the DOM. It also supports surrogates and "\u0000" (null character).
+
+More features can be read [here](doc/features.md).
+
+JSON(JavaScript Object Notation) is a light-weight data exchange format. 
RapidJSON should be in fully compliance with RFC7159/ECMA-404, with optional 
support of relaxed syntax. More information about JSON can be obtained at
+* [Introducing JSON](http://json.org/)
+* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange 
Format](http://www.ietf.org/rfc/rfc7159.txt)
+* [Standard ECMA-404: The JSON Data Interchange 
Format](http://www.ecma-international.org/publications/standards/Ecma-404.htm)
+
+## Highlights in v1.1 (2016-8-25)
+
+* Added [JSON Pointer](doc/pointer.md)
+* Added [JSON Schema](doc/schema.md)
+* Added [relaxed JSON syntax](doc/dom.md) (comment, trailing comma, 
NaN/Infinity)
+* Iterating array/object with [C++11 Range-based for loop](doc/tutorial.md)
+* Reduce memory overhead of each `Value` from 24 bytes to 16 bytes in x86-64 
architecture.
+
+For other changes please refer to [change log](CHANGELOG.md).
+
+## Compatibility
+
+RapidJSON is cross-platform. Some platform/compiler combinations which have 
been tested are shown as follows.
+* Visual C++ 2008/2010/2013 on Windows (32/64-bit)
+* GNU C++ 3.8.x on Cygwin
+* Clang 3.4 on Mac OS X (32/64-bit) and iOS
+* Clang 3.4 on Android NDK
+
+Users can build and run the unit tests on their platform/compiler.
+
+## Installation
+
+RapidJSON is a header-only C++ library. Just copy the `include/rapidjson` 
folder to system or project's include path.
+
+RapidJSON uses following software as its dependencies:
+* [CMake](https://cmake.org/) as a general build tool
+* (optional)[Doxygen](http://www.doxygen.org) to build documentation
+* (optional)[googletest](https://github.com/google/googletest) for unit and 
performance testing
+
+To generate user documentation and run tests please proceed with the steps 
below:
+
+1. Execute `git submodule update --init` to get the files of thirdparty 
submodules (google test).
+2. Create directory called `build` in rapidjson source directory.
+3. Change to `build` directory and run `cmake ..` command to configure your 
build. Windows users can do the same with cmake-gui application.
+4. On Windows, build the solution found in the build directory. On Linux, run 
`make` from the build directory.
+
+On successfull build you will find compiled test and example binaries in `bin`
+directory. The generated documentation will be available in `doc/html`
+directory of the build tree. To run tests after finished build please run `make
+test` or `ctest` from your build tree. You can get detailed output using `ctest
+-V` command.
+
+It is possible to install library system-wide by running `make install` command
+from the build tree with administrative privileges. This will install all files
+according to system preferences.  Once RapidJSON is installed, it is possible
+to use it from other CMake projects by adding `find_package(RapidJSON)` line to
+your CMakeLists.txt.
+
+## Usage at a glance
+
+This simple example parses a JSON string into a document (DOM), make a simple 
modification of the DOM, and finally stringify the DOM to a JSON string.
+
+~~~~~~~~~~cpp
+// rapidjson/example/simpledom/simpledom.cpp`
+#include "rapidjson/document.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+
+int main() {
+    // 1. Parse a JSON string into DOM.
+    const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
+    Document d;
+    d.Parse(json);
+
+    // 2. Modify it by DOM.
+    Value& s = d["stars"];
+    s.SetInt(s.GetInt() + 1);
+
+    // 3. Stringify the DOM
+    StringBuffer buffer;
+    Writer<StringBuffer> writer(buffer);
+    d.Accept(writer);
+
+    // Output {"project":"rapidjson","stars":11}
+    std::cout << buffer.GetString() << std::endl;
+    return 0;
+}
+~~~~~~~~~~
+
+Note that this example did not handle potential errors.
+
+The following diagram shows the process.
+
+![simpledom](doc/diagram/simpledom.png)
+
+More [examples](https://github.com/miloyip/rapidjson/tree/master/example) are 
available:
+
+* DOM API
+ * 
[tutorial](https://github.com/miloyip/rapidjson/blob/master/example/tutorial/tutorial.cpp):
 Basic usage of DOM API.
+
+* SAX API
+ * 
[simplereader](https://github.com/miloyip/rapidjson/blob/master/example/simplereader/simplereader.cpp):
 Dumps all SAX events while parsing a JSON by `Reader`.
+ * 
[condense](https://github.com/miloyip/rapidjson/blob/master/example/condense/condense.cpp):
 A command line tool to rewrite a JSON, with all whitespaces removed.
+ * 
[pretty](https://github.com/miloyip/rapidjson/blob/master/example/pretty/pretty.cpp):
 A command line tool to rewrite a JSON with indents and newlines by 
`PrettyWriter`.
+ * 
[capitalize](https://github.com/miloyip/rapidjson/blob/master/example/capitalize/capitalize.cpp):
 A command line tool to capitalize strings in JSON.
+ * 
[messagereader](https://github.com/miloyip/rapidjson/blob/master/example/messagereader/messagereader.cpp):
 Parse a JSON message with SAX API.
+ * 
[serialize](https://github.com/miloyip/rapidjson/blob/master/example/serialize/serialize.cpp):
 Serialize a C++ object into JSON with SAX API.
+ * 
[jsonx](https://github.com/miloyip/rapidjson/blob/master/example/jsonx/jsonx.cpp):
 Implements a `JsonxWriter` which stringify SAX events into 
[JSONx](https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonx.html)
 (a kind of XML) format. The example is a command line tool which converts 
input JSON into JSONx format.
+
+* Schema
+ * 
[schemavalidator](https://github.com/miloyip/rapidjson/blob/master/example/schemavalidator/schemavalidator.cpp)
 : A command line tool to validate a JSON with a JSON schema.
+ 
+* Advanced
+ * 
[prettyauto](https://github.com/miloyip/rapidjson/blob/master/example/prettyauto/prettyauto.cpp):
 A modified version of 
[pretty](https://github.com/miloyip/rapidjson/blob/master/example/pretty/pretty.cpp)
 to automatically handle JSON with any UTF encodings.
+ * 
[parsebyparts](https://github.com/miloyip/rapidjson/blob/master/example/parsebyparts/parsebyparts.cpp):
 Implements an `AsyncDocumentParser` which can parse JSON in parts, using C++11 
thread.
+ * 
[filterkey](https://github.com/miloyip/rapidjson/blob/master/example/filterkey/filterkey.cpp):
 A command line tool to remove all values with user-specified key.
+ * 
[filterkeydom](https://github.com/miloyip/rapidjson/blob/master/example/filterkeydom/filterkeydom.cpp):
 Same tool as above, but it demonstrates how to use a generator to populate a 
`Document`.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/readme.zh-cn.md
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/readme.zh-cn.md 
b/thirdparty/rapidjson-1.1.0/readme.zh-cn.md
new file mode 100644
index 0000000..74d267c
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/readme.zh-cn.md
@@ -0,0 +1,152 @@
+![](doc/logo/rapidjson.png)
+
+![](https://img.shields.io/badge/release-v1.1.0-blue.png)
+
+## 高效的 C++ JSON 解析/生成器,提供 SAX 及 DOM 风格 API
+
+Tencent is pleased to support the open source community by making RapidJSON 
available.
+
+Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All 
rights reserved.
+
+* [RapidJSON GitHub](https://github.com/miloyip/rapidjson/)
+* RapidJSON 文档
+  * [English](http://rapidjson.org/)
+  * [简体中文](http://rapidjson.org/zh-cn/)
+  * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/) 可下载 
PDF/EPUB/MOBI,但不含 API 参考手册。
+
+## Build 状态
+
+| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] |
+| :---------------: | :-----------------: | :-------------------: |
+| ![lin-badge]      | ![win-badge]        | ![cov-badge]          |
+
+[lin-badge]: https://travis-ci.org/miloyip/rapidjson.png?branch=master "Travis 
build status"
+[lin-link]:  https://travis-ci.org/miloyip/rapidjson "Travis build status"
+[win-badge]: 
https://ci.appveyor.com/api/projects/status/u658dcuwxo14a8m9/branch/master 
"AppVeyor build status"
+[win-link]:  https://ci.appveyor.com/project/miloyip/rapidjson/branch/master 
"AppVeyor build status"
+[cov-badge]: 
https://coveralls.io/repos/miloyip/rapidjson/badge.png?branch=master
+[cov-link]:  https://coveralls.io/r/miloyip/rapidjson?branch=master
+
+## 简介
+
+RapidJSON 是一个 C++ 的 JSON 解析器及生成器。它的灵感来自 
[RapidXml](http://rapidxml.sourceforge.net/)。
+
+* RapidJSON 小而全。它同时支持 SAX 和 DOM 风格的 API。SAX 
解析器只有约 500 行代码。
+
+* RapidJSON 快。它的性能可与 `strlen()` 相比。可支持 SSE2/SSE4.2 
加速。
+
+* RapidJSON 独立。它不依赖于 BOOST 
等外部库。它甚至不依赖于 STL。
+
+* RapidJSON 对内存友好。在大部分 32/64 位机器上,每个 JSON 
值只占 16 字节(除字符串外)。它预设使用一个快速的内
存分配器,令分析器可以紧凑地分配内存。
+
+* RapidJSON 对 Unicode 友好。它支持 UTF-8、UTF-16、UTF-32 
(大端序/小端序),并内部支持这些编码的检测、校验及转ç 
ã€‚例如,RapidJSON 可以在分析一个 UTF-8 文件至 DOM 
时,把当中的 JSON 字符串转码至 
UTF-16。它也支持代理对(surrogate pair)及 
`"\u0000"`(空字符)。
+
+在 [这里](doc/features.zh-cn.md) 可读取更多特点。
+
+JSON(JavaScript Object Notation)是一个轻量的数据交换æ 
¼å¼ã€‚RapidJSON 应该完全遵从 
RFC7159/ECMA-404,并支持可选的放宽语法。 关于 JSON 
的更多信息可参考:
+* [Introducing JSON](http://json.org/)
+* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange 
Format](http://www.ietf.org/rfc/rfc7159.txt)
+* [Standard ECMA-404: The JSON Data Interchange 
Format](http://www.ecma-international.org/publications/standards/Ecma-404.htm)
+
+## v1.1 中的亮点 (2016-8-25)
+
+* 加入 [JSON Pointer](doc/pointer.zh-cn.md) 
功能,可更简单地访问及更改 DOM。
+* 加入 [JSON Schema](doc/schema.zh-cn.md) 功能,可在解析或生成 
JSON 时进行校验。
+* 加入 [放宽的 JSON 语法](doc/dom.zh-cn.md) 
(注释、尾随逗号、NaN/Infinity)
+* 使用 [C++11 范围 for 循环](doc/tutorial.zh-cn.md) 去遍历 array 和 
object。
+* 在 x86-64 架构下,缩减每个 `Value` 的内存开销从 24 字节至 
16 字节。
+
+其他改动请参考 [change log](CHANGELOG.md).
+
+## 兼容性
+
+RapidJSON 
是跨平台的。以下是一些曾测试的平台/编译器组合:
+* Visual C++ 2008/2010/2013 在 Windows (32/64-bit)
+* GNU C++ 3.8.x 在 Cygwin
+* Clang 3.4 在 Mac OS X (32/64-bit) 及 iOS
+* Clang 3.4 在 Android NDK
+
+用户也可以在他们的平台上生成及执行单元测试。
+
+## 安装
+
+RapidJSON 是只有头文件的 C++ 库。只需把 `include/rapidjson` 
目录复制至系统或项目的 include 目录中。
+
+RapidJSON 依赖于以下软件:
+* [CMake](http://www.cmake.org) 作为通用生成工具
+* (optional)[Doxygen](http://www.doxygen.org) 用于生成文档
+* (optional)[googletest](https://code.google.com/p/googletest/) 用于单å…
ƒåŠæ€§èƒ½æµ‹è¯•
+
+生成测试及例子的步骤:
+
+1. 执行 `git submodule update --init` 去获取 thirdparty submodules 
(google test)。
+2. 在 rapidjson 目渌下,建立一个 `build` 目录。
+3. 在 `build` 目录下执行 `cmake ..` 命令以设置生成。Windows 
用户可使用 cmake-gui 应用程序。
+4. 在 Windows 下,编译生成在 build 目录中的 solution。在 Linux 
下,于 build 目录运行 `make`。
+
+成功生成后,你会在 `bin` 
的目录下找到编译后的测试及例子可执行文件。而生成的文档将位于
 build 下的 `doc/html` 目录。要执行测试,请在 build 下执行 
`make test` 或 `ctest`。使用 `ctest -V` 命令可获取详细的输出。
+
+我们也可以把程序库安装至全系统中,只要在å…
·ç®¡ç†æ¬Šé™ä¸‹ä»Ž build 目录执行 `make install` 命令。这æ 
·ä¼šæŒ‰ç³»ç»Ÿçš„偏好设置安装所有文件。当安装 RapidJSON 后,å…
¶ä»–çš„ CMake 项目需要使用它时,可以通过在 `CMakeLists.txt` 加å…
¥ä¸€å¥ `find_package(RapidJSON)`。
+
+## 用法一览
+
+此简单例子解析一个 JSON 字符串至一个 document (DOM),对 DOM 
作出简单修改,最终把 DOM 转换(stringify)至 JSON 字符串。
+
+~~~~~~~~~~cpp
+// rapidjson/example/simpledom/simpledom.cpp`
+#include "rapidjson/document.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+
+int main() {
+    // 1. 把 JSON 解析至 DOM。
+    const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
+    Document d;
+    d.Parse(json);
+
+    // 2. 利用 DOM 作出修改。
+    Value& s = d["stars"];
+    s.SetInt(s.GetInt() + 1);
+
+    // 3. 把 DOM 转换(stringify)成 JSON。
+    StringBuffer buffer;
+    Writer<StringBuffer> writer(buffer);
+    d.Accept(writer);
+
+    // Output {"project":"rapidjson","stars":11}
+    std::cout << buffer.GetString() << std::endl;
+    return 0;
+}
+~~~~~~~~~~
+
+注意此例子并没有处理潜在错误。
+
+下图展示执行过程。
+
+![simpledom](doc/diagram/simpledom.png)
+
+还有许多 
[例子](https://github.com/miloyip/rapidjson/tree/master/example) 
可供参考:
+
+* DOM API
+ * 
[tutorial](https://github.com/miloyip/rapidjson/blob/master/example/tutorial/tutorial.cpp):
 DOM API 的基本使用方法。
+
+* SAX API
+ * 
[simplereader](https://github.com/miloyip/rapidjson/blob/master/example/simplereader/simplereader.cpp):
 使用 `Reader` 解析 JSON 时,打印所有 SAX 事件。
+ * 
[condense](https://github.com/miloyip/rapidjson/blob/master/example/condense/condense.cpp):
 移除 JSON 中所有空白符的命令行工具。
+ * 
[pretty](https://github.com/miloyip/rapidjson/blob/master/example/pretty/pretty.cpp):
 为 JSON 加入缩进与换行的命令行工具,当中使用了 
`PrettyWriter`。
+ * 
[capitalize](https://github.com/miloyip/rapidjson/blob/master/example/capitalize/capitalize.cpp):
 把 JSON 中所有字符串改为大写的命令行工具。
+ * 
[messagereader](https://github.com/miloyip/rapidjson/blob/master/example/messagereader/messagereader.cpp):
 使用 SAX API 去解析一个 JSON 报文。
+ * 
[serialize](https://github.com/miloyip/rapidjson/blob/master/example/serialize/serialize.cpp):
 使用 SAX API 去序列化 C++ 对象,生成 JSON。
+ * 
[jsonx](https://github.com/miloyip/rapidjson/blob/master/example/jsonx/jsonx.cpp):
 实现了一个 `JsonxWriter`,它能把 SAX 事件写成 
[JSONx](https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonx.html)(一种
 XML)格式。这个例子是把 JSON 输入转换成 JSONx æ 
¼å¼çš„命令行工具。
+
+* Schema API
+ * 
[schemavalidator](https://github.com/miloyip/rapidjson/blob/master/example/schemavalidator/schemavalidator.cpp):
 使用 JSON Schema 去校验 JSON 的命令行工具。
+ 
+* 进阶
+ * 
[prettyauto](https://github.com/miloyip/rapidjson/blob/master/example/prettyauto/prettyauto.cpp):
 
[pretty](https://github.com/miloyip/rapidjson/blob/master/example/pretty/pretty.cpp)
 的修改版本,可自动处理任何 UTF 编码的 JSON。
+ * 
[parsebyparts](https://github.com/miloyip/rapidjson/blob/master/example/parsebyparts/parsebyparts.cpp):
 这例子中的 `AsyncDocumentParser` 类使用 C++ 线程来逐段解析 
JSON。
+ * 
[filterkey](https://github.com/miloyip/rapidjson/blob/master/example/filterkey/filterkey.cpp):
 移取使用者指定的键值的命令行工具。
+ * 
[filterkeydom](https://github.com/miloyip/rapidjson/blob/master/example/filterkey/filterkey.cpp):
 如上的工具,但展示如何使用生成器(generator)去填充一个 
`Document`。
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/fd280b5c/thirdparty/rapidjson-1.1.0/travis-doxygen.sh
----------------------------------------------------------------------
diff --git a/thirdparty/rapidjson-1.1.0/travis-doxygen.sh 
b/thirdparty/rapidjson-1.1.0/travis-doxygen.sh
new file mode 100755
index 0000000..31a50cf
--- /dev/null
+++ b/thirdparty/rapidjson-1.1.0/travis-doxygen.sh
@@ -0,0 +1,122 @@
+#!/bin/bash
+# Update Doxygen documentation after push to 'master'.
+# Author: @pah
+
+set -e
+
+DOXYGEN_VER=doxygen-1.8.7
+DOXYGEN_TAR=${DOXYGEN_VER}.linux.bin.tar.gz
+DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/${DOXYGEN_TAR}";
+DOXYGEN_BIN="/usr/local/bin/doxygen"
+
+: ${GITHUB_REPO:="miloyip/rapidjson"}
+GITHUB_HOST="github.com"
+GITHUB_CLONE="git://${GITHUB_HOST}/${GITHUB_REPO}"
+GITHUB_URL="https://${GITHUB_HOST}/${GITHUB_PUSH-${GITHUB_REPO}}";
+
+# if not set, ignore password
+#GIT_ASKPASS="${TRAVIS_BUILD_DIR}/gh_ignore_askpass.sh"
+
+skip() {
+       echo "$@" 1>&2
+       echo "Exiting..." 1>&2
+       exit 0
+}
+
+abort() {
+       echo "Error: $@" 1>&2
+       echo "Exiting..." 1>&2
+       exit 1
+}
+
+# TRAVIS_BUILD_DIR not set, exiting
+[ -d "${TRAVIS_BUILD_DIR-/nonexistent}" ] || \
+       abort '${TRAVIS_BUILD_DIR} not set or nonexistent.'
+
+# check for pull-requests
+[ "${TRAVIS_PULL_REQUEST}" = "false" ] || \
+       skip "Not running Doxygen for pull-requests."
+
+# check for branch name
+[ "${TRAVIS_BRANCH}" = "master" ] || \
+       skip "Running Doxygen only for updates on 'master' branch (current: 
${TRAVIS_BRANCH})."
+
+# check for job number
+# [ "${TRAVIS_JOB_NUMBER}" = "${TRAVIS_BUILD_NUMBER}.1" ] || \
+#      skip "Running Doxygen only on first job of build ${TRAVIS_BUILD_NUMBER} 
(current: ${TRAVIS_JOB_NUMBER})."
+
+# install doxygen binary distribution
+doxygen_install()
+{
+       wget -O - "${DOXYGEN_URL}" | \
+               tar xz -C ${TMPDIR-/tmp} ${DOXYGEN_VER}/bin/doxygen
+    export PATH="${TMPDIR-/tmp}/${DOXYGEN_VER}/bin:$PATH"
+}
+
+doxygen_run()
+{
+       cd "${TRAVIS_BUILD_DIR}";
+       doxygen ${TRAVIS_BUILD_DIR}/build/doc/Doxyfile;
+       doxygen ${TRAVIS_BUILD_DIR}/build/doc/Doxyfile.zh-cn;
+}
+
+gh_pages_prepare()
+{
+       cd "${TRAVIS_BUILD_DIR}/build/doc";
+       [ ! -d "html" ] || \
+               abort "Doxygen target directory already exists."
+       git --version
+       git clone -b gh-pages "${GITHUB_CLONE}" html
+       cd html
+       # setup git config (with defaults)
+       git config user.name "${GIT_NAME-travis}"
+       git config user.email "${GIT_EMAIL-"travis@localhost"}"
+       # clean working dir
+       rm -f .git/index
+       git clean -df
+}
+
+gh_pages_commit() {
+       cd "${TRAVIS_BUILD_DIR}/build/doc/html";
+       echo "rapidjson.org" > CNAME
+       git add --all;
+       git diff-index --quiet HEAD || git commit -m "Automatic doxygen build";
+}
+
+gh_setup_askpass() {
+       cat > ${GIT_ASKPASS} <<EOF
+#!/bin/bash
+echo
+exit 0
+EOF
+       chmod a+x "$GIT_ASKPASS"
+}
+
+gh_pages_push() {
+       # check for secure variables
+       [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] || \
+               skip "Secure variables not available, not updating GitHub 
pages."
+       # check for GitHub access token
+       [ "${GH_TOKEN+set}" = set ] || \
+               skip "GitHub access token not available, not updating GitHub 
pages."
+       [ "${#GH_TOKEN}" -eq 40 ] || \
+               abort "GitHub token invalid: found ${#GH_TOKEN} characters, 
expected 40."
+
+       cd "${TRAVIS_BUILD_DIR}/build/doc/html";
+       # setup credentials (hide in "set -x" mode)
+       git remote set-url --push origin "${GITHUB_URL}"
+       git config credential.helper 'store'
+       # ( set +x ; git config credential.username "${GH_TOKEN}" )
+       ( set +x ; [ -f ${HOME}/.git-credentials ] || \
+                       ( echo "https://${GH_TOKEN}:@${GITHUB_HOST}"; > 
${HOME}/.git-credentials ; \
+                        chmod go-rw ${HOME}/.git-credentials ) )
+       # push to GitHub
+       git push origin gh-pages
+}
+
+doxygen_install
+gh_pages_prepare
+doxygen_run
+gh_pages_commit
+gh_pages_push
+

Reply via email to