diff --git a/.gitignore b/.gitignore index d5697ec..7e7f8b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/ bin/ +doc/ diff --git a/README.md b/README.md index 4cf31eb..a44ccff 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ to load a subset of yaml files in the main yaml document. the lib does not manage yet tag directives and tag values. **pluie-yaml** use the ![libyaml c library](https://github.com/yaml/libyaml) (License MIT, many thanks to Kirill Simonov) to parse and retriew related yaml events. +![pluie-yaml](https://www.meta-tech.academy/img/pluie-yaml-imports2.png) + ## License GNU GPL v3 @@ -41,7 +43,6 @@ you can use `./build.sh` to rebuild/install the **pluie-yaml** lib and compile s ## Api / Documentation https://pluie.org/pluie-yaml-0.4/index.htm -(comming soon) ## Docker @@ -159,7 +160,7 @@ vala code : #### via iterator -``` +```vala var config = new Yaml.Config (path); var root = config.root_node (); Iterator it = root.iterator (); @@ -172,7 +173,7 @@ vala code : #### other -``` +```vala if (!node.empty ()) { Yaml.Node child = node.first(); of.action("loop throught mapping next sibling", child.name); @@ -185,7 +186,7 @@ vala code : } ``` -``` +```vala if (node.count () > 0) { child = node.last(); of.action("loop throught mapping previous sibling", child.name); @@ -211,5 +212,7 @@ see samples files in ./samples directory * ~~imports clause~~ * ~~fix nodes traversing~~ * ~~rewrite nodes classes~~ +* ~~put doc online~~ +* improve doc * dumper * manage tag directives & tag diff --git a/build.sh b/build.sh index 8c607c2..45c1347 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @software : lib-yaml -# @version : 0.3 +# @version : 0.4 # @date : 2018 # @licence : GPLv3.0 # @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/resources/doc-scripts.js b/resources/doc-scripts.js new file mode 100644 index 0000000..94b15b0 --- /dev/null +++ b/resources/doc-scripts.js @@ -0,0 +1,56 @@ +/* markupwriter.vala + * + * Copyright (C) 2008-2009 Florian Brosch + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Florian Brosch + */ + +function get_path (path) { + var pos = path.lastIndexOf ('/'); + if (pos < 0) { + return ''; + } + + return path.substring (pos, -1) + '/'; +} + +function toggle_box (self, id) { + var element = document.getElementById (id); + if (element == null) { + return ; + } + + var style = self.currentStyle || window.getComputedStyle (self, false); + var orig_path = /url[ \t]*\(('(.*)'|"(.*)")\)/.exec (style.backgroundImage)[1].slice(1, -1); + var orig_dir = get_path (orig_path); + if (element.style.display == 'block') { + element.style.display = 'none'; + self.style.backgroundImage = "url('" + orig_dir + 'coll_open.svg' + "')"; + } else { + element.style.display = 'block'; + self.style.backgroundImage = "url('" + orig_dir + 'coll_close.svg' + "')"; + } +} + +window.onload = function() { + var nav = document.querySelector('.site_navigation'); + nav.innerHTML = ''; + var header = document.querySelector('.site_header'); + var data = header.innerHTML.split("–"); + header.innerHTML = data[0] + (data[1] ? '
'+data[1]+'
' : ''); +} diff --git a/resources/doc-style.css b/resources/doc-style.css new file mode 100644 index 0000000..65c2c3f --- /dev/null +++ b/resources/doc-style.css @@ -0,0 +1,4 @@ +@import url('https://fonts.googleapis.com/css?family=family=Open+Sans:300,400%7CDroid+Serif:400%7CRoboto+Mono:400,500,700,400italic'); +*{font-family:"Open Sans","Droid Sans",Helvetica,sans-serif}a{outline:none!important}h2,h3{font-family:"Droid Serif",serif;font-weight:300}h3{font-size:15px;font-weight:300}body{margin:0}.main_optional_parameter{font-style:italic}.main_diagram{border-style:none;display:block;margin:0 auto}.site_navi{text-align:right}.main_notification{padding-right:10px;padding-left:60px;padding-bottom:5px;padding-top:5px;border-color:#aaf;background-color:#eef;border-style:solid;border-width:1px;margin:10px;min-height:48px;background-position:6px .5em;background-repeat:no-repeat;background-image:url(warning.svg)}.main_table{border-collapse:collapse;border:1px solid #aaf;background:#eef;margin-right:auto;margin-left:auto}.main_source,.main_sourcesample{background-color:#FAFAFA;border-radius:6px;font-family:"Roboto Mono",monospace;margin:12px;padding:12px}input{border-color:#aaf;border-style:solid;border-width:1px}.site_header{align-items:center;background-color:#403757;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);display:flex;font-size:24px;justify-content:space-between;padding:9px 6px;position:fixed;top:0;width:100%;z-index:1000;color:white}div{font-size:14px}.site_title{text-align:left;font-size:40px}div.site_footer{position:fixed;bottom:0;text-align:center;padding-bottom:5px;padding-top:5px;width:100%;background-color:#fafafa}div.site_body{font-size:10;margin-top:50px}#nav_content{overflow:auto;position:fixed;height:100%;width:240px;font-size:16px;background-color:#f7f6f8}div.site_navigation{float:left;width:240px;border-color:#eceaf0;border-style:solid;border-width:1px;margin-bottom:40px;background-color:#f7f6f8}.site_content{font-size:14px;margin-left:300px;margin-right:5px;padding-top:20px;text-align:left;padding-bottom:20px;}.main_type{text-decoration:none;font-style:italic;color:#000}.main_basic_type{text-decoration:none;font-weight:700;color:#2B9C5D}.main_keyword{text-decoration:none;font-weight:700;color:brown}.main_escape{text-decoration:none;color:#6a5acd}.xml_cdata{text-decoration:none;font-weight:400;color:#a020f0}.xml_escape{text-decoration:none;font-weight:400;color:#a020f0}.xml_element{text-decoration:none;font-weight:400;color:#008a8c}.xml_attribute{text-decoration:none;font-weight:700;color:#6a5acd}.xml_attribute_value{text-decoration:none;font-weight:400;color:#f0f}.xml_comment{text-decoration:none;font-weight:400;color:#0202ff}.main_source .main_literal{text-decoration:none;color:#2ba199}.main_comment{text-decoration:none;color:#888a85}.main_preprocessor{text-decoration:none;color:#ad7fa8}div.main_code_definition{background-color:#eee;border-radius:6px;font-family:"Roboto Mono",monospace;margin:12px;padding:12px}div.main_notification_block{padding-right:10px;padding-left:10px;padding-bottom:5px;padding-top:5px;border-color:#d08717;background-color:#fbf2c3;border-style:solid;border-width:1px;margin:10px}span.main_block_headline{background-image:url(tip.svg);background-repeat:no-repeat;background-position:center right;font-weight:700;display:block}div.main_block_content{margin-left:15px}span.leaf_code_definition{font-family:"Roboto Mono",monospace;font-size:15px;font-weight:200}div.leaf_brief_description{display:block;margin-left:40px}h1.main_title{font-size:20px;margin-bottom:0}h2.main_title{margin-bottom:0}h3.main_title{margin-bottom:0}.main_hr{border:0;color:#b4a0c1;background-color:#b4a0c1;height:1px;margin-top:6px;margin-bottom:6px}.main_parameter_table_unknown_parameter{color:GREY}.main_parameter_table_name,.main_errordomain_table_name,.main_enum_table_name{vertical-align:top;text-align:right;font-weight:700;width:120px;padding-right:10px}.main_parameter_table,.main_errordomain_table,.main_enum_table{margin-weight:20px;margin-left:20px}.description a.constant,.brief_description a.constant{background-image:url(constant.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.namespace,.brief_description a.namespace{background-image:url(namespace.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.struct,.brief_description a.struct{background-image:url(struct.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.interface,.brief_description a.interface{background-image:url(interface.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.enum,.brief_description a.enum{background-image:url(enum.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.errordomain,.brief_description a.errordomain{background-image:url(errordomain.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.delegate,.brief_description a.delegate{background-image:url(delegate.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.signal,.brief_description a.signal{background-image:url(signal.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.field,.brief_description a.field{background-image:url(field.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.enumvalue,.brief_description a.enumvalue{background-image:url(enumvalue.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.errorcode,.brief_description a.errorcode{background-image:url(errorcode.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.class,.brief_description a.class{background-image:url(class.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}a.abstract_class,.description a.abstract_class,.brief_description a.abstract_class{background-image:url(abstractclass.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0;font-style:italic}.description a.property,.brief_description a.property{background-image:url(property.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.virtual_property,.brief_description a.virtual_property{background-image:url(virtualproperty.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.abstract_property,.brief_description a.abstract_property{background-image:url(abstractproperty.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.method,.brief_description a.method{background-image:url(method.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.static_method,.brief_description a.static_method{background-image:url(staticmethod.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}a.virtual_method,.description a.virtual_method,.brief_description a.virtual_method{background-image:url(virtualmethod.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.abstract_method,.brief_description a.abstract_method{background-image:url(abstractmethod.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.description a.creation_method,.brief_description a.creation_method{background-image:url(constructor.svg);display:inline-block;padding-right:17px;background-repeat:no-repeat;background-position:center right;border:0}.navi_main li,.navi_inline li{background-image:url(method.svg);background-repeat:no-repeat!important;background-position:left center!important;background-color:transparent;vertical-align:middle;list-style-type:none;margin:0;padding:0 0 0 20px;transition:all 0.5s ease-out}.navi_inline li{background-position:left 12px!important;padding:10px 0 10px 20px}.navi_main li.errorcode,.navi_inline li.errorcode{background-image:url(errorcode.svg)}.navi_main li.enumvalue,.navi_inline li.enumvalue{background-image:url(enumvalue.svg)}.navi_main li.abstract_class,.navi_inline li.abstract_class{background-image:url(abstractclass.svg)}.navi_main li.abstract_method,.navi_inline li.abstract_method{background-image:url(abstractmethod.svg)}.navi_main li.creation_method,.navi_inline li.creation_method,.main_list_m{background-image:url(constructor.svg)}.navi_main li.static_method,.navi_inline li.static_method{background-image:url(staticmethod.svg)}.navi_main li.package_index{background-image:url(packages.svg)}.navi_main li.virtual_method,.navi_inline li.virtual_method{background-image:url(virtualmethod.svg)}.navi_main li.errordomain,.navi_inline li.errordomain,.main_list_errdom{background-image:url(errordomain.svg)}.navi_main li.namespace,.navi_inline li.namespace,.main_list_ns{background-image:url(namespace.svg)}.navi_main li.method,.navi_inline li.method{background-image:url(method.svg)}.navi_main li.struct,.navi_inline li.struct,.main_list_stru{background-image:url(struct.svg)}.navi_main li.interface,.navi_inline li.interface,.main_list_iface{background-image:url(interface.svg)}.navi_main li.field,.navi_inline li.field,.main_list_field{background-image:url(field.svg)}.navi_main li.class,.navi_inline li.class,.main_list_cl{background-image:url(class.svg)}.navi_main li.enum,.navi_inline li.enum,.main_list_en{background-image:url(enum.svg)}.navi_main li.property,.navi_inline li.property,.main_list_prop{background-image:url(property.svg)}.navi_main li.abstract_property,.navi_inline li.abstract_property{background-image:url(abstractproperty.svg)}.navi_main li.virtual_property,.navi_inline li.virtual_property{background-image:url(virtualproperty.svg)}.navi_main li.delegate,.navi_inline li.delegate,.main_list_del{background-image:url(delegate.svg)}.navi_main li.signal,.navi_inline li.signal,.main_list_sig{background-image:url(signal.svg)}.navi_main li.package,.navi_inline li.package{background-image:url(package.svg)}.navi_main li.constant,.navi_inline li.constant{background-image:url(constant.svg)}.navi_main{margin-top:10px;margin-bottom:10px;padding-left:5px}.navi_main:last-child{padding-left:5px}.navi_hr{background-color:#dedede;border:0;border-top-width:0;border-bottom-width:0;border-top-style:none;border-bottom-style:none;border-top-color:currentcolor;border-bottom-color:currentcolor;border-bottom:1px solid #fff;border-top:1px solid #dedede;height:0;margin:6px 0}.navi_main a{text-decoration:none;color:#887E9C;line-height:26px;width:100%;display:inline-block;padding-left:0}a,.navi_inline a,a.external_link{text-decoration:none;color:#50A3BE;transition:all 0.5s ease-out}.navi_main li:hover{background-color:rgba(0,0,0,.1)}div.site_content .navi_main li:hover{background-color:transparent}a:hover,.navi_inline a:hover,a.external_link:hover,div.site_content .navi_main li a:hover{text-decoration:underline;color:#6A6576}.navi_main li:hover a{text-decoration:none}.navi_main .abstract_class>a,.navi_inline .abstract_class>a{font-style:italic}a.navi_link:hover,a.external_link:hover{text-decoration:underline}ul.no_bullet li{list-style-type:none}.navi_inline{}.css_content_literal{font-family:monospace;color:#ff01ff}code{font-family:monospace}.main_code_definition a,.leaf_code_definition a{text-decoration:none;color:inherit}.main_code_definition a:hover,.leaf_code_definition a:hover{text-decoration:underline}.box .headline{background-image:url(coll_open.svg);background-position:calc(100% - 1px) center;background-repeat:no-repeat;background-color:#eef;border-color:#aaf;border-style:solid;border-width:1px;margin:auto;width:90%;margin-top:20px;font-weight:700}.box .content{border-color:#aaf;border-width:0 1 1 1;border-style:solid;overflow:auto;display:none;margin:auto;width:90%}.box .column{float:left;width:33%}.package_note{}.deprecated{text-decoration:line-through} + + diff --git a/samples/json-loader.vala b/samples/json-loader.vala index 4b8344f..43484d8 100644 --- a/samples/json-loader.vala +++ b/samples/json-loader.vala @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : lib-yaml - * @version : 0.3 + * @version : 0.4 * @date : 2018 * @licence : GPLv3.0 * @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/samples/yaml-config.vala b/samples/yaml-config.vala index f012176..8ad0048 100644 --- a/samples/yaml-config.vala +++ b/samples/yaml-config.vala @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : lib-yaml - * @version : 0.3 + * @version : 0.4 * @date : 2018 * @licence : GPLv3.0 * @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/samples/yaml-finder.vala b/samples/yaml-finder.vala index abb2c58..e3670ff 100644 --- a/samples/yaml-finder.vala +++ b/samples/yaml-finder.vala @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : lib-yaml - * @version : 0.3 + * @version : 0.4 * @date : 2018 * @licence : GPLv3.0 * @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/samples/yaml-imports.vala b/samples/yaml-imports.vala index 4d4aea5..04ebde1 100644 --- a/samples/yaml-imports.vala +++ b/samples/yaml-imports.vala @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : lib-yaml - * @version : 0.3 + * @version : 0.4 * @date : 2018 * @licence : GPLv3.0 * @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/samples/yaml-loader.vala b/samples/yaml-loader.vala index 16fbf5a..c817e61 100644 --- a/samples/yaml-loader.vala +++ b/samples/yaml-loader.vala @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : lib-yaml - * @version : 0.3 + * @version : 0.4 * @date : 2018 * @licence : GPLv3.0 * @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/samples/yaml-node.vala b/samples/yaml-node.vala index a82dd6d..7a523bf 100644 --- a/samples/yaml-node.vala +++ b/samples/yaml-node.vala @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : lib-yaml - * @version : 0.3 + * @version : 0.4 * @date : 2018 * @licence : GPLv3.0 * @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/samples/yaml-traversing.vala b/samples/yaml-traversing.vala index cd9030d..728c552 100644 --- a/samples/yaml-traversing.vala +++ b/samples/yaml-traversing.vala @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : lib-yaml - * @version : 0.3 + * @version : 0.4 * @date : 2018 * @licence : GPLv3.0 * @author : a-Sansara <[dev]at[pluie]dot[org]> diff --git a/src/vala/Pluie/Yaml.AbstractChild.vala b/src/vala/Pluie/Yaml.AbstractChild.vala index 47351b9..64287a2 100644 --- a/src/vala/Pluie/Yaml.AbstractChild.vala +++ b/src/vala/Pluie/Yaml.AbstractChild.vala @@ -32,7 +32,7 @@ using Pluie; using Gee; /** - * a class representing a mapping node + * abstract class representing a child node */ public abstract class Pluie.Yaml.AbstractChild : Yaml.AbstractNode { @@ -107,7 +107,7 @@ public abstract class Pluie.Yaml.AbstractChild : Yaml.AbstractNode /** * stuff on changing parent node - * @param child the childto add + * @param levelUpdate flag indicating if update level is needed */ protected virtual bool on_change_parent (bool levelUpdate = true) { diff --git a/src/vala/Pluie/Yaml.AbstractNode.vala b/src/vala/Pluie/Yaml.AbstractNode.vala index a950c27..04a5291 100644 --- a/src/vala/Pluie/Yaml.AbstractNode.vala +++ b/src/vala/Pluie/Yaml.AbstractNode.vala @@ -32,7 +32,7 @@ using Gee; using Pluie; /** - * + * abstract class representing a node */ public abstract class Pluie.Yaml.AbstractNode : Object { @@ -58,8 +58,8 @@ public abstract class Pluie.Yaml.AbstractNode : Object /** * default Yaml.Node constructor - * @param parent the parent node * @param type the NODE_TYPE of Yaml.Node to create + * @param name the node name */ public AbstractNode (Yaml.NODE_TYPE type = Yaml.NODE_TYPE.UNDEFINED, string? name = null) { @@ -67,9 +67,9 @@ public abstract class Pluie.Yaml.AbstractNode : Object } /** - * constructor for standard Yaml.Node - * @param parent the parent node * @param type the NODE_TYPE of Yaml.Node to create + * @param name the node name + * @param data the node data */ public AbstractNode.with_name (Yaml.NODE_TYPE type = Yaml.NODE_TYPE.UNDEFINED, string? name = null, string? data = null) { @@ -81,7 +81,7 @@ public abstract class Pluie.Yaml.AbstractNode : Object /** * test if specifiyed node is current node - * @param child the Yaml.Node node to test + * @param node the Yaml.Node node to test */ public virtual bool same_node (Yaml.AbstractNode? node) { diff --git a/src/vala/Pluie/Yaml.Collection.vala b/src/vala/Pluie/Yaml.Collection.vala index 1ea7f88..c0efd7b 100644 --- a/src/vala/Pluie/Yaml.Collection.vala +++ b/src/vala/Pluie/Yaml.Collection.vala @@ -38,56 +38,51 @@ public interface Pluie.Yaml.Collection { /** * retriew the child at index - * @param child + * @param index index of seached child */ public abstract Yaml.Node? item (int index); /** * check if contains specifyed child node - * @param child + * @param child the child to check */ public abstract bool contains (Yaml.Node child); /** * count children - * @param child */ public abstract int count (); /** * check if empty - * @param child */ public abstract bool empty (); /** - * check if empty - * @param child + * get a Yaml.Node Iterator */ public abstract Gee.Iterator iterator (); /** * retriew the first child - * @param child */ public abstract Yaml.Node? first (); /** * retriew the last child - * @param child */ public abstract Yaml.Node? last (); /** * retriew the next sibling of specifiyed child node - * @param child + * @param child the the reference child node */ public abstract Yaml.Node? child_next_sibling (Yaml.Node child); /** * retriew the previous sibling of specifiyed child node - * @param child + * @param child the the reference child node */ public abstract Yaml.Node? child_previous_sibling (Yaml.Node child); diff --git a/src/vala/Pluie/Yaml.Config.vala b/src/vala/Pluie/Yaml.Config.vala index a5de207..cb7fda3 100644 --- a/src/vala/Pluie/Yaml.Config.vala +++ b/src/vala/Pluie/Yaml.Config.vala @@ -108,7 +108,7 @@ public class Pluie.Yaml.Config /** * find node matching specifiyed keyPath */ - public void get_imports () + protected void get_imports () { var node = this.get("^imports"); if (node != null) { @@ -137,6 +137,7 @@ public class Pluie.Yaml.Config Yaml.Node? n = null; Yaml.Config? conf = null; foreach(var entry in this.paths.entries) { + of.keyval(entry.key, entry.value); conf = new Yaml.Config(entry.value, this.displayFile); sub = conf.loader.get_nodes (); n = new Yaml.Mapping (root, entry.key); @@ -155,13 +156,13 @@ public class Pluie.Yaml.Config private void update_var (Yaml.Node node, string path) { this.varmap.set ("path", path); - string? file = null; foreach (var child in node.list) { if (child.name[0] != IMPORTS_SPE) { var val = child.first().data; if (!Path.is_absolute (val)) { val = Path.build_filename(path, val); } + this.paths[(string)child.name] = val; this.resolve_var (child.name, val); } } diff --git a/src/vala/Pluie/Yaml.Event.vala b/src/vala/Pluie/Yaml.Event.vala index 2e5931f..63d1810 100644 --- a/src/vala/Pluie/Yaml.Event.vala +++ b/src/vala/Pluie/Yaml.Event.vala @@ -55,7 +55,10 @@ public class Pluie.Yaml.Event /** * construct a Event - * @param path the path to load + * @param evtype the Yaml.EVT event + * @param line original yaml line of related event + * @param style original yaml style + * @param data data related to event */ public Event (Yaml.EVT evtype, int line=0, int? style=null, Gee.HashMap? data=null) { diff --git a/src/vala/Pluie/Yaml.Finder.vala b/src/vala/Pluie/Yaml.Finder.vala index e143a81..35b2787 100644 --- a/src/vala/Pluie/Yaml.Finder.vala +++ b/src/vala/Pluie/Yaml.Finder.vala @@ -32,7 +32,7 @@ using Gee; using Pluie; /** - * parent class representing a Yaml Node whenether was his type + * Finder class used to easily retriew Yaml.Node */ public class Pluie.Yaml.Finder : Object { @@ -44,7 +44,7 @@ public class Pluie.Yaml.Finder : Object /** * default Yaml.Finder constructor - * @param default Yaml.Node context + * @param context default Yaml.Node context */ public Finder (Yaml.Node context) { @@ -54,22 +54,24 @@ public class Pluie.Yaml.Finder : Object /** * find a specific child Yaml.Node corresponding to path definition * path definition has two mode. - * default mode is Yaml.FIND_MODE.SQUARE_BRACKETS - * node's key name must be enclosed in square brackets - * sequence entry must be enclosed in curly brace - * ex : [grandfather][father][son]{2} + * default mode is Yaml.FIND_MODE.DOT + * - child mapping node are separated by dot : + * - sequence entry must be enclosed in curly brace + * ex : grandfather.father.son{2}.age * - * other mode is Yaml.FIND_MODE.DOT - * child mapping node are separated by dot : - * ex : grandfather.father.son{2} + * other mode is Yaml.FIND_MODE.DOTSQUARE_BRACKETS + * - node's key name must be enclosed in square brackets + * - sequence entry must be enclosed in curly brace + * ex : [grandfather][father][son]{2}[age] + * * @param path the definition to retriew the child node + * @param context the Yaml.Node context to operate */ public Yaml.Node? find (string path, Yaml.Node? context = null) { string search = this.find_path (path); bool match = false; Yaml.Node? node = context == null ? this.context : context; - Yaml.Mapping? m = null; Regex reg = /(\[|\{)([^\]\}]*)(\]|\})/; MatchInfo mi; try { @@ -114,7 +116,7 @@ public class Pluie.Yaml.Finder : Object * get a path definition depending of current Node.mode * if path definition is Yaml.FIND_MODE.DOT the path is convert to a * Yaml.FIND_MODE.SQUARE_BRACKETS path definition - * @path the path definition + * @param path the path definition * @return the find path definition according to current Node.mode */ private string find_path (string path) @@ -142,7 +144,8 @@ public class Pluie.Yaml.Finder : Object /** * indicates if specifiyed MatchInfo is related to a mapping node only or a collection node - * @param mi + * @param mi used MathInfo + * @param mappingOnly flag indicates if mappu only */ private bool is_collection_path (MatchInfo mi, bool mappingOnly = false) { diff --git a/src/vala/Pluie/Yaml.Mapping.vala b/src/vala/Pluie/Yaml.Mapping.vala index b4eb454..bafeb71 100644 --- a/src/vala/Pluie/Yaml.Mapping.vala +++ b/src/vala/Pluie/Yaml.Mapping.vala @@ -97,6 +97,7 @@ public class Pluie.Yaml.Mapping : Yaml.Node /** * add a child node to current collection (mapping or sequence) node * @param child the Yaml.Node child to add + * @param levelUpdate flag indicating if update level is needed */ protected override void on_removed (Yaml.Node child, bool levelUpdate = true) { @@ -108,7 +109,7 @@ public class Pluie.Yaml.Mapping : Yaml.Node /** * retriew a child node throught specifiyed index - * @param index index of searched child + * @param name name of searched child * @return the child node */ public new Yaml.Node? item (string name) @@ -125,7 +126,7 @@ public class Pluie.Yaml.Mapping : Yaml.Node /** * clone current node - * @param the name of clone + * @param name the overrinding name */ public override Yaml.Node clone_node (string? name = null) { diff --git a/src/vala/Pluie/Yaml.Node.vala b/src/vala/Pluie/Yaml.Node.vala index 92493fd..5e889d5 100644 --- a/src/vala/Pluie/Yaml.Node.vala +++ b/src/vala/Pluie/Yaml.Node.vala @@ -31,12 +31,12 @@ using GLib; using Gee; /** - * a class representing a mapping node + * a class representing a node */ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection { /** - * sequence collection for Yaml.NodeSequence node + * Yaml.Node collection */ public ArrayList list { get; internal set; } @@ -46,6 +46,7 @@ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection * default Yaml.Node constructor * @param parent the parent node * @param type the NODE_TYPE of Yaml.Node to create + * @param name the node name */ public Node (Yaml.Node? parent = null, Yaml.NODE_TYPE type = Yaml.NODE_TYPE.UNDEFINED, string? name = null) { @@ -56,7 +57,7 @@ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection /** * add a child node to current collection (mapping or sequence) node - * @param child the Yaml.Node child to add + * @param node the Yaml.Node child to add */ public virtual bool add (Yaml.AbstractChild node) { @@ -136,7 +137,7 @@ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection /** * check if current node contains the specifiyed child node - * @param child + * @param child the child to check */ public bool contains (Yaml.Node child) { return !this.empty () && this.list.contains (child); @@ -145,7 +146,7 @@ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection /** * count childnodes */ - public int count () { + public override int count () { return !this.empty () ? this.list.size : 0; } @@ -227,7 +228,7 @@ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection /** * clone current node - * @param the name of clone + * @param name the name of clone */ public virtual Yaml.Node clone_node (string? name = null) { @@ -243,7 +244,7 @@ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection /** * clone current node - * @param the name of clone + * @param name the name of clone */ public virtual Yaml.Node get_cloned_instance (string? name = null) { @@ -270,7 +271,7 @@ public class Pluie.Yaml.Node : Yaml.AbstractChild, Pluie.Yaml.Collection /** * get a presentation string of current Yaml.Node */ - public string to_string (bool withIndent = Yaml.DBG_SHOW_INDENT, bool withParent = Yaml.DBG_SHOW_PARENT, bool withUuid = Yaml.DBG_SHOW_UUID, bool withLevel = Yaml.DBG_SHOW_LEVEL, bool withCount = Yaml.DBG_SHOW_COUNT, bool withRefCount = Yaml.DBG_SHOW_REF) + public override string to_string (bool withIndent = Yaml.DBG_SHOW_INDENT, bool withParent = Yaml.DBG_SHOW_PARENT, bool withUuid = Yaml.DBG_SHOW_UUID, bool withLevel = Yaml.DBG_SHOW_LEVEL, bool withCount = Yaml.DBG_SHOW_COUNT, bool withRefCount = Yaml.DBG_SHOW_REF) { return "%s%s%s%s%s%s%s%s%s".printf ( this.level == 0 ? "" : of.s_indent ((int8) (withIndent ? (this.level-1)*4 : 0)), diff --git a/src/vala/Pluie/Yaml.Scalar.vala b/src/vala/Pluie/Yaml.Scalar.vala index 2297a35..999b8c7 100644 --- a/src/vala/Pluie/Yaml.Scalar.vala +++ b/src/vala/Pluie/Yaml.Scalar.vala @@ -32,7 +32,7 @@ using Pluie; using Gee; /** - * a class representing a mapping node + * a class representing a Scalar node */ public class Pluie.Yaml.Scalar : Yaml.Node { @@ -42,7 +42,7 @@ public class Pluie.Yaml.Scalar : Yaml.Node /** * default Yaml.Node constructor * @param parent the parent node - * @param type the NODE_TYPE of Yaml.Node to create + * @param data the Scalar value */ public Scalar (Yaml.Node ? parent = null, string? data = null) { @@ -52,7 +52,7 @@ public class Pluie.Yaml.Scalar : Yaml.Node /** * clone current node - * @param the name of clone + * @param name the overrinding name */ public override Yaml.Node clone_node (string? name = null) { diff --git a/src/vala/Pluie/Yaml.Scanner.vala b/src/vala/Pluie/Yaml.Scanner.vala index e76af98..19c895b 100644 --- a/src/vala/Pluie/Yaml.Scanner.vala +++ b/src/vala/Pluie/Yaml.Scanner.vala @@ -135,7 +135,7 @@ public class Pluie.Yaml.Scanner /** * scan specifiyed file generated throught yaml.c - * @param optional file path to scan + * @param path optional file path to scan */ public bool run (string? path = null) { diff --git a/src/vala/Pluie/Yaml.Sequence.vala b/src/vala/Pluie/Yaml.Sequence.vala index e88fddc..c64078c 100644 --- a/src/vala/Pluie/Yaml.Sequence.vala +++ b/src/vala/Pluie/Yaml.Sequence.vala @@ -32,7 +32,7 @@ using Pluie; using Gee; /** - * a class representing a mapping node + * a class representing a sequence node */ public class Pluie.Yaml.Sequence : Yaml.Node { @@ -40,7 +40,7 @@ public class Pluie.Yaml.Sequence : Yaml.Node /** * default Yaml.Node constructor * @param parent the parent node - * @param type the NODE_TYPE of Yaml.Node to create + * @param name the node name */ public Sequence (Yaml.Node? parent = null, string? name = null) { diff --git a/valadoc.sh b/valadoc.sh new file mode 100755 index 0000000..35b0573 --- /dev/null +++ b/valadoc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +valadoc --package-name=pluie-yaml-0.4 --verbose --force --deps -o ./doc --pkg gee-0.8 --pkg gio-2.0 --pkg gobject-2.0 --pkg glib-2.0 --pkg pluie-echo-0.2 ./src/vala/Pluie/*.vala ./build/install.vala +rm doc/*.png +cp resources/doc-scripts.js ./doc/scripts.js +cp resources/doc-style.css ./doc/style.css +