]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/file-path.hh
* flower
[lilypond.git] / flower / include / file-path.hh
1 /*
2   file-path.hh -- declare File_name and File_path
3
4   source file of the Flower Library
5
6   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef FILE_PATH_HH
10 #define FILE_PATH_HH
11
12 #include "array.hh"
13 #include "string.hh"
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 */
23
24 class File_path : private Array<String>
25 {
26 public:
27   Array<String> directories () const;
28   String find (String name) const;
29   String find (String name, char const *extensions[]);
30   String to_string () const;
31   bool try_append (String str);
32   void append (String str) { Array<String>::push (str); }
33   void parse_path (String);
34   void prepend (String str) { Array<String>::insert (str, 0); }
35 };
36
37 #endif /* FILE_PATH */