]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/file-path.hh
* VERSION (MY_PATCH_LEVEL): make 1.7.0
[lilypond.git] / flower / include / file-path.hh
index 15c295ba4b3880fa593ab8b6ba05422f8322d8cb..2055d08f011c35415ce7f757fbfcda7d31587cd8 100644 (file)
@@ -1,13 +1,14 @@
 /*
-  path.hh -- declare File_path
+  file-path.hh -- declare Path and File_path
 
   source file of the Flower Library
 
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#ifndef PATH_HH
-#define PATH_HH
+#ifndef FILE_PATH_HH
+#define FILE_PATH_HH
+
 #include "string.hh"
 #include "array.hh"
 
    Search a number of dirs for a file.
 
    TODO: add a unix style PATH interface 
-   Should use kpathsea?
-   
 */
 
+class Path
+{
+public:
+  String root;
+  String dir;
+  String base;
+  String ext;
+
+  String string () const;
+};
+
 class File_path : private Array<String>
 {
 public:
   String find (String nm) const;
 
   Array<String>::push;
-  String str ()const;
-  void add (String str);
+  void prepend (String str) { Array<String>::insert (str, 0); }
+  String string ()const;
+  bool try_add (String str);
+  void add (String);
   void parse_path (String);
 };
 
-/** split a path into its components.
-
-  @params path
-
-  @return
-  String &drive, String &dirs, String &filebase, String &extension
- */
-void split_path (String path, String &drive, String &dirs, String &filebase, String &extension);
+Path split_path (String path);
 
-#endif
+#endif /* FILE_PATH */