Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
stringstream.hpp
Go to the documentation of this file.
1
6namespace flecs {
7
11 explicit stringstream()
12 : buf_({}) { }
13
16 ecs_strbuf_reset(&buf_);
17 }
18
21 ecs_strbuf_reset(&buf_);
22 buf_ = str.buf_;
23 str.buf_ = {};
24 }
25
28 ecs_strbuf_reset(&buf_);
29 buf_ = str.buf_;
30 str.buf_ = {};
31 return *this;
32 }
33
37 stringstream(const stringstream& str) = delete;
38
40 stringstream& operator<<(const char* str) {
41 ecs_strbuf_appendstr(&buf_, str);
42 return *this;
43 }
44
47 return flecs::string(ecs_strbuf_get(&buf_));
48 }
49
50private:
51 ecs_strbuf_t buf_;
52};
53
54}
Owned string wrapper.
Definition string.hpp:15
Simple stringstream wrapper around ecs_strbuf_t.
stringstream & operator=(stringstream &&str) noexcept
Move assignment operator.
stringstream(const stringstream &str)=delete
Ban implicit copies/allocations.
stringstream & operator=(const stringstream &str)=delete
Ban implicit copies/allocations.
stringstream()
Default constructor.
stringstream(stringstream &&str) noexcept
Move constructor.
flecs::string str()
Get the accumulated string as an owned flecs::string.
stringstream & operator<<(const char *str)
Append a C string to the stream.
~stringstream()
Destructor.