Go to the documentation of this file.
6 #ifndef CPPTL_JSON_ALLOCATOR_H_INCLUDED
7 #define CPPTL_JSON_ALLOCATOR_H_INCLUDED
31 return static_cast<pointer>(::
operator new(n *
sizeof(T)));
42 std::memset(p, 0, n *
sizeof(T));
52 ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
75 template <
typename T,
typename U>
80 template <
typename T,
typename U>
89 #endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
pointer allocate(size_type n)
Allocate memory for N items using the standard allocator.
void destroy(pointer p)
Destroy an item in-place at pointer P.
CharReader * newCharReader() const override
Allocate a CharReader via operator new().
ArrayIndex size() const
Number of values in array or object.
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
Json::Value settings_
Configuration of this builder.
SecureAllocator(const SecureAllocator< U > &)
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)
size_type max_size() const
void deallocate(volatile pointer p, size_type n)
Release memory which was allocated for N items at pointer P.
pointer address(reference x) const
void construct(pointer p, Args &&... args)
Construct an item in-place at pointer P.
JSON (JavaScript Object Notation).
String asString() const
Embedded zeroes are possible.
std::ptrdiff_t difference_type
String writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience.
const T & const_reference
bool parseFromStream(CharReader::Factory const &, IStream &, Value *root, String *errs)
Consume entire stream and use its begin/end.
Build a StreamWriter implementation.
Value get(ArrayIndex index, const Value &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
const_pointer address(const_reference x) const
Build a CharReader implementation.