Add support for null StringViews
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 01:54:22 +0000 (01:54 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 01:54:22 +0000 (01:54 +0000)
commita1b9121a7271fbace64d1b8c79f1f7e7c4817c9a
tree3f00600d0b9aefcb6856fb649d565fe0f8dc1fdf
parentf8f7d4eb1c099176cf4264fde55f2c2eed73f899
Add support for null StringViews
https://bugs.webkit.org/show_bug.cgi?id=126827

Reviewed by Anders Carlsson.

Source/WTF:

- Do some style cleanup while in the neighborhood.

* wtf/text/StringView.h:
(WTF::StringView::StringView):
Add default constructor to create a null StringView.

(WTF::StringView::isNull):
Add isNull(), matching the semantics of String.

(WTF::StringView::operator bool):
Add an explicit operator bool() to allow use in if-statements.

Tools:

Add new test for StringView.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/StringView.cpp: Added.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringView.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WTF/StringView.cpp [new file with mode: 0644]