Initial Course
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace oop {
|
||||
|
||||
class StringBuilder {
|
||||
public:
|
||||
StringBuilder() = default;
|
||||
explicit StringBuilder(std::string initial);
|
||||
StringBuilder(const StringBuilder& other);
|
||||
auto operator=(const StringBuilder& other) -> StringBuilder&;
|
||||
~StringBuilder() = default;
|
||||
|
||||
void append(const std::string& text);
|
||||
[[nodiscard]] auto str() const -> std::string;
|
||||
[[nodiscard]] auto size() const -> std::size_t;
|
||||
|
||||
private:
|
||||
std::vector<char> buffer_;
|
||||
};
|
||||
|
||||
} // namespace oop
|
||||
Reference in New Issue
Block a user