classes.cc
/*
** Inserts a new DirLine, constructed from the given char**, after
** the current line in the DirList.
*/
Inserts a new DirLine, constructed from the given char**, after
the current line in the DirList.
Inserts a new DirLine constructed from the given char ** after the current line in the DirList .
DirLine *DirList::insert(char **line)
{
    DirLine *new_line = new DirLine(line);
    DirLine *ln = currLine();
    if (atEndOfList())
    {
        ln->_next = new_line;
        new_line->_prev = ln;
        _tail = new_line;
    }
    else
    {
        new_line->_next = ln->next();
        new_line->_prev = ln;
        ln->_next->_prev = new_line;
        ln->_next = new_line;
    }
    _nelems++;
    return new_line;
}
DirLine * DirList :: insert ( char * * line ) { DirLine * new_line = new DirLine ( line ) ; DirLine * ln = currLine ( ) ; if ( atEndOfList ( ) ) { ln -> _next = new_line ; new_line -> _prev = ln ; _tail = new_line ; } else { new_line -> _next = ln -> next ( ) ; new_line -> _prev = ln ; ln -> _next -> _prev = new_line ; ln -> _next = new_line ; } _nelems ++ ; return new_line ; }
Inserts a new DirLine, constructed from the given char**, after
the current line in the DirList.
Inserts a new DirLine constructed from the given char ** after the current line in the DirList .