]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/file-path.hh
string() -> to_string()
[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 to_string () 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   void prepend (String str) { Array<String>::insert (str, 0); }
43   String to_string ()const;
44   bool try_add (String str);
45   void add (String);
46   void parse_path (String);
47 };
48
49 Path split_path (String path);
50
51 #endif /* FILE_PATH */