Move pathname and basename utility functions to extra_utility

This makes them generally available to SICS (and it's early)
This commit is contained in:
Douglas Clowes
2014-01-30 14:52:28 +11:00
parent 91d0dc86f5
commit 3abc6c9e60
5 changed files with 20 additions and 78 deletions

View File

@@ -16,26 +16,6 @@ namespace eval ::scobj::cybaman {
close $fd
}
proc basename {node} {
set point [string last "/" $node]
if { $point < 0 } {
return $node
} else {
incr point
return "[string range $node $point end]"
}
}
proc pathname {node} {
set point [string last "/" $node]
if { $point < 0 } {
return ""
} else {
incr point -1
return "[string range $node 0 $point]"
}
return "[join [lrange [split $node '/'] 0 end-1] '/']"
}
proc splitxml {str} {
set my_list [list]
set idx 0