xo-umbrella2/xo-object/include/xo/object/zstring.hpp
Roland Conybeare 5d49dc5a9b git subrepo clone git@github.com:Rconybea/xo-object.git xo-object
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:   "???"
2026-06-06 22:14:14 -04:00

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 **/