aboutsummaryrefslogtreecommitdiff
path: root/backend/String.h
blob: b4025bec681269dda439c7320f1a135cdc5df94d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include <stddef.h>

class String {
public:
	String();
	String(const char * c_str);
	String(const String &);
	~String();
public:
	static String fmt(const char * fmt, ...);

public:
	const char * c_str() const;
	char * data() const;
	size_t size() const;
	bool empty() const;

private:
	void set(const char * data);
	void set(const char * data, size_t data_len);
private:
	char * _data = nullptr;
	size_t _data_len = 0;

};