ipfs-chromium
Loading...
Searching...
No Matches
slash_delimited.h
1#ifndef IPFS_SLASH_DELIMITED_H_
2#define IPFS_SLASH_DELIMITED_H_
3
4#include <iosfwd>
5#include <string>
6#include <string_view>
7
8namespace google::protobuf::internal {
9class LogMessage;
10}
11
12namespace ipfs {
16 std::string_view remainder_;
17
18 public:
19 SlashDelimited() : remainder_{""} {}
22 explicit SlashDelimited(std::string_view unowned);
23 explicit operator bool() const;
24 std::string_view pop();
25 std::string_view pop_all();
26 std::string_view pop_n(std::size_t);
27 std::string_view peek_back() const;
28 std::string pop_back();
29 std::string to_string() const { return std::string{remainder_}; }
30 std::string_view to_view() const { return remainder_; }
31};
32} // namespace ipfs
33
34std::ostream& operator<<(std::ostream&, ipfs::SlashDelimited const&);
35google::protobuf::internal::LogMessage& operator<<(
36 google::protobuf::internal::LogMessage&,
38
39#endif // IPFS_SLASH_DELIMITED_H_
Just an observing (non-owning) pointer.
Definition raw_ptr.h:31
Definition slash_delimited.h:15
SlashDelimited(std::string_view unowned)