| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace unibrow { | 38 namespace unibrow { |
| 39 | 39 |
| 40 typedef unsigned int uchar; | 40 typedef unsigned int uchar; |
| 41 typedef unsigned char byte; | 41 typedef unsigned char byte; |
| 42 | 42 |
| 43 /** | 43 /** |
| 44 * The max length of the result of converting the case of a single | 44 * The max length of the result of converting the case of a single |
| 45 * character. | 45 * character. |
| 46 */ | 46 */ |
| 47 static const int kMaxMappingSize = 4; | 47 const int kMaxMappingSize = 4; |
| 48 | 48 |
| 49 template <class T, int size = 256> | 49 template <class T, int size = 256> |
| 50 class Predicate { | 50 class Predicate { |
| 51 public: | 51 public: |
| 52 inline Predicate() { } | 52 inline Predicate() { } |
| 53 inline bool get(uchar c); | 53 inline bool get(uchar c); |
| 54 private: | 54 private: |
| 55 friend class Test; | 55 friend class Test; |
| 56 bool CalculateValue(uchar c); | 56 bool CalculateValue(uchar c); |
| 57 struct CacheEntry { | 57 struct CacheEntry { |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 static const int kMaxWidth = 1; | 271 static const int kMaxWidth = 1; |
| 272 static int Convert(uchar c, | 272 static int Convert(uchar c, |
| 273 uchar n, | 273 uchar n, |
| 274 uchar* result, | 274 uchar* result, |
| 275 bool* allow_caching_ptr); | 275 bool* allow_caching_ptr); |
| 276 }; | 276 }; |
| 277 | 277 |
| 278 } // namespace unibrow | 278 } // namespace unibrow |
| 279 | 279 |
| 280 #endif // V8_UNICODE_H_ | 280 #endif // V8_UNICODE_H_ |
| OLD | NEW |