QStringRef Class

QStringRef 클래스는 QString 하위 문자열에 얇은 래퍼를 제공합니다. 더 보기...

헤더: #include <QStringRef>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
target_link_libraries(mytarget PRIVATE Qt6::Core5Compat)
qmake: QT += core5compat

참고: 이 클래스의 모든 함수는 재진입합니다.

공용 유형

공용 함수

QStringRef()
QStringRef(const QString *string)
QStringRef(const QString *string, int position, int length)
QStringRef(const QStringRef &other)
~QStringRef()
QStringRef appendTo(QString *string) const
const QChar at(int position) const
QChar back() const
QStringRef::const_iterator begin() const
QStringRef::const_iterator cbegin() const
QStringRef::const_iterator cend() const
void chop(int n)
QStringRef chopped(int len) const
void clear()
int compare(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int compare(const QByteArray &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int compare(const QString &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int compare(const QStringRef &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QStringRef::const_iterator constBegin() const
const QChar *constData() const
QStringRef::const_iterator constEnd() const
bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int count() const
int count(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int count(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int count(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QStringRef::const_reverse_iterator crbegin() const
QStringRef::const_reverse_iterator crend() const
const QChar *data() const
QStringRef::const_iterator end() const
bool endsWith(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool endsWith(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool endsWith(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool endsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool endsWith(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QChar front() const
int indexOf(QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int indexOf(QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int indexOf(QStringView str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int indexOf(const QStringRef &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool isEmpty() const
bool isNull() const
bool isRightToLeft() const
int lastIndexOf(const QString &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int lastIndexOf(QChar ch, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int lastIndexOf(QLatin1String str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int lastIndexOf(QStringView str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
int lastIndexOf(const QStringRef &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QStringRef left(int n) const
int length() const
int localeAwareCompare(const QString &other) const
int localeAwareCompare(const QStringRef &other) const
QStringRef mid(int position, int n = -1) const
int position() const
QStringRef::const_reverse_iterator rbegin() const
QStringRef::const_reverse_iterator rend() const
QStringRef right(int n) const
int size() const
QList<QStringRef> split(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
QList<QStringRef> split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool startsWith(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool startsWith(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool startsWith(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool startsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
bool startsWith(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
const QString *string() const
double toDouble(bool *ok = nullptr) const
float toFloat(bool *ok = nullptr) const
int toInt(bool *ok = nullptr, int base = 10) const
QByteArray toLatin1() const
QByteArray toLocal8Bit() const
long toLong(bool *ok = nullptr, int base = 10) const
qlonglong toLongLong(bool *ok = nullptr, int base = 10) const
short toShort(bool *ok = nullptr, int base = 10) const
QString toString() const
uint toUInt(bool *ok = nullptr, int base = 10) const
ulong toULong(bool *ok = nullptr, int base = 10) const
qulonglong toULongLong(bool *ok = nullptr, int base = 10) const
ushort toUShort(bool *ok = nullptr, int base = 10) const
QList<uint> toUcs4() const
QByteArray toUtf8() const
QStringRef trimmed() const
void truncate(int position)
const QChar *unicode() const
bool operator!=(const char *s) const
bool operator<(const char *s) const
bool operator<=(const char *s) const
QStringRef &operator=(const QString *string)
QStringRef &operator=(const QStringRef &other)
bool operator==(const char *s) const
bool operator>(const char *s) const
bool operator>=(const char *s) const
QChar operator[](int position) const

정적 공용 멤버

int compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int localeAwareCompare(const QStringRef &s1, const QString &s2)
int localeAwareCompare(const QStringRef &s1, const QStringRef &s2)
bool operator<(const QStringRef &s1, const QStringRef &s2)
bool operator<=(const QStringRef &s1, const QStringRef &s2)
bool operator==(QLatin1String s1, const QStringRef &s2)
bool operator==(const QString &s1, const QStringRef &s2)
bool operator==(const QStringRef &s1, const QStringRef &s2)
bool operator>(const QStringRef &s1, const QStringRef &s2)
bool operator>=(const QStringRef &s1, const QStringRef &s2)

상세 설명

QStringRef는 QString API의 읽기 전용 하위 집합을 제공합니다.

문자열 참조는 특정 position()에서 시작하여 지정된 size()로 string()의 일부를 명시적으로 참조합니다. toString ()를 호출하면 실제 QString 인스턴스로 데이터 사본이 반환됩니다.

이 클래스는 기존 QString 인스턴스에서 얻은 하위 문자열을 조작할 때 하위 문자열 처리 성능을 개선하기 위해 설계되었습니다. QStringRef는 원본 문자열의 일부를 간단히 참조함으로써 표준 QString 의 메모리 할당 및 참조 카운팅 오버헤드를 피합니다. 이는 구문 분석기에 사용되는 코드와 같은 저수준 코드에서 잠재적으로 더 복잡한 코드를 희생하는 대신 유리할 수 있습니다.

대부분의 사용자에게는 QString 대신 QStringRef를 사용한다고 해서 의미론적으로 이점이 있는 것은 아니며, QStringRef는 메모리 관리 문제에 주의를 기울여야 하므로 코드 작성 및 유지 관리가 더 복잡해질 가능성이 있습니다.

경고: 참조된 문자열이 존재하는 동안에만 QStringRef가 유효합니다. 원본 문자열이 삭제되면 문자열 참조가 잘못된 메모리 위치를 가리키게 됩니다.

프로파일링을 통해 표준 문자열 연산을 이 클래스에서 제공하는 최적화된 하위 문자열 처리로 대체하여 성능을 개선할 수 있음이 명확하게 확인된 안정적인 코드에서만 이 클래스를 사용하는 것이 좋습니다.

암시적으로 공유된 클래스도참조하세요 .

멤버 유형 문서

QStringRef::const_iterator

QStringRef::const_reverse_iterator도 참조하세요 .

QStringRef::const_reverse_iterator

QStringRef::const_iterator참조하세요 .

멤버 기능 문서

[constexpr noexcept] QStringRef::QStringRef()

빈 문자열 참조를 생성합니다.

QStringRef::QStringRef(const QString *string)

주어진 string 에 대한 문자열 참조를 생성합니다.

QStringRef::QStringRef(const QString *string, int position, int length)

시작 positionlength 문자로 지정된 지정된 string 의 문자 범위에 대한 문자열 참조를 작성합니다.

경고: 이 함수는 가능한 한 성능을 향상시키기 위해 존재하며 범위 검사를 수행하지 않습니다. 프로그램 정확성을 위해 positionlengthstring 의 유효한 하위 문자열을 설명해야 합니다.

즉, 시작 position 은 양수이거나 0이고 string 의 길이보다 작아야 하며, length 은 양수이거나 0이지만 시작 position 을 뺀 문자열의 길이보다 작아야 합니다. 즉, 0 <= 위치 <= 문자열->length() 및 0 <= 길이 <= 문자열->length() - 위치가 모두 만족되어야 합니다.

[noexcept default] QStringRef::QStringRef(const QStringRef &other)

other 문자열 참조의 복사본을 생성합니다.

[noexcept default] QStringRef::~QStringRef()

문자열 참조를 삭제합니다.

이 클래스는 문자열 데이터를 참조하는 데만 사용되며 소유권을 가지지 않으므로 인스턴스가 소멸될 때 메모리가 해제되지 않습니다.

QStringRef QStringRef::appendTo(QString *string) const

string 에 문자열 참조를 추가하고 결합된 문자열 데이터에 대한 새 참조를 반환합니다.

const QChar QStringRef::at(int position) const

문자열 참조에서 주어진 인덱스 position 에 있는 문자를 반환합니다.

position 은 문자열에서 유효한 인덱스 위치여야 합니다(즉, 0 <= position < size()).

QChar QStringRef::back() const

문자열의 마지막 문자를 반환합니다. at(size() - 1) 와 동일합니다.

이 함수는 STL 호환성을 위해 제공됩니다.

경고: 빈 문자열에서 이 함수를 호출하면 정의되지 않은 동작이 발생합니다.

front(), at() 및 operator[]()도 참조하세요 .

QStringRef::const_iterator QStringRef::begin() const

문자열의 첫 번째 문자를 가리키는 상수 STL 스타일 이터레이터를 반환합니다.

cbegin(), constBegin(), end(), constEnd(), rbegin(), rend()도 참조하세요 .

QStringRef::const_iterator QStringRef::cbegin() const

begin()와 동일합니다.

begin(), constBegin(), cend(), constEnd(), rbegin() 및 rend()도 참조하세요 .

QStringRef::const_iterator QStringRef::cend() const

end()와 동일합니다.

end(), constEnd(), cbegin(), constBegin(), rbegin() 및 rend()도 참조하세요 .

[noexcept] void QStringRef::chop(int n)

문자열 끝에서 n 문자를 제거합니다.

nsize()보다 크거나 같으면 결과는 빈 문자열이 되고 n 가 음수이면 0을 전달하는 것과 같습니다.

QString::chop() 및 truncate()도 참조하세요 .

QStringRef QStringRef::chopped(int len) const

이 문자열의 가장 왼쪽 문자 size() - len 에 대한 하위 문자열 참조를 반환합니다.

참고: len 가 음수이거나 size()보다 크면 동작이 정의되지 않습니다.

endsWith(), left(), right(), mid(), chop() 및 truncate()도 참조하세요 .

void QStringRef::clear()

문자열 참조의 내용을 널로 비워 지웁니다.

isEmpty() 및 isNull()도 참조하세요 .

[static noexcept] int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)

s1s2 을 비교하여 s1s2 보다 작으면 음의 정수를, s2 보다 크면 양의 정수를, 같으면 0을 반환합니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않으면 대소문자를 구분하지 않습니다.

[noexcept] int QStringRef::compare(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 오버로드된 함수입니다.

*thisch 을 비교하여 *thisch 보다 작으면 음의 정수를, ch 보다 크면 양의 정수를, 같으면 0을 반환합니다. 여기서 ch 은 길이 1의 문자열로 해석됩니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않은 경우 대소문자를 구분하지 않습니다.

[noexcept] int QStringRef::compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 오버로드된 함수입니다.

*thisother 을 비교하여 *thisother 보다 작으면 음의 정수를, other 보다 크면 양의 정수를, 같으면 0을 반환합니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않으면 대소문자를 구분하지 않습니다.

compare(*this, other, cs) 와 같습니다.

int QStringRef::compare(const QByteArray &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 오버로드된 함수입니다.

*thisother 을 비교하여 *thisother 보다 작으면 음의 정수를, other 보다 크면 양의 정수를, 같으면 0을 반환합니다. other 의 내용은 UTF-8로 해석됩니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않은 경우 대소문자를 구분하지 않습니다.

compare(*this, other, cs) 와 같습니다.

[noexcept] int QStringRef::compare(const QString &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 오버로드된 함수입니다.

*thisother 을 비교하여 *thisother 보다 작으면 음의 정수를, other 보다 크면 양의 정수를, 같으면 0을 반환합니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않으면 대소문자를 구분하지 않습니다.

compare(*this, other, cs) 와 같습니다.

[noexcept] int QStringRef::compare(const QStringRef &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 오버로드된 함수입니다.

*thisother 을 비교하여 *thisother 보다 작으면 음의 정수를, other 보다 크면 양의 정수를, 같으면 0을 반환합니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않으면 대소문자를 구분하지 않습니다.

compare(*this, other, cs) 과 같습니다.

[static noexcept] int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)

이 함수는 오버로드된 함수입니다.

s1s2 을 비교하여 s1s2 보다 작으면 음의 정수를, s2 보다 크면 양의 정수를, 같으면 0을 반환합니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않은 경우 대소문자를 구분하지 않습니다.

[static noexcept] int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)

이 함수는 오버로드된 함수입니다.

s1s2 을 비교하여 s1s2 보다 작으면 음의 정수를, s2 보다 크면 양의 정수를, 같으면 0을 반환합니다.

csQt::CaseSensitive 인 경우 비교는 대소문자를 구분하며, 그렇지 않은 경우 대소문자를 구분하지 않습니다.

QStringRef::const_iterator QStringRef::constBegin() const

begin()와 동일합니다.

begin(), cend(), constEnd(), rbegin() 및 rend()도 참조하세요 .

const QChar *QStringRef::constData() const

unicode()와 동일합니다.

QStringRef::const_iterator QStringRef::constEnd() const

end()와 동일합니다.

end(), cend(), cbegin(), constBegin(), rbegin() 및 rend()도 참조하세요 .

bool QStringRef::contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 문자열 참조에 str 문자열이 포함되어 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

csQt::CaseSensitive (기본값)인 경우 검색은 대소문자를 구분하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

indexOf() 및 count()도 참조하세요 .

bool QStringRef::contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 contains()를 오버로드합니다.

문자열에 ch 문자가 포함된 경우 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

bool QStringRef::contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 contains()를 오버로드합니다.

이 문자열 참조에 str 문자열이 포함되어 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

csQt::CaseSensitive (기본값)인 경우 검색은 대소문자를 구분하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

indexOf() 및 count()도 참조하세요 .

[noexcept] bool QStringRef::contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 contains()를 오버로드합니다.

이 문자열 참조에 str 문자열 보기가 포함된 경우 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

csQt::CaseSensitive (기본값)인 경우 검색은 대소문자를 구분하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

indexOf() 및 count()도 참조하세요 .

bool QStringRef::contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 contains()를 오버로드합니다.

이 문자열 참조에 str 문자열 참조가 포함되어 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

csQt::CaseSensitive (기본값)인 경우 검색은 대소문자를 구분하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

indexOf() 및 count()도 참조하세요 .

int QStringRef::count() const

문자열 참조가 참조하는 문자 수를 반환합니다. size () 및 length()에 해당합니다.

position() 및 string()도 참조하세요 .

int QStringRef::count(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 문자열 참조에서 str 문자열의 (중복될 수 있는) 발생 횟수를 반환합니다.

csQt::CaseSensitive (기본값)인 경우 검색은 대소문자를 구분하며, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::count(), contains() 및 indexOf()도 참조하세요 .

int QStringRef::count(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 count()를 오버로드합니다.

문자열 참조에서 ch 문자의 발생 횟수를 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::count(), contains() 및 indexOf()도 참조하세요 .

int QStringRef::count(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 count()를 오버로드합니다.

이 문자열 참조에서 str 문자열 참조의 (중복될 수 있는) 발생 횟수를 반환합니다.

csQt::CaseSensitive (기본값)인 경우 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::count(), contains() 및 indexOf()도 참조하세요 .

QStringRef::const_reverse_iterator QStringRef::crbegin() const

rbegin()와 동일합니다.

begin(), rbegin() 및 rend()도 참조하세요 .

QStringRef::const_reverse_iterator QStringRef::crend() const

rend()와 동일합니다.

end(), rend() 및 rbegin()도 참조하세요 .

const QChar *QStringRef::data() const

unicode()와 동일합니다.

QStringRef::const_iterator QStringRef::end() const

목록의 마지막 문자 뒤에 있는 가상의 문자를 가리키는 상수 STL 스타일 이터레이터를 반환합니다.

cbegin(), constBegin(), end(), constEnd(), rbegin(), rend()도 참조하세요 .

bool QStringRef::endsWith(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

문자열 참조가 str 으로 끝나면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::endsWith() 및 startsWith()도 참조하세요 .

bool QStringRef::endsWith(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 endsWith()를 오버로드합니다.

문자열 참조가 ch 으로 끝나면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않고 검색합니다.

QString::endsWith() 및 endsWith()도 참조하세요 .

bool QStringRef::endsWith(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 endWith()를 오버로드합니다.

QString::endsWith() 및 endsWith()도 참조하세요 .

[noexcept] bool QStringRef::endsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 endWith()를 오버로드합니다.

QString::endsWith() 및 startsWith()도 참조하세요 .

bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 endWith()를 오버로드합니다.

QString::endsWith() 및 endsWith()도 참조하세요 .

QChar QStringRef::front() const

문자열의 첫 번째 문자를 반환합니다. at(0) 와 동일합니다.

이 함수는 STL 호환성을 위해 제공됩니다.

경고: 빈 문자열에서 이 함수를 호출하면 정의되지 않은 동작이 발생합니다.

back(), at() 및 operator[]()도 참조하세요 .

int QStringRef::indexOf(QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 문자열 참조에서 str 문자열이 처음 나오는 인덱스 위치를 반환하며, 인덱스 위치 from 에서 앞으로 검색합니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

from 가 -1이면 마지막 문자부터 검색이 시작되고, -2이면 그 다음 마지막 문자부터 검색이 시작됩니다.

QString::indexOf(), lastIndexOf(), contains() 및 count()도 참조하세요 .

int QStringRef::indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 문자열 참조에서 str 문자열이 처음 나오는 인덱스 위치를 반환하며, 인덱스 위치 from 에서 앞으로 검색합니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

from 가 -1이면 마지막 문자부터 검색이 시작되고, -2이면 그 다음 마지막 문자부터 검색이 시작됩니다.

QString::indexOf(), lastIndexOf(), contains() 및 count()도 참조하세요 .

int QStringRef::indexOf(QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 indexOf()를 오버로드합니다.

인덱스 위치 from 에서 앞으로 검색하여 문자열 참조에서 ch 문자가 처음 나오는 인덱스 위치를 반환합니다. ch 를 찾을 수 없으면 -1을 반환합니다.

QString::indexOf(), lastIndexOf(), contains() 및 count()도 참조하세요 .

[noexcept] int QStringRef::indexOf(QStringView str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 indexOf()를 오버로드합니다.

이 문자열 참조에서 문자열 보기 str 의 첫 번째 발생 인덱스 위치를 반환하며, 인덱스 위치 from 에서 앞으로 검색합니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

from 가 -1이면 마지막 문자부터 검색이 시작되고, -2이면 그 다음 마지막 문자부터 검색이 시작됩니다.

QString::indexOf(), QStringView::indexOf(), lastIndexOf(), contains() 및 count()도 참조하세요 .

int QStringRef::indexOf(const QStringRef &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 indexOf()를 오버로드합니다.

이 문자열 참조에서 str 문자열 참조가 처음 나오는 인덱스 위치를 반환하며, 인덱스 위치 from 에서 앞으로 검색합니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)인 경우 대소문자를 구분하여 검색하고, 그렇지 않은 경우 대소문자를 구분하지 않습니다.

QString::indexOf(), lastIndexOf(), contains() 및 count()도 참조하세요 .

bool QStringRef::isEmpty() const

문자열 참조에 문자가 없는 경우 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

문자열 참조의 크기가 0이면 비어 있습니다.

size()도 참조하세요 .

bool QStringRef::isNull() const

이 문자열 참조가 문자열을 참조하지 않거나 참조하는 문자열이 null인 경우(즉, QString::isNull()이 참인 경우) true 을 반환합니다.

size()도 참조하십시오 .

bool QStringRef::isRightToLeft() const

문자열을 오른쪽에서 왼쪽으로 읽으면 true 을 반환합니다.

QString::isRightToLeft()도 참조하세요 .

int QStringRef::lastIndexOf(const QString &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

인덱스 위치 from 에서 역방향으로 검색하여 이 문자열 참조에서 str 문자열이 마지막으로 발생한 인덱스 위치를 반환합니다. from 가 -1(기본값)이면 마지막 문자부터 검색이 시작되고 from 가 -2이면 그 다음 마지막 문자부터 검색하는 식으로 검색이 시작됩니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::lastIndexOf(), indexOf(), contains() 및 count()도 참조하세요 .

int QStringRef::lastIndexOf(QChar ch, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 lastIndexOf()를 오버로드합니다.

from 위치에서 역순으로 검색하여 ch 문자가 마지막으로 발생한 인덱스 위치를 반환합니다.

QString::lastIndexOf(), indexOf(), contains() 및 count()도 참조하세요 .

int QStringRef::lastIndexOf(QLatin1String str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 lastIndexOf()를 오버로드합니다.

이 문자열 참조에서 str 문자열이 마지막으로 발생한 인덱스 위치를 반환하며, 인덱스 위치 from 에서 역방향으로 검색합니다. from 가 -1(기본값)이면 마지막 문자에서 검색을 시작하고 from 가 -2이면 마지막 문자 다음에서 검색하는 식으로 검색합니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::lastIndexOf(), indexOf(), contains() 및 count()도 참조하세요 .

[noexcept] int QStringRef::lastIndexOf(QStringView str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 lastIndexOf()를 오버로드합니다.

인덱스 위치 from 에서 역방향으로 검색하여 이 문자열에서 마지막으로 나타나는 문자열 보기 str 의 인덱스 위치를 반환합니다. from 이 -1(기본값)이면 마지막 문자에서 검색을 시작하고 from 이 -2이면 마지막 문자 다음에서 검색하는 식으로 검색합니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

indexOf(), contains() 및 count()도 참조하세요 .

int QStringRef::lastIndexOf(const QStringRef &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 lastIndexOf()를 오버로드합니다.

이 문자열 참조 str 에서 마지막으로 발생한 문자열 참조의 인덱스 위치를 반환하며, 인덱스 위치 from 에서 역방향으로 검색합니다. from 이 -1(기본값)이면 마지막 문자에서 검색을 시작하고 from 이 -2이면 마지막 문자 다음에서 검색하는 식으로 검색합니다. str 을 찾을 수 없으면 -1을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::lastIndexOf(), indexOf(), contains() 및 count()도 참조하세요 .

QStringRef QStringRef::left(int n) const

문자열의 가장 왼쪽 문자 n 에 대한 하위 문자열 참조를 반환합니다.

nsize()보다 크거나 같거나 0보다 작으면 전체 문자열에 대한 참조가 반환됩니다.

right(), mid(), startsWith(), chopped(), chop() 및 truncate()도 참조하세요 .

int QStringRef::length() const

문자열 참조가 참조하는 문자 수를 반환합니다. size () 및 count()에 해당합니다.

position() 및 string()도 참조하세요 .

[static] int QStringRef::localeAwareCompare(const QStringRef &s1, const QString &s2)

s1s2 을 비교하여 s1s2 보다 작으면 음의 정수를, s2 보다 크면 양의 정수를, 같으면 0을 반환합니다.

비교는 로캘 및 플랫폼에 따라 달라집니다. 이 함수를 사용하여 사용자에게 정렬된 문자열 목록을 표시합니다.

compare(), QLocale, Comparing Strings참조하세요 .

int QStringRef::localeAwareCompare(const QString &other) const

이 함수는 오버로드된 함수입니다.

*thisother 을 비교하여 *thisother 보다 작으면 음의 정수를, other 보다 크면 양의 정수를, 같으면 0을 반환합니다.

비교는 로캘 및 플랫폼에 따라 달라집니다. 이 함수를 사용하여 사용자에게 정렬된 문자열 목록을 표시합니다.

Comparing Strings도 참조하세요 .

int QStringRef::localeAwareCompare(const QStringRef &other) const

이 함수는 오버로드된 함수입니다.

*thisother 을 비교하여 *thisother 보다 작으면 음의 정수를, other 보다 크면 양의 정수를, 같으면 0을 반환합니다.

비교는 로캘 및 플랫폼에 따라 달라집니다. 이 함수를 사용하여 사용자에게 정렬된 문자열 목록을 표시합니다.

Comparing Strings도 참조하세요 .

[static] int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef &s2)

이 함수는 오버로드된 함수입니다.

s1s2 을 비교하여 s1s2 보다 작으면 음의 정수를, s2 보다 크면 양의 정수를, 같으면 0을 반환합니다.

비교는 로캘 및 플랫폼에 따라 달라집니다. 이 함수를 사용하여 사용자에게 정렬된 문자열 목록을 표시합니다.

Comparing Strings도 참조하세요 .

QStringRef QStringRef::mid(int position, int n = -1) const

지정된 position 에서 시작하여 이 문자열의 n 문자에 대한 하위 문자열 참조를 반환합니다.

position 가 문자열 길이를 초과하면 null 참조가 반환됩니다.

지정된 position 에서 시작하여 문자열에 사용 가능한 문자가 n 미만인 경우 또는 n 이 -1(기본값)인 경우 이 함수는 지정된 position 이후부터 모든 문자를 반환합니다.

left(), right(), chopped(), chop() 및 truncate()도 참조하세요 .

int QStringRef::position() const

문자열 참조가 참조하는 참조 문자열에서 시작 위치를 반환합니다.

size() 및 string()도 참조하세요 .

QStringRef::const_reverse_iterator QStringRef::rbegin() const

문자열의 첫 번째 문자를 역순으로 가리키는 상수 STL 스타일 리버스 이터레이터를 반환합니다.

begin(), crbegin() 및 rend()도 참조하세요 .

QStringRef::const_reverse_iterator QStringRef::rend() const

문자열의 마지막 문자 뒤의 문자를 역순으로 가리키는 STL 스타일 역이터레이터를 반환합니다.

end(), crend() 및 rbegin()도 참조하세요 .

문자열의 가장 오른쪽 문자 n 에 대한 하위 문자열 참조를 반환합니다.

nsize()보다 크거나 같거나 0보다 작으면 전체 문자열에 대한 참조가 반환됩니다.

left(), mid(), endsWith(), chopped(), chop() 및 truncate()도 참조하세요 .

int QStringRef::size() const

문자열 참조가 참조하는 문자 수를 반환합니다. length () 및 count()에 해당합니다.

position() 및 string()도 참조하세요 .

QList<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

sep 이 발생할 때마다 문자열을 하위 문자열 참조로 분할하고 해당 문자열의 목록을 반환합니다.

sep, behaviorcs 이 상호 작용하여 결과를 형성하는 방법은 QString::split()를 참조하세요.

참고: 이 문자열이 살아있는 한 모든 참조는 유효합니다. 이 문자열을 삭제하면 모든 참조가 댕글링 포인터가 됩니다.

QList<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

과부하가 걸린 기능입니다.

bool QStringRef::startsWith(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

문자열 참조가 str 으로 시작하면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

csQt::CaseSensitive (기본값)이면 대소문자를 구분하여 검색하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::startsWith() 및 endsWith()도 참조하세요 .

bool QStringRef::startsWith(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 startsWith()를 오버로드합니다.

문자열 참조가 ch 으로 시작하면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

csQt::CaseSensitive (기본값)인 경우 검색은 대소문자를 구분하고, 그렇지 않으면 대소문자를 구분하지 않습니다.

QString::startsWith() 및 endsWith()도 참조하세요 .

bool QStringRef::startsWith(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 startsWith()를 오버로드합니다.

QString::startsWith() 및 endsWith()도 참조하세요 .

[noexcept] bool QStringRef::startsWith(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 startsWith()를 오버로드합니다.

QString::startsWith() 및 endsWith()도 참조하세요 .

bool QStringRef::startsWith(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const

이 함수는 startsWith()를 오버로드합니다.

QString::startsWith() 및 endsWith()도 참조하세요 .

const QString *QStringRef::string() const

문자열 참조가 참조하는 문자열에 대한 포인터를 반환하거나 문자열을 참조하지 않는 경우 0을 반환합니다.

unicode()도 참조하세요 .

double QStringRef::toDouble(bool *ok = nullptr) const

double 값으로 변환된 문자열을 반환합니다.

변환이 오버플로되면 무한대를 반환하고, 다른 이유(예: 언더플로)로 변환에 실패하면 0.0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

문자열 변환은 항상 'C' 로캘에서 수행됩니다. 로캘 종속 변환의 경우 QLocale::toDouble()를 사용합니다.

역사적인 이유로 이 함수는 수천 개의 그룹 구분 기호를 처리하지 않습니다. 이러한 숫자를 변환해야 하는 경우 QLocale::toDouble()를 사용하세요.

QString::toDouble()도 참조하세요 .

float QStringRef::toFloat(bool *ok = nullptr) const

float 값으로 변환된 문자열을 반환합니다.

변환이 오버플로되면 무한대를 반환하고, 다른 이유(예: 언더플로)로 변환에 실패하면 0.0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

문자열 변환은 항상 'C' 로캘에서 수행됩니다. 로캘 종속 변환의 경우 QLocale::toFloat()를 사용합니다.

QString::toFloat()도 참조하세요 .

int QStringRef::toInt(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 int 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toInt()를 사용합니다.

QString::toInt()도 참조하세요 .

QByteArray QStringRef::toLatin1() const

문자열의 라틴 1 표현을 QByteArray 로 반환합니다.

문자열에 라틴 1이 아닌 문자가 포함된 경우 반환되는 바이트 배열은 정의되지 않습니다. 이러한 문자는 억제되거나 물음표로 대체될 수 있습니다.

toUtf8(), toLocal8Bit() 및 QStringEncoder참조하세요 .

QByteArray QStringRef::toLocal8Bit() const

문자열의 로컬 8비트 표현을 QByteArray 로 반환합니다. 문자열에 로컬 8비트 인코딩에서 지원하지 않는 문자가 포함된 경우 반환되는 바이트 배열은 정의되지 않습니다.

Unix 시스템에서는 toUtf8()에 해당하며, Windows에서는 시스템의 현재 코드 페이지가 사용됩니다.

이 문자열에 로캘에서 인코딩할 수 없는 문자가 포함되어 있으면 반환된 바이트 배열이 정의되지 않습니다. 이러한 문자는 억제되거나 다른 문자로 대체될 수 있습니다.

toLatin1(), toUtf8() 및 QStringEncoder참조하세요 .

long QStringRef::toLong(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 long 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toLong()를 사용합니다.

QString::toLong()도 참조하세요 .

qlonglong QStringRef::toLongLong(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 long long 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toLongLong()를 사용합니다.

QString::toLongLong()도 참조하세요 .

short QStringRef::toShort(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 short 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toShort()를 사용합니다.

QString::toShort()도 참조하세요 .

QString QStringRef::toString() const

문자열 참조의 복사본을 QString 객체로 반환합니다.

문자열 참조가 문자열의 완전한 참조가 아닌 경우( position()가 0이고 size()가 string()->size()와 같은 경우), 이 함수는 반환할 새 문자열을 할당합니다.

string()도 참조하세요 .

uint QStringRef::toUInt(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 unsigned int 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toUInt()를 사용합니다.

QString::toUInt()도 참조하세요 .

ulong QStringRef::toULong(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 unsigned long 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toULongLong()를 사용합니다.

QString::toULong()도 참조하세요 .

qulonglong QStringRef::toULongLong(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 unsigned long long 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toULongLong()를 사용합니다.

QString::toULongLong()도 참조하세요 .

ushort QStringRef::toUShort(bool *ok = nullptr, int base = 10) const

기본값은 10이며 2에서 36 사이 또는 0이어야 하는 base 을 사용하여 unsigned short 으로 변환된 문자열을 반환합니다. 변환에 실패하면 0을 반환합니다.

oknullptr 이 아닌 경우 실패는 *okfalse 로 설정하여 보고하고 성공은 *oktrue 로 설정하여 보고합니다.

base 가 0이면 C 언어 규칙이 사용됩니다: 문자열이 "0x"로 시작하면 16진법이 사용되며, 문자열이 "0"으로 시작하면 8진법이 사용되며, 그렇지 않으면 10진법이 사용됩니다.

문자열 변환은 항상 'C' 로캘에서 이루어집니다. 로캘 종속 변환의 경우 QLocale::toUShort()를 사용합니다.

QString::toUShort()도 참조하세요 .

QList<uint> QStringRef::toUcs4() const

문자열의 UCS-4/UTF-32 표현을 QList<uint>로 반환합니다.

UCS-4는 유니코드 코덱이므로 무손실입니다. 이 문자열의 모든 문자는 UCS-4로 인코딩됩니다. 이 문자열의 유효하지 않은 코드 단위 시퀀스는 유니코드의 대체 문자(QChar::ReplacementCharacter, U+FFFD 에 해당)로 대체됩니다.

반환된 목록은 \0'-종료되지 않습니다.

toUtf8(), toLatin1(), toLocal8Bit() 및 QStringEncoder도 참조하세요 .

QByteArray QStringRef::toUtf8() const

문자열의 UTF-8 표현을 QByteArray 로 반환합니다.

UTF-8은 유니코드 코덱이며 QString 와 같은 유니코드 문자열의 모든 문자를 표현할 수 있습니다.

toLatin1(), toLocal8Bit() 및 QStringEncoder도 참조하세요 .

QStringRef QStringRef::trimmed() const

시작과 끝에서 공백이 제거된 문자열을 반환합니다.

공백은 QChar::isSpace()가 true 을 반환하는 모든 문자를 의미합니다. 여기에는 ASCII 문자 '\t', '\n', '\v', '\f', '\r' 및 ' ' 등이 포함됩니다.

QString::simplified()와 달리 trimmed()는 내부 공백을 그대로 둡니다.

QString::trimmed()도 참조하세요 .

[noexcept] void QStringRef::truncate(int position)

지정된 position 인덱스에서 문자열을 잘라냅니다.

지정된 position 인덱스가 문자열의 끝을 넘어가면 아무 일도 일어나지 않습니다.

position 이 음수이면 0을 전달하는 것과 같습니다.

QString::truncate()도 참조하세요 .

const QChar *QStringRef::unicode() const

문자열 참조의 유니코드 표현을 반환합니다. 데이터는 참조된 문자열에서 직접 파생되므로 문자열 참조에 문자열의 널 종결자가 포함되지 않는 한 \0'-종결되지 않습니다.

string()도 참조하세요 .

bool QStringRef::operator!=(const char *s) const

이 함수는 연산자!=()를 오버로드합니다.

s const char 포인터는 fromUtf8() 함수를 사용하여 QStringRef 로 변환됩니다.

애플리케이션을 컴파일할 때 QT_NO_CAST_FROM_ASCII 을 정의하여 이 연산자를 비활성화할 수 있습니다. 예를 들어 사용자가 볼 수 있는 모든 문자열이 QObject::tr()를 거치도록 하려는 경우 유용할 수 있습니다.

이 문자열이 매개변수 문자열 s 과 어휘적으로 같지 않은 경우 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

QT_NO_CAST_FROM_ASCII참조하세요 .

bool QStringRef::operator<(const char *s) const

이 함수는 연산자<()를 오버로드합니다.

s const char 포인터는 fromUtf8() 함수를 사용하여 QStringRef 로 변환됩니다.

애플리케이션을 컴파일할 때 QT_NO_CAST_FROM_ASCII 을 정의하여 이 연산자를 비활성화할 수 있습니다. 예를 들어 사용자가 볼 수 있는 모든 문자열이 QObject::tr()를 거치도록 하려는 경우 유용할 수 있습니다.

이 문자열이 매개변수 문자열 s 보다 어휘적으로 작은 경우 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

QT_NO_CAST_FROM_ASCII참조하세요 .

bool QStringRef::operator<=(const char *s) const

이 함수는 연산자<=()를 오버로드합니다.

s const char 포인터는 fromUtf8() 함수를 사용하여 QStringRef 로 변환됩니다.

애플리케이션을 컴파일할 때 QT_NO_CAST_FROM_ASCII 을 정의하여 이 연산자를 비활성화할 수 있습니다. 예를 들어 사용자가 볼 수 있는 모든 문자열이 QObject::tr()를 거치도록 하려는 경우 유용할 수 있습니다.

이 문자열이 매개변수 문자열 s 보다 어휘적으로 작거나 같으면 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

QT_NO_CAST_FROM_ASCII도 참조하세요 .

QStringRef &QStringRef::operator=(const QString *string)

주어진 string 에 대한 문자열 참조를 생성하고 이 문자열 참조에 할당하여 결과를 반환합니다.

[noexcept default] QStringRef &QStringRef::operator=(const QStringRef &other)

other 문자열 참조를 이 문자열 참조에 할당하고 결과를 반환합니다.

bool QStringRef::operator==(const char *s) const

이 함수는 연산자==()를 오버로드합니다.

s 바이트 배열은 fromUtf8() 함수를 사용하여 QStringRef 로 변환됩니다. 이 함수는 처음 발견되는 NUL 문자 또는 바이트 배열의 끝에서 변환을 중지합니다.

애플리케이션을 컴파일할 때 QT_NO_CAST_FROM_ASCII 을 정의하여 이 연산자를 비활성화할 수 있습니다. 예를 들어 사용자가 볼 수 있는 모든 문자열이 QObject::tr()를 거치도록 하려는 경우 유용할 수 있습니다.

이 문자열이 매개변수 문자열 s 과 어휘적으로 같으면 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

QT_NO_CAST_FROM_ASCII참조하세요 .

bool QStringRef::operator>(const char *s) const

이 함수는 연산자>()를 오버로드합니다.

s const 문자 포인터는 fromUtf8() 함수를 사용하여 QStringRef 로 변환됩니다.

애플리케이션을 컴파일할 때 QT_NO_CAST_FROM_ASCII 을 정의하여 이 연산자를 비활성화할 수 있습니다. 예를 들어 사용자가 볼 수 있는 모든 문자열이 QObject::tr()를 거치도록 하려는 경우 유용할 수 있습니다.

이 문자열이 매개변수 문자열 s 보다 어휘적으로 큰 경우 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

QT_NO_CAST_FROM_ASCII참조하세요 .

bool QStringRef::operator>=(const char *s) const

이 함수는 연산자>=()를 오버로드합니다.

s const 문자 포인터는 fromUtf8() 함수를 사용하여 QStringRef 로 변환됩니다.

애플리케이션을 컴파일할 때 QT_NO_CAST_FROM_ASCII 을 정의하여 이 연산자를 비활성화할 수 있습니다. 예를 들어 사용자가 볼 수 있는 모든 문자열이 QObject::tr()를 거치도록 하려는 경우 유용할 수 있습니다.

이 문자열이 어휘적으로 매개변수 문자열 s 보다 크거나 같으면 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.

QT_NO_CAST_FROM_ASCII참조하세요 .

QChar QStringRef::operator[](int position) const

문자열 참조에서 지정된 인덱스 position 에 있는 문자를 반환합니다.

position 은 문자열 참조에서 유효한 인덱스 위치여야 합니다(즉, 0 <= position < size()).

at()도 참조하세요 .

관련 비회원

[noexcept] bool operator<(const QStringRef &s1, const QStringRef &s2)

문자열 참조 s1 가 문자열 참조 s2 보다 어휘적으로 작으면 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

Comparing Strings참조하세요 .

[noexcept] bool operator<=(const QStringRef &s1, const QStringRef &s2)

문자열 참조 s1 가 어휘적으로 문자열 참조 s2 보다 작거나 같으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

Comparing Strings참조하세요 .

[noexcept] bool operator==(QLatin1String s1, const QStringRef &s2)

문자열 s1 이 문자열 참조 s2 와 어휘적으로 같으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

[noexcept] bool operator==(const QString &s1, const QStringRef &s2)

문자열 s1 이 문자열 참조 s2 와 어휘적으로 같으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

[noexcept] bool operator==(const QStringRef &s1, const QStringRef &s2)

문자열 참조 s1 가 문자열 참조 s2 와 어휘적으로 같으면 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

[noexcept] bool operator>(const QStringRef &s1, const QStringRef &s2)

문자열 참조 s1 가 문자열 참조 s2 보다 어휘적으로 크면 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

Comparing Strings참조하세요 .

[noexcept] bool operator>=(const QStringRef &s1, const QStringRef &s2)

문자열 참조 s1 가 어휘적으로 문자열 참조 s2 보다 크거나 같으면 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

Comparing Strings참조하세요 .

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.