// Copyright {Jagger Software Limited} 2003 #ifndef CONTAINER_STRAND_VIEW_INCLUDED #define CONTAINER_STRAND_VIEW_INCLUDED #include #include #include namespace container { template struct range_view; template class strand_view // <> { public: // 'tors explicit strand_view(const range_view &); strand_view(iterator, iterator); // compiler generated copy c'tor ok // compiler generated d'tor ok public: // assignment // compiler generated copy assignment ok public: // capacity bool empty() const; size_t size() const; public: // conversion ::std::string as_string() const; public: // iteration iterator begin() const; iterator end() const; public: // end element access char front() const; char back() const; public: // subscripting char operator[](size_t) const; private: // validation void range_check(size_t) const; private: // instance state iterator from, until; }; } namespace container // strand_view { // convenience template strand_view make_strand_view(iterator, iterator); template strand_view make_strand_view(const range_view &); // streaming template ::std::ostream & operator<<(::std::ostream &, const strand_view &); // equality template bool operator==(const strand_view &, const strand_view &); template bool operator==(const strand_view &, const ::std::string &); template bool operator==(const ::std::string &, const strand_view &); template bool operator==(const strand_view &, const char *); template bool operator==(const char *, const strand_view &); // inequality template bool operator!=(const strand_view &, const strand_view &); template bool operator!=(const strand_view &, const ::std::string &); template bool operator!=(const ::std::string &, const strand_view &); template bool operator!=(const strand_view &, const char *); template bool operator!=(const char *, const strand_view &); } #include "container/strand_view-template.hpp" #endif