]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/file-path.hh
*** empty log message ***
[lilypond.git] / flower / include / file-path.hh
1 /*
2   file-path.hh -- declare File_path
3
4   source file of the Flower Library
5
6   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef FILE_PATH_HH
10 #define FILE_PATH_HH
11
12 #include "array.hh"
13 #include "std-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
25 {
26   Array<std::string> dirs_;
27 public:
28   Array<std::string> directories () const;
29   std::string find (std::string name) const;
30   std::string find (std::string name, char const *extensions[]);
31   std::string to_string () const;
32   bool try_append (std::string str);
33   void append (std::string str);
34   void parse_path (std::string);
35   void prepend (std::string str);
36 };
37
38 bool is_file (std::string file_name);
39 bool is_dir (std::string file_name);
40
41 #endif /* FILE_PATH */