release commit
[lilypond.git] / flower / include / file-path.hh
blob40579d00feae289fa0a280b739f9a6016c45b45c
1 /*
2 file-path.hh -- declare Path and File_path
4 source file of the Flower Library
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #ifndef FILE_PATH_HH
10 #define FILE_PATH_HH
12 #include "string.hh"
13 #include "array.hh"
16 /**
17 search in directories for a file.
19 Abstraction of PATH variable. An interface for searching input files.
20 Search a number of dirs for a file.
22 TODO: add a unix style PATH interface
25 class Path
27 public:
28 String root;
29 String dir;
30 String base;
31 String ext;
33 String to_string () const;
36 class File_path : private Array<String>
38 public:
39 String find (String nm) const;
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);
49 Path split_path (String path);
51 #endif /* FILE_PATH */