]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/path.hh
release: 0.1.11
[lilypond.git] / flower / include / path.hh
1 /*
2   path.hh -- declare File_path
3
4   source file of the Flower Library
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #ifndef PATH_HH
10 #define PATH_HH
11 #include "string.hh"
12 #include "varray.hh"
13
14
15 /**    
16   search in directories for a file.
17
18    Abstraction of PATH variable. An interface for searching input files.
19    Search a number of dirs for a file.
20
21    TODO: add a unix style PATH interface 
22    Should use kpathsea?
23    
24 */
25
26 class File_path : private Array<String>
27 {
28 public:
29     /// locate a file in the search path
30     String find (String nm) const;
31
32     /// add to end of path.
33     Array<String>::push;
34     void add (String str) { push (str); }
35 };
36
37 /** split a path into its components.
38
39   @params path
40
41   @return
42   String &drive, String &dirs, String &filebase, String &extension
43  */
44 void split_path (String path, String &drive, String &dirs, String &filebase, String &extension);
45
46 #endif