返回介绍

QConstString Class

发布于 2019-10-04 14:58:58 字数 1711 浏览 1152 评论 0 收藏 0

The QConstString class provides string objects using constant Unicode data. More...

#include <qstring.h>

List of all member functions.

Public Members

  • QConstString ( constQChar*unicode, uintlength )
  • ~QConstString ()
  • const QString & string () const

Detailed Description

The QConstString class provides string objects using constant Unicode data.

In order to minimize copying, highly optimized applications can use QConstString to provide a QString-compatible object from existing Unicode data. It is then the programmer's responsibility to ensure that the Unicode data exists for the entire lifetime of the QConstString object.

A QConstString is created with the QConstString constructor. The string held by the object can be obtained by calling string().

See also Text Related Classes.


Member Function Documentation

QConstString::QConstString ( constQChar*unicode, uintlength )

Constructs a QConstString that uses the first length Unicode characters in the array unicode. Any attempt to modify copies of the string will cause it to create a copy of the data, thus it remains forever unmodified.

The data in unicode is not copied. The caller must be able to guarantee that unicode will not be deleted or modified.

QConstString::~QConstString ()

Destroys the QConstString, creating a copy of the data if other strings are still using it.

constQString& QConstString::string () const

Returns a constant string referencing the data passed during construction.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文