1# paths.tcl --
2#
3#	Generic path list management, for use by import management.
4#
5# Copyright (c) 2009 Andreas Kupries <andreas_kupries@sourceforge.net>
6#
7# See the file "license.terms" for information on usage and redistribution
8# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9#
10# RCS: @(#) $Id: paths.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $
11
12# Each object manages a list of paths.
13
14# ### ### ### ######### ######### #########
15## Requisites
16
17package require Tcl 8.5
18package require snit
19
20# ### ### ### ######### ######### #########
21## API
22
23snit::type ::paths {
24
25    # ### ### ### ######### ######### #########
26    ## Options :: None
27
28    # ### ### ### ######### ######### #########
29    ## Creation, destruction
30
31    # Default constructor.
32    # Default destructor.
33
34    # ### ### ### ######### ######### #########
35    ## Methods :: Querying and manipulating the list of paths.
36
37    method paths {} {
38	return $mypaths
39    }
40
41    method add {path} {
42	if {$path in $mypaths} return
43	lappend mypaths $path
44	return
45    }
46
47    method remove {path} {
48	set pos [lsearch $mypaths $path]
49	if {$pos < 0} return
50	set  mypaths [lreplace $mypaths $pos $pos]
51	return
52    }
53
54    method clear {} {
55	set mypaths {}
56	return
57    }
58
59    # ### ### ### ######### ######### #########
60    ## Internal methods :: None
61
62    # ### ### ### ######### ######### #########
63    ## State :: List of paths.
64
65    variable mypaths {}
66
67    ##
68    # ### ### ### ######### ######### #########
69}
70
71# ### ### ### ######### ######### #########
72## Ready
73
74package provide paths 1
75return
76