subrepo: subdir: "xo-object" merged: "d830632a" upstream: origin: "git@github.com:Rconybea/xo-object.git" branch: "main" commit: "d830632a" git-subrepo: version: "0.4.9" origin: "???" commit: "???"
26 lines
575 B
C++
26 lines
575 B
C++
/** @file zstring.hpp
|
|
*
|
|
* Author: Roland Conybeare
|
|
**/
|
|
|
|
#pragma once
|
|
|
|
#include "object.hpp"
|
|
//#include <cstdint>
|
|
|
|
namespace xo {
|
|
namespace obj {
|
|
struct zstring {
|
|
/* need to count trailing \0 */
|
|
std::size_t alloc_size() const { return sizeof(zstring) + len_ + 1; }
|
|
|
|
/** number of characters in string, not counting trailing null **/
|
|
std::int32_t len_;
|
|
/** must use placement new to create **/
|
|
char data_[];
|
|
};
|
|
} /*namespace obj*/
|
|
} /*namespace xo*/
|
|
|
|
|
|
/** end zstring.hpp **/
|