QLatin1StringMatcher Class
라틴어-1 텍스트의 하위 문자열 검색을 최적화했습니다. 더 보기...
Header: | #include <QLatin1StringMatcher> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
이후: | Qt 6.5 |
- 상속된 멤버를 포함한 모든 멤버의 목록
- QLatin1StringMatcher는 문자열 데이터용 클래스의 일부입니다.
공용 함수
QLatin1StringMatcher() | |
QLatin1StringMatcher(QLatin1StringView pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive) | |
~QLatin1StringMatcher() | |
Qt::CaseSensitivity | caseSensitivity() const |
qsizetype | indexIn(QLatin1StringView haystack, qsizetype from = 0) const |
(since 6.8) qsizetype | indexIn(QStringView haystack, qsizetype from = 0) const |
QLatin1StringView | pattern() const |
void | setCaseSensitivity(Qt::CaseSensitivity cs) |
void | setPattern(QLatin1StringView pattern) |
상세 설명
QLatin1StringMatcher는 대소문자를 무시하거나 대소문자를 고려하여 QLatin1StringView 를 다른 문자열의 하위 문자열로 검색할 수 있습니다.
이 클래스는 라틴 1로 인코딩된 문자열을 일부 QLatin1StringView에서 반복적으로 검색하려는 경우(아마도 루프에서) 또는 주어진 QLatin1StringView 에서 모든 인스턴스를 검색하려는 경우에 유용합니다. 반복적으로 일치하는 경우 일치자 객체와 indexIn()를 사용하는 것이 일반 QLatin1StringView 과 QLatin1StringView::indexOf()를 일치시키는 것보다 빠릅니다. 이 클래스는 일회성 일치를 수행하는 경우에는 이점을 제공하지 않습니다. 검색할 문자열을 검색할 때 매처가 문자열에 액세스하므로 매처 객체가 소멸되기 전에 검색할 문자열이 소멸되거나 변경되어서는 안 됩니다.
검색하려는 QLatin1StringView 및 대소문자 구분을 위한 QLatin1StringMatcher를 생성합니다. 그런 다음 검색하려는 QLatin1StringView 을 사용하여 indexIn()를 호출합니다.
QLatin1StringView, QStringMatcher, QByteArrayMatcher 를참조하세요 .
멤버 함수 문서
[noexcept]
QLatin1StringMatcher::QLatin1StringMatcher()
빈 라틴-1 문자열 일치자를 생성합니다. 이것은 모든 문자열의 각 위치에서 일치합니다.
setPattern(), setCaseSensitivity() 및 indexIn()도 참조하세요 .
[explicit noexcept]
QLatin1StringMatcher::QLatin1StringMatcher(QLatin1StringView pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive)
주어진 대소문자 구분을 사용하여 주어진 pattern 을 검색하는 라틴-1 문자열 일치자 cs 를 구축합니다. pattern 인수는 이 일치자 객체 앞에 파괴되지 않아야 합니다. indexIn ()를 호출하여 주어진 QLatin1StringView 에서 pattern 을 찾습니다.
[noexcept]
QLatin1StringMatcher::~QLatin1StringMatcher()
Latin-1 문자열 일치자를 파괴합니다.
[noexcept]
Qt::CaseSensitivity QLatin1StringMatcher::caseSensitivity() const
매칭기가 사용하는 대/소문자 구분을 반환합니다.
setCaseSensitivity() 및 indexIn()도 참조하세요 .
[noexcept]
qsizetype QLatin1StringMatcher::indexIn(QLatin1StringView haystack, qsizetype from = 0) const
from 에서 시작하여 주어진 haystack 에서 패턴을 검색합니다.
caseSensitivity() 및 pattern()도 참조하세요 .
[noexcept, since 6.8]
qsizetype QLatin1StringMatcher::indexIn(QStringView haystack, qsizetype from = 0) const
이것은 오버로드된 함수입니다.
인덱스 위치 from 에서 시작하여 주어진 haystack 에서 패턴을 검색합니다.
이 함수는 Qt 6.8에 도입되었습니다.
caseSensitivity() 및 pattern()도 참조하십시오 .
[noexcept]
QLatin1StringView QLatin1StringMatcher::pattern() const
매칭기가 검색하는 라틴-1 패턴을 반환합니다.
setPattern() 및 indexIn()도 참조하세요 .
[noexcept]
void QLatin1StringMatcher::setCaseSensitivity(Qt::CaseSensitivity cs)
대/소문자 구분을 cs 으로 설정합니다.
caseSensitivity() 및 indexIn()도 참조하세요 .
[noexcept]
void QLatin1StringMatcher::setPattern(QLatin1StringView pattern)
검색할 pattern 을 설정합니다. QLatin1StringView 가 가리키는 문자열은 수명이 더 긴 다른 pattern 을 먼저 가리키도록 설정하지 않는 한 일치기가 파괴되기 전에 파괴되어서는 안 됩니다.
© 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.