Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion include/kf/USimpleString.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ namespace kf
return const_cast<USimpleString*>(this)->end();
}

// Comparison
// Comparison return code meaning:
// Return code Description
// 0: this equals str
// <0: this is less than str
// >0: this is greater than str
inline int USimpleString::compareTo(_In_ const UNICODE_STRING& str) const
{
return ::RtlCompareUnicodeString(&m_str, &str, FALSE);
Expand Down Expand Up @@ -375,11 +379,13 @@ namespace kf
return equalsIgnoreCase(str.string());
}

// Case sensitive lexicographical comparison
inline bool USimpleString::operator<(_In_ const USimpleString& another) const
{
return compareTo(another) < 0;
}

// Case sensitive lexicographical comparison
inline bool USimpleString::operator==(_In_ const USimpleString& another) const
{
return equals(another);
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ wdk_add_driver(kf-test WINVER NTDDI_WIN10 STL
AutoSpinLockTest.cpp
EResourceSharedLockTest.cpp
RecursiveAutoSpinLockTest.cpp
USimpleStringTest.cpp
)

target_link_libraries(kf-test kf::kf kmtest::kmtest)
Expand Down
Loading