webengine/osswebengine/WebCore/dom/AtomicStringList.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2  * This file is part of the DOM implementation for KDE.
       
     3  *
       
     4  * Copyright (C) 2004 Apple Computer, Inc.
       
     5  *
       
     6  * This library is free software; you can redistribute it and/or
       
     7  * modify it under the terms of the GNU Library General Public
       
     8  * License as published by the Free Software Foundation; either
       
     9  * version 2 of the License, or (at your option) any later version.
       
    10  *
       
    11  * This library is distributed in the hope that it will be useful,
       
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    14  * Library General Public License for more details.
       
    15  *
       
    16  * You should have received a copy of the GNU Library General Public License
       
    17  * along with this library; see the file COPYING.LIB.  If not, write to
       
    18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    19  * Boston, MA 02110-1301, USA.
       
    20  *
       
    21  */
       
    22 
       
    23 #ifndef AtomicStringList_h
       
    24 #define AtomicStringList_h
       
    25 
       
    26 #include "AtomicString.h"
       
    27 
       
    28 namespace WebCore {
       
    29 
       
    30 class AtomicStringList {
       
    31 public:
       
    32     AtomicStringList() : m_next(0) {}
       
    33     AtomicStringList(const AtomicString& str, AtomicStringList* n = 0) : m_string(str), m_next(n) {}
       
    34     ~AtomicStringList() { delete m_next; }
       
    35     
       
    36     AtomicStringList* next() const { return m_next; }
       
    37     void setNext(AtomicStringList* n) { m_next = n; }
       
    38     const AtomicString& string() const { return m_string; }
       
    39     void setString(const AtomicString& str) { m_string = str; }
       
    40 
       
    41     AtomicStringList* clone() { return new AtomicStringList(m_string, m_next ? m_next->clone() : 0); }
       
    42     void clear() { m_string = nullAtom; delete m_next; m_next = 0; }
       
    43     
       
    44 private:
       
    45     AtomicString m_string;
       
    46     AtomicStringList* m_next;
       
    47 };
       
    48 
       
    49 }
       
    50 
       
    51 #endif