bool HelloWorld::init()

{

if ( !Layer::init() )

{

return false;

}

Size visibleSize = Director::getInstance()->getVisibleSize();

Vec2 origin = Director::getInstance()->getVisibleOrigin();

Value value1=Value("abc");

Value value2=Value(123);

Value value3=Value(true);

CCLOG("%s,%d,%s",value1.asString().c_str(),value2.asInt(),value3.asBool()==true?"True":"False");

CCLOG("%s,%s,%s",value1.asString().c_str(),value2.asString().c_str(),value3.asString().c_str());

Value value4=Value::Null;

value4=value1;

value4=value2;

value4=value3;

CCLOG("%s %s",value4.getType()==Value::Type::BOOLEAN?"True":"False",value4.asString().c_str());

ValueVector vector;

vector.push_back(Value("hello"));

vector.push_back(value1);

vector.push_back(value2);

for (auto v:vector) {

CCLOG("Vector %s",v.asString().c_str());

}

ValueMap map;

map["a"]=value2;

map["b"]=value1;

for (auto m:map) {

CCLOG("%s == %s",m.first.c_str(),m.second.asString().c_str());

}

return true;

}

05-08 08:09