Ejemplo n.º 1
0
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();
}
Ejemplo n.º 2
0
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();
}
Ejemplo n.º 3
0
 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;
   }
 }