示例#1
0
Node::Node(plist_type type, Node* parent) : _parent(parent)
{
    _node = NULL;

    switch (type)
    {
    case PLIST_BOOLEAN:
        _node = plist_new_bool(0);
        break;
    case PLIST_UINT:
        _node = plist_new_uint(0);
        break;
    case PLIST_REAL:
        _node = plist_new_real(0.);
        break;
    case PLIST_STRING:
        _node = plist_new_string("");
        break;
    case PLIST_KEY:
        _node = plist_new_string("");
        plist_set_key_val(_node, "");
        break;
    case PLIST_UID:
	_node = plist_new_uid(0);
	break;
    case PLIST_DATA:
        _node = plist_new_data(NULL,0);
        break;
    case PLIST_DATE:
        _node = plist_new_date(0,0);
        break;
    case PLIST_ARRAY:
        _node = plist_new_array();
        break;
    case PLIST_DICT:
        _node = plist_new_dict();
        break;
    case PLIST_NONE:
    default:
        break;
    }
}
示例#2
0
文件: Key.cpp 项目: UnveN/libplist
Key::Key(const std::string& s) : Node(PLIST_STRING)
{
    plist_set_key_val(_node, s.c_str());
}
示例#3
0
文件: Key.cpp 项目: UnveN/libplist
void Key::SetValue(const std::string& s)
{
    plist_set_key_val(_node, s.c_str());
}
示例#4
0
文件: Key.cpp 项目: UnveN/libplist
Key::Key(PList::Key& k) : Node(PLIST_UINT)
{
    plist_set_key_val(_node, k.GetValue().c_str());
}