| 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 9013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9024 // character or string equality and collating order defined in the Unicode | 9024 // character or string equality and collating order defined in the Unicode |
| 9025 // specification. Therefore String values that are canonically equal according | 9025 // specification. Therefore String values that are canonically equal according |
| 9026 // to the Unicode standard could test as unequal. In effect this algorithm | 9026 // to the Unicode standard could test as unequal. In effect this algorithm |
| 9027 // assumes that both Strings are already in normalized form. Also, note that | 9027 // assumes that both Strings are already in normalized form. Also, note that |
| 9028 // for strings containing supplementary characters, lexicographic ordering on | 9028 // for strings containing supplementary characters, lexicographic ordering on |
| 9029 // sequences of UTF-16 code unit values differs from that on sequences of code | 9029 // sequences of UTF-16 code unit values differs from that on sequences of code |
| 9030 // point values. | 9030 // point values. |
| 9031 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x, | 9031 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x, |
| 9032 Handle<String> y); | 9032 Handle<String> y); |
| 9033 | 9033 |
| 9034 // Perform string match of pattern on subject, starting at start index. |
| 9035 // Caller must ensure that 0 <= start_index <= sub->length(). |
| 9036 static int IndexOf(Isolate* isolate, Handle<String> sub, Handle<String> pat, |
| 9037 int start_index); |
| 9038 |
| 9034 // String equality operations. | 9039 // String equality operations. |
| 9035 inline bool Equals(String* other); | 9040 inline bool Equals(String* other); |
| 9036 inline static bool Equals(Handle<String> one, Handle<String> two); | 9041 inline static bool Equals(Handle<String> one, Handle<String> two); |
| 9037 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); | 9042 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); |
| 9038 bool IsOneByteEqualTo(Vector<const uint8_t> str); | 9043 bool IsOneByteEqualTo(Vector<const uint8_t> str); |
| 9039 bool IsTwoByteEqualTo(Vector<const uc16> str); | 9044 bool IsTwoByteEqualTo(Vector<const uc16> str); |
| 9040 | 9045 |
| 9041 // Return a UTF8 representation of the string. The string is null | 9046 // Return a UTF8 representation of the string. The string is null |
| 9042 // terminated but may optionally contain nulls. Length is returned | 9047 // terminated but may optionally contain nulls. Length is returned |
| 9043 // in length_output if length_output is not a null pointer The string | 9048 // 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... |
| 10999 } | 11004 } |
| 11000 return value; | 11005 return value; |
| 11001 } | 11006 } |
| 11002 }; | 11007 }; |
| 11003 | 11008 |
| 11004 | 11009 |
| 11005 } // NOLINT, false-positive due to second-order macros. | 11010 } // NOLINT, false-positive due to second-order macros. |
| 11006 } // NOLINT, false-positive due to second-order macros. | 11011 } // NOLINT, false-positive due to second-order macros. |
| 11007 | 11012 |
| 11008 #endif // V8_OBJECTS_H_ | 11013 #endif // V8_OBJECTS_H_ |
| OLD | NEW |