Function PutN

Summary

#include <include/rapidjson/filewritestream.h>

(1) template <>
    void PutN(FileWriteStream &stream, char c, size_t n)

#include <include/rapidjson/memorybuffer.h>

(2) template <>
    void PutN(MemoryBuffer &memoryBuffer, char c, size_t n)

#include <include/rapidjson/stream.h>

(3) template <typename Stream, typename Ch>
    void PutN(Stream &stream, Ch c, size_t n)

#include <include/rapidjson/stringbuffer.h>

(4) template <>
    void PutN(GenericStringBuffer< UTF8<> > &stream, char c, size_t n)

Function overload

Synopsis

#include <include/rapidjson/filewritestream.h>

template <>
void PutN(FileWriteStream &stream, char c, size_t n)

Description

Implement specialized version of PutN() with memset() for better performance.

Source

Lines 93-96 in include/rapidjson/filewritestream.h.

template<>
inline void PutN(FileWriteStream& stream, char c, size_t n) {
    stream.PutN(c, n);
}

Synopsis

#include <include/rapidjson/memorybuffer.h>

template <>
void PutN(MemoryBuffer &memoryBuffer, char c, size_t n)

Description

Implement specialized version of PutN() with memset() for better performance.

Source

Lines 63-66 in include/rapidjson/memorybuffer.h.

template<>
inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
    std::memset(memoryBuffer.stack_.Push<char>(n), c, n * sizeof(c));
}

Synopsis

#include <include/rapidjson/stream.h>

template <typename Stream, typename Ch>
void PutN(Stream &stream, Ch c, size_t n)

Description

Put N copies of a character to a stream.

Source

Lines 96-101 in include/rapidjson/stream.h.

template<typename Stream, typename Ch>
inline void PutN(Stream& stream, Ch c, size_t n) {
    PutReserve(stream, n);
    for (size_t i = 0; i < n; i++)
        PutUnsafe(stream, c);
}

Synopsis

#include <include/rapidjson/stringbuffer.h>

template <>
void PutN(GenericStringBuffer< UTF8<> > &stream, char c, size_t n)

Description

Implement specialized version of PutN() with memset() for better performance.

Source

Lines 110-113 in include/rapidjson/stringbuffer.h.

template<>
inline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {
    std::memset(stream.stack_.Push<char>(n), c, n * sizeof(c));
}





Add Discussion as Guest

Log in