-
Notifications
You must be signed in to change notification settings - Fork 2
/
svf_string.h
44 lines (28 loc) · 813 Bytes
/
svf_string.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* svf_string.h
*
* Created on: Jul 24, 2014
* Author: ballance
*/
#ifndef SVF_STRING_H_
#define SVF_STRING_H_
#include <stdint.h>
class svf_string {
public:
svf_string();
svf_string(const char *str);
virtual ~svf_string();
void operator = (const char *str);
inline bool operator == (const char *other) const { return equals(other); }
inline bool operator == (const svf_string &other) const { return equals(other); }
bool equals(const char *other) const;
bool equals(const svf_string &other) const;
inline char at(uint32_t idx) const { return m_store[idx]; }
inline const char *c_str() const { return m_store; }
inline uint32_t size() const { return m_size; }
private:
uint32_t m_size;
uint32_t m_max;
char *m_store;
};
#endif /* SVF_STRING_H_ */