static std::string visit(const Value& v, int depth) { std::stringstream ret; switch (v.getType()) { case Value::Type::NONE: case Value::Type::BYTE: case Value::Type::INTEGER: case Value::Type::UNSIGNED: case Value::Type::FLOAT: case Value::Type::DOUBLE: case Value::Type::BOOLEAN: case Value::Type::STRING: ret << v.asString() << "\n"; break; case Value::Type::VECTOR: ret << visitVector(v.asValueVector(), depth); break; case Value::Type::MAP: ret << visitMap(v.asValueMap(), depth); break; case Value::Type::INT_KEY_MAP: ret << visitMap(v.asIntKeyMap(), depth); break; default: CCASSERT(false, "Invalid type!"); break; } return ret.str(); }
static std::string visit(const Value& v, int depth) { std::stringstream ret; switch (v.getType()) { case Value::Type::NONE: case Value::Type::BYTE: case Value::Type::INTEGER: case Value::Type::FLOAT: case Value::Type::DOUBLE: case Value::Type::BOOLEAN: case Value::Type::STRING: ret << v.asString() << "\n"; break; case Value::Type::VECTOR: ret << visitVector(v.asValueArray(), depth); break; case Value::Type::MAP: ret << visitMap(v.asValueDict(), depth); break; default: assert(false); break; } return ret.str(); }
void SignatureConvertor::visit(const qi::Signature& sig) { switch(sig.type()) { case '[': visitList(sig); break; case '{': visitMap(sig); break; case '(': visitTuple(sig); break; case '#': visitVarArgs(sig); break; default: visitSimple(sig); break; } }