Example #1
0
bool DataList::Insert(PNode node) /// return false if such entry already exists.
{
    if (!node.Ok())
        return false;
    bool inserted = nodes.insert(std::pair<std::string, PNode>(BA::to_lower_copy(node->name), node)).second;
    if (!inserted)
        return false;

    node->parent = this;
    node->ListInsertAfter(list_loop.list_prev);
    return true;
}
Example #2
0
bool DataList::InsertAt(PNode node, PNode where) /// return false if such entry already exists.
{
    if (!node.Ok())
        return false;
    if (!(where->list_prev))
        return false;
    bool inserted = nodes.insert(std::pair<std::string, PNode>((*node).name, node)).second;
    if (!inserted)
        return false;

    node->parent = this;
    node->ListInsertAfter(where->list_prev);
    return true;
}