summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/MatchResult.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/runtime/MatchResult.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/runtime/MatchResult.h')
-rw-r--r--Source/JavaScriptCore/runtime/MatchResult.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/Source/JavaScriptCore/runtime/MatchResult.h b/Source/JavaScriptCore/runtime/MatchResult.h
index d87c8516b..71291379e 100644
--- a/Source/JavaScriptCore/runtime/MatchResult.h
+++ b/Source/JavaScriptCore/runtime/MatchResult.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,12 +23,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MatchResult_h
-#define MatchResult_h
+#pragma once
+
+#include <wtf/PrintStream.h>
+#include <wtf/Vector.h> // for notFound
+
+namespace JSC {
typedef uint64_t EncodedMatchResult;
struct MatchResult {
+ MatchResult()
+ : start(WTF::notFound)
+ , end(0)
+ {
+ }
+
ALWAYS_INLINE MatchResult(size_t start, size_t end)
: start(start)
, end(end)
@@ -51,10 +61,10 @@ struct MatchResult {
ALWAYS_INLINE static MatchResult failed()
{
- return MatchResult(WTF::notFound, 0);
+ return MatchResult();
}
- ALWAYS_INLINE operator bool()
+ ALWAYS_INLINE explicit operator bool() const
{
return start != WTF::notFound;
}
@@ -63,9 +73,11 @@ struct MatchResult {
{
return start == end;
}
+
+ void dump(PrintStream&) const;
size_t start;
size_t end;
};
-#endif
+} // namespace JSC