xo::api proc update_method_doc (public)
xo::api update_method_doc [ -protection protection ] [ -deprecated ] \ [ -debug ] [ -warn ] scope obj inst proc_name docString
Defined in packages/xotcl-core/tcl/01-debug-procs.tcl
Obtain a doc-string for a method, convert it and add it to the proc-doc.
- Switches:
- -protection (optional, defaults to
"public"
)- -deprecated (optional, defaults to
"false"
)- -debug (optional, defaults to
"false"
)- -warn (optional, defaults to
"false"
)- Parameters:
- scope (required)
- obj (required)
- inst (required)
- proc_name (required)
- docString (required)
- Testcases:
- No testcase defined.
Source code: # # Obtain a doc-string for a method, convert it and add it to the # proc-doc. # set methodType [::apidoc::get_object_property $obj ${inst}methodtype $proc_name] set varargs_p [expr {$methodType eq "scripted" && "args" in [::apidoc::get_object_property $obj ${inst}args $proc_name]}] set doc [dict create param "" protection $protection varargs_p $varargs_p deprecated_p $deprecated warn_p false script [::xo::api script_name -obj $obj $scope] main "" flags "" switches0 "" switches1 "" ] if {$docString ne ""} { ad_parse_documentation_string $docString doc_elements set doc [dict replace $doc {*}[array get doc_elements]] } if {$methodType ne "scripted"} { dict set doc default_values {} dict set doc positionals {} } else { set defaults [list] foreach a [::apidoc::get_object_property $obj ${inst}args $proc_name] { if {[::apidoc::get_object_property $obj ${inst}argdefault $proc_name $a d]} { lappend defaults $a $d } } foreach def [::apidoc::get_object_property $obj ${inst}methodparameter $proc_name] { lassign $def f default set pair [split [lindex $f 0 0] :] lassign $pair flaggedName flags if {[string index $flaggedName 0] eq "-"} { set isFlag 1 set name [string range $flaggedName 1 end] } else { set isFlag 0 set name $flaggedName } if {$isFlag} { dict lappend doc switches0 $name dict lappend doc flags $name [split $flags ,] #:log "default_value $proc_name: $sw -> '[lindex $f 1]' <$pair/$f>" if {$flags eq "switch" && $default eq ""} { set default "false" } } else { dict lappend doc flags $name [split $flags ,] } #:log "default_value $proc_name: $sw -> 'default' <$pair/$f>" if {[llength $def] > 1} { lappend defaults $name $default } } dict set doc default_values $defaults dict set doc positionals [::apidoc::get_object_property $obj ${inst}args $proc_name] } # argument documentation finished set proc_index [::xo::api proc_index $scope $obj ${inst}proc $proc_name] if {![nsv_exists api_proc_doc $proc_index]} { nsv_lappend api_proc_doc_scripts [dict get $doc script] $proc_index } #ns_log notice "SETTING api_proc_doc '$proc_index' <$doc>" nsv_set api_proc_doc $proc_index $docXQL Not present: Generic, PostgreSQL, Oracle