이 페이지에서

QLatin1StringMatcher Class

Latin-1 텍스트에서 부분 문자열을 검색하는 기능이 최적화되었습니다. 더 보기...

헤더: #include <QLatin1StringMatcher>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
다음부터: Qt 6.5부터

공개 함수

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 을 다른 문자열의 부분 문자열로 검색할 수 있습니다.

이 클래스는 Latin-1로 인코딩된 문자열을 QLatin1StringViews에서 반복적으로(예: 루프 내에서) 검색하거나, 주어진 QLatin1StringView 내에서 해당 문자열의 모든 인스턴스를 검색하려는 경우에 유용합니다. 반복적인 매칭이 이루어지는 경우, 매처 객체와 indexIn()을 사용하는 것이 일반 QLatin1StringView 를 QLatin1StringView::indexOf()로 매칭하는 것보다 빠릅니다. 단 한 번만 일치 작업을 수행하는 경우에는 이 클래스가 별다른 이점을 제공하지 않습니다. 매처 객체가 소멸되기 전에는 검색 대상 문자열이 삭제되거나 변경되어서는 안 됩니다. 매처는 검색 시 해당 문자열에 직접 접근하기 때문입니다.

검색하려는 QLatin1StringView 와 대소문자 구분 설정에 따라 QLatin1StringMatcher를 생성하십시오. 그런 다음, 검색 대상인 QLatin1StringView 를 인수로 전달하여 indexIn()를 호출하십시오.

QLatin1StringView, QStringMatcher 및 QByteArrayMatcher도 참조하십시오 .

멤버 함수 문서

[noexcept] QLatin1StringMatcher::QLatin1StringMatcher()

빈 Latin-1 문자열 매처 객체를 생성합니다. 이 매처는 어떤 문자열이든 각 위치에서 일치합니다.

setPattern(), setCaseSensitivity(), indexIn()도 참조하십시오 .

[explicit noexcept] QLatin1StringMatcher::QLatin1StringMatcher(QLatin1StringView pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive)

지정된 대소문자 구분 방식 cs 에 따라 주어진 pattern 을 검색하는 Latin-1 문자열 매처 객체를 생성합니다. pattern 인자는 이 매처 객체보다 먼저 소멸되어서는 안 됩니다. 주어진 QLatin1StringView 에서 pattern 을 찾으려면 indexIn()을 호출하십시오.

[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

주어진 haystack 에서 인덱스 위치 from 부터 시작하여 해당 패턴을 검색합니다.

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

이 함수는 Qt 6.8에서 도입되었습니다.

caseSensitivity() 및 pattern()도 참조하십시오 .

[noexcept] QLatin1StringView QLatin1StringMatcher::pattern() const

매처가 검색할 Latin-1 패턴을 반환합니다.

setPattern() 및 indexIn()도 참조하십시오 .

[noexcept] void QLatin1StringMatcher::setCaseSensitivity(Qt::CaseSensitivity cs)

대소문자 구분을 cs 로 설정합니다.

caseSensitivity() 및 indexIn()도 참조하십시오 .

[noexcept] void QLatin1StringMatcher::setPattern(QLatin1StringView pattern)

검색할 pattern 를 설정합니다. QLatin1StringView 가 가리키는 문자열은, 먼저 수명이 더 긴 다른 pattern 를 가리키도록 설정되지 않는 한, 매처가 소멸되기 전에 소멸되어서는 안 됩니다.

pattern() 및 indexIn()도 참조하십시오 .

© 2026 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.