Poco::Dynamic

namespace Impl

Overview

Functions: appendJSONKey, appendJSONString, appendJSONValue, containerToJSON, isJSONString

Functions

appendJSONKey

void appendJSONKey(
    std::string & val,
    const Var & any
);

Converts the any to a JSON key (i.e. wraps it into double quotes regardless of the underlying type) and appends it to val.

appendJSONString

void appendJSONString(
    std::string & val,
    const Var & any
);

Converts the any to a JSON string (i.e. wraps it into double quotes) regardless of the underlying type) and appends it to val.

appendJSONValue

void appendJSONValue(
    std::string & val,
    const Var & any,
    bool wrap = true
);

Converts the any to a JSON value (if underlying type qualifies as string - see isJSONString() - it is wrapped into double quotes) and appends it to val. Wrapping can be prevented (useful for appending JSON fragments) by setting the wrap argument to false.

containerToJSON inline

template < typename C > void containerToJSON(
    C & cont,
    std::string & val
);

isJSONString

bool isJSONString(
    const Var & any
);

Returns true for values that should be JSON-formatted as string.