X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Ffile-path.hh;h=ee62d94b156b7acc7248818f610f99a3e3983515;hb=8cab78caa0db1ba14f2e52e4c1ddbb541ea0e5cb;hp=5f5549cb19dfcbf4c5ac49dbdcddb341c36e351e;hpb=10fce7970987502ec8340819411897a829f6be23;p=lilypond.git diff --git a/flower/include/file-path.hh b/flower/include/file-path.hh index 5f5549cb19..ee62d94b15 100644 --- a/flower/include/file-path.hh +++ b/flower/include/file-path.hh @@ -1,37 +1,42 @@ /* - file-path.hh -- declare File_name and File_path + file-path.hh -- declare File_path source file of the Flower Library - (c) 1997--2005 Han-Wen Nienhuys + (c) 1997--2009 Han-Wen Nienhuys */ #ifndef FILE_PATH_HH #define FILE_PATH_HH -#include "array.hh" -#include "string.hh" +#include "std-vector.hh" +#include "std-string.hh" -/** - search in directories for a file. +/** + search in directories for a file. Abstraction of PATH variable. An interface for searching input files. Search a number of dirs for a file. - TODO: add a unix style PATH interface + TODO: add a unix style PATH interface */ -class File_path : private Array +class File_path { + vector dirs_; + public: - Array directories () const; - String find (String name) const; - String find (String name, char const *extensions[]); - String to_string () const; - bool try_append (String str); - void append (String str) { Array::push (str); } - void parse_path (String); - void prepend (String str) { Array::insert (str, 0); } + vector directories () const; + string find (string name) const; + string find (string name, char const *extensions[]); + string to_string () const; + bool try_append (string str); + void append (string str); + void parse_path (string); + void prepend (string str); }; +bool is_file (string file_name); +bool is_dir (string file_name); + #endif /* FILE_PATH */