1
Files
lecture-operating-system-de…/c_os/user/lib/StringView.cc
2022-08-01 20:43:38 +02:00

12 lines
335 B
C++

#include "user/lib/StringView.h"
bse::string_view bse::string_view::substring(std::size_t first, std::size_t last) const {
if (first < 0 || first > len || last <= first || last > len) {
return nullptr;
}
string_view new_view;
new_view.len = last - first;
new_view.buf = &buf[first];
return new_view;
}