]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/file-path.hh
patch::: 1.3.130.jcn3
[lilypond.git] / flower / include / file-path.hh
1 /*
2   file-path.hh -- declare Path and File_path
3
4   source file of the Flower Library
5
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef FILE_PATH_HH
10 #define FILE_PATH_HH
11
12 #include "string.hh"
13 #include "array.hh"
14
15
16 /**    
17   search in directories for a file.
18
19    Abstraction of PATH variable. An interface for searching input files.
20    Search a number of dirs for a file.
21
22    TODO: add a unix style PATH interface 
23 */
24
25 class Path
26 {
27 public:
28   String root;
29   String dir;
30   String base;
31   String ext;
32
33   String str () const;
34 };
35
36 class File_path : private Array<String>
37 {
38 public:
39   String find (String nm) const;
40
41   Array<String>::push;
42   String str ()const;
43   bool try_add (String str);
44   void add (String);
45   void parse_path (String);
46 };
47
48 Path split_path (String path);
49
50 #endif /* FILE_PATH */