xo-object2: Printable+DList [WIP]
This commit is contained in:
parent
6b22aab6fb
commit
287fce9b7b
9 changed files with 142 additions and 11 deletions
|
|
@ -8,6 +8,7 @@ set(SELF_SRCS
|
|||
ISequence_Any.cpp
|
||||
ISequence_DList.cpp
|
||||
IPrintable_DFloat.cpp
|
||||
IPrintable_DList.cpp
|
||||
DList.cpp
|
||||
DFloat.cpp
|
||||
object2_register_types.cpp
|
||||
|
|
|
|||
|
|
@ -84,6 +84,31 @@ namespace xo {
|
|||
return l->head_;
|
||||
}
|
||||
|
||||
#ifdef NOT_YET
|
||||
bool
|
||||
DList::pretty(const ppindentinfo & ppii) const
|
||||
{
|
||||
/* adapted from ppstate.pretty_struct(), see also */
|
||||
|
||||
using xo::print::ppstate;
|
||||
|
||||
ppstate * pps = ppii.pps();
|
||||
|
||||
if (ppii.upto()) {
|
||||
/* perhaps print on one line */
|
||||
if (!pps->print_upto("(")
|
||||
return false;
|
||||
|
||||
/* TODO: probably use iterators here, when available */
|
||||
const DList * l = this;
|
||||
while (!l->is_empty()) {
|
||||
obj<APrintable>(l->head_.data());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
28
xo-object2/src/object2/IPrintable_DList.cpp
Normal file
28
xo-object2/src/object2/IPrintable_DList.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/** @file IPrintable_DList.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/home/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DList.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DList.json5]
|
||||
**/
|
||||
|
||||
#include "IPrintable_DList.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IPrintable_DList::pretty(const DList & self, const ppindentinfo & ppii) -> bool
|
||||
{
|
||||
return self.pretty(ppii);
|
||||
}
|
||||
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IPrintable_DList.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue