⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dom_string.h

📁 将konqueror浏览器移植到ARM9 2410中
💻 H
字号:
/* * This file is part of the DOM implementation for KDE. * * (C) 1999 Lars Knoll (knoll@kde.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB.  If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * $Id: dom_string.h,v 1.19 2001/07/21 21:49:36 mueller Exp $ */#ifndef _DOM_DOMString_h_#define _DOM_DOMString_h_#include <qstring.h>namespace DOM {class DOMStringImpl;/** * This class implements the basic string we use in the DOM. We do not use * QString for 2 reasons: Memory overhead, and the missing explicit sharing * of strings we need for the DOM. * * All DOMStrings are explicitly shared (they behave like pointers), meaning * that modifications to one instance will also modify all others. If you * wish to get a DOMString that is independent, use @ref copy(). */class DOMString{    friend class CharacterDataImpl;public:    /** default constructor. Gives an empty DOMString */    DOMString();    /* constructs a null DOMString. Like this assignment to 0 works */    DOMString(int);    DOMString(const QChar *str, uint len);    DOMString(const QString &);    DOMString(const char *str);    DOMString(DOMStringImpl *i);    virtual ~DOMString();    // assign and copy    DOMString(const DOMString &str);    DOMString &operator =(const DOMString &str);    /**     * append str to this string     */    DOMString &operator += (const DOMString &str);    /**     * add two DOMString's     */    DOMString operator + (const DOMString &str);    void insert(DOMString str, uint pos);    /**     * The character at position i of the DOMString. If i > length(), the     * character returned will be 0.     */    const QChar &operator [](unsigned int i) const;    int find(const QChar c, int start = 0) const;    uint length() const;    void truncate( unsigned int len );    void remove(unsigned int pos, int len=1);    /**     * Splits the string into two. The original string gets truncated to pos, and the rest is returned.     */    DOMString split(unsigned int pos);    QChar *unicode() const;    QString string() const;    int toInt() const;    bool percentage(int &_percentage) const;    DOMString copy() const;    bool isNull()  const { return (impl == 0); }    bool isEmpty()  const;    /**     * @internal get a handle to the imlementation of the DOMString     * Use at own risk!!!     */    DOMStringImpl *implementation() const { return impl; }    /**     * @internal get a pointer to start of the string     * Needed by kBackpage     */    const QChar *stringPtr() const;protected:    DOMStringImpl *impl;};bool operator==( const DOMString &a, const DOMString &b );bool operator==( const DOMString &a, const QString &b );bool operator==( const DOMString &a, const char *b );inline bool operator!=( const DOMString &a, const DOMString &b ) { return !(a==b); };inline bool operator!=( const DOMString &a, const QString &b ) { return !(a==b); };inline bool operator!=( const DOMString &a, const char *b )  { return !(a==b); };inline bool strcmp( const DOMString &a, const DOMString &b ) { return a != b; }// returns false when equal, true otherwise (ignoring case)bool strcasecmp( const DOMString &a, const DOMString &b );bool strcasecmp( const DOMString& a, const char* b );};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -