#ifndef V8_STRINGS_STRING_SEARCH_H_
#define V8_STRINGS_STRING_SEARCH_H_
#include "src/base/strings.h"
#include "src/base/vector.h"
#include "src/execution/isolate.h"
#include "src/objects/string.h"
namespace v8 {
namespace internal {
class StringSearchBase { … };
template <typename PatternChar, typename SubjectChar>
class StringSearch : private StringSearchBase { … };
template <typename T, typename U>
inline T AlignDown(T value, U alignment) { … }
inline uint8_t GetHighestValueByte(base::uc16 character) { … }
inline uint8_t GetHighestValueByte(uint8_t character) { … }
template <typename PatternChar, typename SubjectChar>
inline int FindFirstCharacter(base::Vector<const PatternChar> pattern,
base::Vector<const SubjectChar> subject,
int index) { … }
template <typename PatternChar, typename SubjectChar>
int StringSearch<PatternChar, SubjectChar>::SingleCharSearch(
StringSearch<PatternChar, SubjectChar>* search,
base::Vector<const SubjectChar> subject, int index) { … }
template <typename PatternChar, typename SubjectChar>
inline bool CharCompare(const PatternChar* pattern, const SubjectChar* subject,
int length) { … }
template <typename PatternChar, typename SubjectChar>
int StringSearch<PatternChar, SubjectChar>::LinearSearch(
StringSearch<PatternChar, SubjectChar>* search,
base::Vector<const SubjectChar> subject, int index) { … }
template <typename PatternChar, typename SubjectChar>
int StringSearch<PatternChar, SubjectChar>::BoyerMooreSearch(
StringSearch<PatternChar, SubjectChar>* search,
base::Vector<const SubjectChar> subject, int start_index) { … }
template <typename PatternChar, typename SubjectChar>
void StringSearch<PatternChar, SubjectChar>::PopulateBoyerMooreTable() { … }
template <typename PatternChar, typename SubjectChar>
int StringSearch<PatternChar, SubjectChar>::BoyerMooreHorspoolSearch(
StringSearch<PatternChar, SubjectChar>* search,
base::Vector<const SubjectChar> subject, int start_index) { … }
template <typename PatternChar, typename SubjectChar>
void StringSearch<PatternChar, SubjectChar>::PopulateBoyerMooreHorspoolTable() { … }
template <typename PatternChar, typename SubjectChar>
int StringSearch<PatternChar, SubjectChar>::InitialSearch(
StringSearch<PatternChar, SubjectChar>* search,
base::Vector<const SubjectChar> subject, int index) { … }
template <typename SubjectChar, typename PatternChar>
int SearchString(Isolate* isolate, base::Vector<const SubjectChar> subject,
base::Vector<const PatternChar> pattern, int start_index) { … }
template <typename SubjectChar, typename PatternChar>
intptr_t SearchStringRaw(Isolate* isolate, const SubjectChar* subject_ptr,
int subject_length, const PatternChar* pattern_ptr,
int pattern_length, int start_index) { … }
}
}
#endif