From ed302d1be74d2b4e69ee4b6e3834637ed531eaea Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Apr 2016 22:08:24 -0400 Subject: step1 --- org/ao_object_setter.org | 121 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 5 deletions(-) (limited to 'org/ao_object_setter.org') diff --git a/org/ao_object_setter.org b/org/ao_object_setter.org index 51dd9bc..2ee9423 100644 --- a/org/ao_object_setter.org +++ b/org/ao_object_setter.org @@ -15,6 +15,25 @@ * object setter :object:set: [[./sdp.org][sdp]] [[./][org/]] ** struct :struct: +#+name: ao_object_setter +#+BEGIN_SRC d +mixin Structs; +#+END_SRC +** comment :comment: +#+name: ao_object_setter +#+BEGIN_SRC d +ObjComposite contents_comment_new(in string object) { + ObjComposite object_set; + object_set.use = "comment"; + object_set.of = "comment"; + object_set.is_a = "comment"; + object_set.object = object; + // does not have .attrib; + // does not have .ocn + return object_set; +} +#+END_SRC + #+name: ao_object_setter #+BEGIN_SRC d string[string] contents_comment(in string object) { @@ -27,6 +46,32 @@ string[string] contents_comment(in string object) { } #+END_SRC ** heading :heading: +#+name: ao_object_setter +#+BEGIN_SRC d +ObjComposite contents_heading_new( + in int type, + in string object, + in string attrib, + in int ocn, + in string lev, + in string lvn, + in string lcn, +) { + ObjComposite object_set; + object_set.use = "content"; + object_set.of = "para"; + object_set.is_a = "heading"; + object_set.object = object; + object_set.ocn = (ocn==0) ? "" : to!string(ocn); + object_set.attrib = attrib; + object_set.heading.type = to!string(type); + object_set.heading.lev = to!string(lev); + object_set.heading.lvn = to!string(lvn); + object_set.heading.lcn = to!string(lcn); + return object_set; +} +#+END_SRC + #+name: ao_object_setter #+BEGIN_SRC d string[string] contents_heading( @@ -53,10 +98,36 @@ string[string] contents_heading( } #+END_SRC ** para :para: + +#+name: ao_object_setter +#+BEGIN_SRC d +ObjComposite contents_para_new( + in string is_a, + in string object, + in string attrib, + in int ocn, + in string indent_first, + in string indent_second, + in bool bullet +) { + ObjComposite object_set; + object_set.use = "content"; + object_set.of = "para"; + object_set.is_a = "heading"; + object_set.object = object; + object_set.ocn = (ocn==0) ? "" : to!string(ocn); + object_set.attrib = attrib; + object_set.para.indent_first = indent_first; + object_set.para.indent_second = indent_second; + object_set.para.bullet = to!string(bullet); + return object_set; +} +#+END_SRC + #+name: ao_object_setter #+BEGIN_SRC d string[string] contents_para( - in string type, + in string is_a, in string object, in string attrib, in int ocn, @@ -67,7 +138,7 @@ string[string] contents_para( string[string] object_set; object_set["use"] = "content"; object_set["of"] = "para"; - object_set["is"] = type; + object_set["is"] = is_a; object_set["obj"] = object; object_set["ocn"] = (ocn==0) ? "" : to!string(ocn); object_set["indent_first"] = indent_first; @@ -78,6 +149,26 @@ string[string] contents_para( } #+END_SRC ** block :block: +#+name: ao_object_setter +#+BEGIN_SRC d +ObjComposite contents_block_new( + in string type, + in string object, + in string attrib, + in int ocn +) { + ObjComposite object_set; + // does not have .attrib; + object_set.use = "content"; + object_set.of = "block"; + object_set.is_a = type; + object_set.object = object; + object_set.ocn = (ocn==0) ? "" : to!string(ocn); + object_set.attrib = attrib; + return object_set; +} +#+END_SRC + #+name: ao_object_setter #+BEGIN_SRC d string[string] contents_block( @@ -97,6 +188,26 @@ string[string] contents_block( } #+END_SRC ** block ocn string :block: +#+name: ao_object_setter +#+BEGIN_SRC d +ObjComposite contents_block_ocn_string_new( + in string type, + in string object, + in string ocn, + in string node +) { + ObjComposite object_set; + object_set.use = "content"; + object_set.of = "block"; + object_set.is_a = type; + object_set.object = object; + object_set.ocn = ocn; + object_set.block_ocn_string.node = node; + // object_set.attrib = attrib; + return object_set; +} +#+END_SRC + #+name: ao_object_setter #+BEGIN_SRC d string[string] contents_block_ocn_string( @@ -120,12 +231,12 @@ string[string] contents_block_ocn_string( ** code structure: :ao_object_setter.d: #+name: tangle_ao_object_setter #+BEGIN_SRC d :tangle ../lib/sdp/ao_object_setter.d -/* +/+ object setter ao_object_setter.d -*/ ++/ mixin template ObjectSetters() { - class ObjectAbstractSet { + struct ObjectAbstractSet { import std.conv : to; <> } -- cgit v1.2.3