xo-facet xo-object2: facet fixes + IPrintable_DString
This commit is contained in:
parent
989a42cc8c
commit
8a5cd339e8
11 changed files with 135 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ set(SELF_SRCS
|
|||
IPrintable_DList.cpp
|
||||
IPrintable_DFloat.cpp
|
||||
IPrintable_DInteger.cpp
|
||||
IPrintable_DString.cpp
|
||||
DList.cpp
|
||||
DFloat.cpp
|
||||
DInteger.cpp
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "DInteger.hpp"
|
||||
#include <xo/indentlog/print/pretty.hpp>
|
||||
#include <xo/indentlog/scope.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::facet::typeseq;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
**/
|
||||
|
||||
#include "DList.hpp"
|
||||
#include "IPrintable_DList.hpp"
|
||||
#include <xo/gc/GCObject.hpp>
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/facet/FacetRegistry.hpp>
|
||||
#include <xo/indentlog/print/pretty.hpp>
|
||||
|
|
@ -125,7 +127,9 @@ namespace xo {
|
|||
obj<APrintable> elt
|
||||
= FacetRegistry::instance().variant<APrintable, AGCObject>(l->head_);
|
||||
|
||||
assert(elt);
|
||||
|
||||
|
||||
assert(elt.data());
|
||||
|
||||
if (!pps->print_upto(elt))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@
|
|||
**/
|
||||
|
||||
#include "DString.hpp"
|
||||
#include <xo/indentlog/print/pretty.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
||||
namespace xo {
|
||||
using xo::facet::typeseq;
|
||||
using xo::print::ppdetail_atomic;
|
||||
|
||||
namespace scm {
|
||||
DString *
|
||||
|
|
@ -113,6 +115,12 @@ namespace xo {
|
|||
return shallow_size();
|
||||
}
|
||||
|
||||
bool
|
||||
DString::pretty(const ppindentinfo & ppii) const
|
||||
{
|
||||
return ppdetail_atomic<const char *>::print_pretty(ppii, &(chars_[0]));
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
**/
|
||||
|
||||
#include "IPrintable_DList.hpp"
|
||||
#include <xo/indentlog/scope.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
|
|
|||
28
src/object2/IPrintable_DString.cpp
Normal file
28
src/object2/IPrintable_DString.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/** @file IPrintable_DString.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DString.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DString.json5]
|
||||
**/
|
||||
|
||||
#include "string/IPrintable_DString.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IPrintable_DString::pretty(const DString & self, const ppindentinfo & ppii) -> bool
|
||||
{
|
||||
return self.pretty(ppii);
|
||||
}
|
||||
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IPrintable_DString.cpp */
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
#include <xo/object2/IPrintable_DList.hpp>
|
||||
#include <xo/object2/IPrintable_DFloat.hpp>
|
||||
#include <xo/object2/IPrintable_DInteger.hpp>
|
||||
#include <xo/object2/string/IPrintable_DString.hpp>
|
||||
|
||||
#include <xo/printable2/detail/APrintable.hpp>
|
||||
#include <xo/alloc2/alloc/AAllocator.hpp>
|
||||
|
|
@ -45,6 +46,7 @@ namespace xo {
|
|||
FacetRegistry::register_impl<APrintable, DInteger>();
|
||||
|
||||
FacetRegistry::register_impl<AGCObject, DString>();
|
||||
FacetRegistry::register_impl<APrintable, DString>();
|
||||
|
||||
log && log(xtag("DList.tseq", typeseq::id<DList>()));
|
||||
log && log(xtag("DFloat.tseq", typeseq::id<DFloat>()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue