Sync.
This commit is contained in:
1 parent
c3c9530b4b
commit
7e06591de6
15 files changed
+161
-93
No files matched your search
@@ -0,0 +1,45 @@
|
||||
#ifndef __ZString_h__
|
||||
#define __ZString_h__
|
||||
|
||||
#include "includes"`
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
///
|
||||
/// ZString provides a data pointer and a length to basically point to a string
|
||||
/// from a common backstore.
|
||||
///
|
||||
|
||||
class ZString {
|
||||
|
||||
public:
|
||||
ZString() {}
|
||||
ZString(char *data) {
|
||||
this->data = data;
|
||||
length = strlen(data);
|
||||
}
|
||||
|
||||
ZString(char *data, size_t length) {
|
||||
this->data = data;
|
||||
this->length = length;
|
||||
}
|
||||
|
||||
std::string asString() {
|
||||
return std::string(data, length);
|
||||
}
|
||||
|
||||
void setString(char *data, size_t length) {
|
||||
this->data = data;
|
||||
this->length = length;
|
||||
}
|
||||
|
||||
private:
|
||||
char *data;
|
||||
size_t length;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user