#pragma once #include "cstriter.h" #include template class TStrSpnImpl { public: inline TStrSpnImpl(const char* b, const char* e) { Init(b, e); } inline TStrSpnImpl(const char* s) { Init(s, TCStringEndIterator()); } //FirstOf template inline It FindFirstOf(It b, const char* e) const noexcept { return FindFirst(b, e); } template inline It FindFirstOf(It s) const noexcept { return FindFirst(s, TCStringEndIterator()); } //FirstNotOf template inline It FindFirstNotOf(It b, const char* e) const noexcept { return FindFirst(b, e); } template inline It FindFirstNotOf(It s) const noexcept { return FindFirst(s, TCStringEndIterator()); } inline void Set(ui8 b) noexcept { S_.Set(b); } private: template inline It1 FindFirst(It1 b, It2 e) const noexcept { while (b != e && (S_.Get((ui8)*b) == Result)) { ++b; } return b; } template inline void Init(It1 b, It2 e) { while (b != e) { this->Set((ui8)*b++); } } private: TSetType S_; }; using TCompactStrSpn = TStrSpnImpl>;