This repository has been archived on 2023-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
mipt_cpp/seminar03_initialization/08_stringview/miptstringview.h
2022-10-22 22:03:40 +03:00

28 lines
616 B
C++

#pragma once
#include <iostream>
namespace mipt {
class String;
class StringView
{
private:
const char* mpData;
size_t mSize;
public:
StringView();
StringView(const StringView& str);
StringView(const mipt::String& s);
StringView(const char* s);
const char& at(size_t i);
const char& operator[](size_t i) const;
bool operator<(const StringView& right) const;
size_t size() const;
StringView substr(size_t pos, size_t count);
void remove_prefix(size_t n);
void remove_suffix(size_t n);
};
std::ostream& operator<<(std::ostream& out, const StringView& sv);
}