OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 9009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9020 // character or string equality and collating order defined in the Unicode | 9020 // character or string equality and collating order defined in the Unicode |
9021 // specification. Therefore String values that are canonically equal according | 9021 // specification. Therefore String values that are canonically equal according |
9022 // to the Unicode standard could test as unequal. In effect this algorithm | 9022 // to the Unicode standard could test as unequal. In effect this algorithm |
9023 // assumes that both Strings are already in normalized form. Also, note that | 9023 // assumes that both Strings are already in normalized form. Also, note that |
9024 // for strings containing supplementary characters, lexicographic ordering on | 9024 // for strings containing supplementary characters, lexicographic ordering on |
9025 // sequences of UTF-16 code unit values differs from that on sequences of code | 9025 // sequences of UTF-16 code unit values differs from that on sequences of code |
9026 // point values. | 9026 // point values. |
9027 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x, | 9027 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x, |
9028 Handle<String> y); | 9028 Handle<String> y); |
9029 | 9029 |
9030 // Perform string match of pattern on subject, starting at start index. | |
9031 // Caller must ensure that 0 <= start_index <= sub->length(), | |
9032 // and should check that pat->length() + start_index <= sub->length(). | |
Yang
2016/07/22 08:34:03
looks like this second requirement is not necessar
jgruber
2016/07/22 09:22:30
Done.
| |
9033 static int IndexOf(Isolate* isolate, Handle<String> sub, Handle<String> pat, | |
9034 int start_index); | |
9035 | |
9030 // String equality operations. | 9036 // String equality operations. |
9031 inline bool Equals(String* other); | 9037 inline bool Equals(String* other); |
9032 inline static bool Equals(Handle<String> one, Handle<String> two); | 9038 inline static bool Equals(Handle<String> one, Handle<String> two); |
9033 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); | 9039 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); |
9034 bool IsOneByteEqualTo(Vector<const uint8_t> str); | 9040 bool IsOneByteEqualTo(Vector<const uint8_t> str); |
9035 bool IsTwoByteEqualTo(Vector<const uc16> str); | 9041 bool IsTwoByteEqualTo(Vector<const uc16> str); |
9036 | 9042 |
9037 // Return a UTF8 representation of the string. The string is null | 9043 // Return a UTF8 representation of the string. The string is null |
9038 // terminated but may optionally contain nulls. Length is returned | 9044 // terminated but may optionally contain nulls. Length is returned |
9039 // in length_output if length_output is not a null pointer The string | 9045 // in length_output if length_output is not a null pointer The string |
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10995 } | 11001 } |
10996 return value; | 11002 return value; |
10997 } | 11003 } |
10998 }; | 11004 }; |
10999 | 11005 |
11000 | 11006 |
11001 } // NOLINT, false-positive due to second-order macros. | 11007 } // NOLINT, false-positive due to second-order macros. |
11002 } // NOLINT, false-positive due to second-order macros. | 11008 } // NOLINT, false-positive due to second-order macros. |
11003 | 11009 |
11004 #endif // V8_OBJECTS_H_ | 11010 #endif // V8_OBJECTS_H_ |
OLD | NEW |