For PR351:
[oota-llvm.git] / include / llvm / System / Path.h
1 //===- llvm/System/Path.h - Path Operating System Concept -------*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Reid Spencer and is distributed under the 
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the llvm::sys::Path class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_SYSTEM_PATH_H
15 #define LLVM_SYSTEM_PATH_H
16
17 #include "llvm/System/TimeValue.h"
18 #include <set>
19 #include <string>
20 #include <vector>
21 #include <ostream>
22
23 namespace llvm {
24 namespace sys {
25
26   /// This class provides an abstraction for the path to a file or directory 
27   /// in the operating system's filesystem and provides various basic operations
28   /// on it.  Note that this class only represents the name of a path to a file
29   /// or directory which may or may not be valid for a given machine's file 
30   /// system. A Path ensures that the name it encapsulates is syntactical valid
31   /// for the operating system it is running on but does not ensure correctness
32   /// for any particular file system. A Path either references a file or a 
33   /// directory and the distinction is consistently maintained. Most operations
34   /// on the class have invariants that require the Path object to be either a
35   /// file path or a directory path, but not both. Those operations will also 
36   /// leave the object as either a file path or object path. There is exactly 
37   /// one invalid Path which is the empty path. The class should never allow any
38   /// other syntactically invalid non-empty path name to be assigned. Empty
39   /// paths are required in order to indicate an error result. If the path is
40   /// empty, the isValid operation will return false. All operations will fail
41   /// if isValid is false. Operations that change the path will either return 
42   /// false if it would cause a syntactically invalid path name (in which case 
43   /// the Path object is left unchanged) or throw an std::string exception 
44   /// indicating the error.
45   /// @since 1.4
46   /// @brief An abstraction for operating system paths.
47   class Path {
48     /// @name Types
49     /// @{
50     public:
51       /// This structure provides basic file system information about a file. It
52       /// is patterned after the stat(2) Unix operating system call but made
53       /// platform independent and eliminates many of the unix-specific fields.
54       /// However, to support llvm-ar, the mode, user, and group fields are
55       /// retained. These pertain to unix security and may not have a meaningful
56       /// value on non-Unix platforms. However, the fileSize and modTime fields
57       /// should always be applicabe on all platforms.  The structure is 
58       /// filled in by the getStatusInfo method.
59       /// @brief File status structure
60       struct StatusInfo {
61         StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999), 
62                        group(999), isDir(false) { }
63         size_t      fileSize;   ///< Size of the file in bytes
64         TimeValue   modTime;    ///< Time of file's modification
65         uint32_t    mode;       ///< Mode of the file, if applicable
66         uint32_t    user;       ///< User ID of owner, if applicable
67         uint32_t    group;      ///< Group ID of owner, if applicable
68         bool        isDir;      ///< True if this is a directory.
69       };
70
71     /// @}
72     /// @name Constructors
73     /// @{
74     public:
75       /// Construct a path to the root directory of the file system. The root
76       /// directory is a top level directory above which there are no more 
77       /// directories. For example, on UNIX, the root directory is /. On Windows
78       /// it is C:\. Other operating systems may have different notions of
79       /// what the root directory is.
80       /// @throws nothing
81       static Path GetRootDirectory();
82
83       /// Construct a path to a unique temporary directory that is created in
84       /// a "standard" place for the operating system. The directory is 
85       /// guaranteed to be created on exit from this function. If the directory 
86       /// cannot be created, the function will throw an exception.
87       /// @throws std::string indicating why the directory could not be created.
88       /// @brief Constrct a path to an new, unique, existing temporary
89       /// directory.
90       static Path GetTemporaryDirectory();
91
92       /// Construct a vector of sys::Path that contains the "standard" system
93       /// library paths suitable for linking into programs. This function *must*
94       /// return the value of LLVM_LIB_SEARCH_PATH as the first item in \p Paths
95       /// if that environment variable is set and it references a directory.
96       /// @throws nothing
97       /// @brief Construct a path to the first system library directory
98       static void GetSystemLibraryPaths(std::vector<sys::Path>& Paths);
99
100       /// Construct a vector of sys::Path that contains the "standard" bytecode
101       /// library paths suitable for linking into an llvm program. This function
102       /// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the values
103       /// of LLVM_LIBDIR and LLVMGCCDIR/lib (if --with-llvmgccdir was specified
104       /// when LLVM was configured). It also must provide the
105       /// System library paths as returned by GetSystemLibraryPaths.
106       /// @brief Construct a list of directories in which bytecode could be
107       /// found.
108       static void GetBytecodeLibraryPaths(std::vector<sys::Path>& Paths);
109
110       /// Find the path to a library using its short name. Use the system
111       /// dependent library paths to locate the library.
112       /// @brief Find a library.
113       static Path  FindLibrary(std::string& short_name);
114
115       /// Construct a path to the default LLVM configuration directory. The 
116       /// implementation must ensure that this is a well-known (same on many
117       /// systems) directory in which llvm configuration files exist. For 
118       /// example, on Unix, the /etc/llvm directory has been selected.
119       /// @throws nothing
120       /// @brief Construct a path to the default LLVM configuration directory
121       static Path GetLLVMDefaultConfigDir();
122
123       /// Construct a path to the LLVM installed configuration directory. The
124       /// implementation must ensure that this refers to the "etc" directory of
125       /// the LLVM installation. This is the location where configuration files
126       /// will be located for a particular installation of LLVM on a machine.
127       /// @throws nothing
128       /// @brief Construct a path to the LLVM installed configuration directory
129       static Path GetLLVMConfigDir();
130
131       /// Construct a path to the current user's home directory. The
132       /// implementation must use an operating system specific mechanism for
133       /// determining the user's home directory. For example, the environment 
134       /// variable "HOME" could be used on Unix. If a given operating system 
135       /// does not have the concept of a user's home directory, this static
136       /// constructor must provide the same result as GetRootDirectory.
137       /// @throws nothing
138       /// @brief Construct a path to the current user's "home" directory
139       static Path GetUserHomeDirectory();
140
141       /// Return the suffix commonly used on file names that contain a shared
142       /// object, shared archive, or dynamic link library. Such files are 
143       /// linked at runtime into a process and their code images are shared 
144       /// between processes. 
145       /// @returns The dynamic link library suffix for the current platform.
146       /// @brief Return the dynamic link library suffix.
147       static std::string GetDLLSuffix();
148
149       /// This is one of the very few ways in which a path can be constructed
150       /// with a syntactically invalid name. The only *legal* invalid name is an
151       /// empty one. Other invalid names are not permitted. Empty paths are
152       /// provided so that they can be used to indicate null or error results in
153       /// other lib/System functionality.
154       /// @throws nothing
155       /// @brief Construct an empty (and invalid) path.
156       Path() : path() {}
157
158       /// This constructor will accept a std::string as a path but if verifies
159       /// that the path string has a legal syntax for the operating system on
160       /// which it is running. This allows a path to be taken in from outside
161       /// the program. However, if the path is not valid, the Path object will
162       /// be set to an empty string and an exception will be thrown.
163       /// @throws std::string if the path string is not legal.
164       /// @param unverified_path The path to verify and assign.
165       /// @brief Construct a Path from a string.
166       explicit Path(const std::string& unverified_path);
167
168     /// @}
169     /// @name Operators
170     /// @{
171     public:
172       /// Makes a copy of \p that to \p this.
173       /// @returns \p this
174       /// @throws nothing
175       /// @brief Assignment Operator
176       Path & operator = ( const Path & that ) {
177         path = that.path;
178         return *this;
179       }
180
181       /// Compares \p this Path with \p that Path for equality.
182       /// @returns true if \p this and \p that refer to the same thing.
183       /// @throws nothing
184       /// @brief Equality Operator
185       bool operator == (const Path& that) const {
186         return 0 == path.compare(that.path) ;
187       }
188
189       /// Compares \p this Path with \p that Path for inequality.
190       /// @returns true if \p this and \p that refer to different things.
191       /// @throws nothing
192       /// @brief Inequality Operator
193       bool operator !=( const Path & that ) const {
194         return 0 != path.compare( that.path );
195       }
196
197       /// Determines if \p this Path is less than \p that Path. This is required
198       /// so that Path objects can be placed into ordered collections (e.g.
199       /// std::map). The comparison is done lexicographically as defined by
200       /// the std::string::compare method.
201       /// @returns true if \p this path is lexicographically less than \p that.
202       /// @throws nothing
203       /// @brief Less Than Operator
204       bool operator< (const Path& that) const { 
205         return 0 > path.compare( that.path ); 
206       }
207
208     /// @}
209     /// @name Accessors
210     /// @{
211     public:
212       /// This function will use an operating system specific algorithm to
213       /// determine if the current value of \p this is a syntactically valid
214       /// path name for the operating system. The path name does not need to
215       /// exist, validity is simply syntactical. Empty paths are always invalid.
216       /// @returns true iff the path name is syntactically legal for the 
217       /// host operating system. 
218       /// @brief Determine if a path is syntactically valid or not.
219       bool isValid() const;
220
221       /// This function determines if the contents of the path name are
222       /// empty. That is, the path has a zero length.
223       /// @returns true iff the path is empty.
224       /// @brief Determines if the path name is empty (invalid).
225       bool isEmpty() const { return path.empty(); }
226
227       /// This function determines if the path name in this object is intended
228       /// to reference a legal file name (as opposed to a directory name). This
229       /// function does not verify anything with the file system, it merely
230       /// determines if the syntax of the path represents a file name or not.
231       /// @returns true if this path name references a file.
232       /// @brief Determines if the path name references a file.
233       bool isFile() const;
234
235       /// This function determines if the path name in this object is intended
236       /// to reference a legal directory name (as opposed to a file name). This
237       /// function does not verify anything with the file system, it merely
238       /// determines if the syntax of the path represents a directory name or
239       /// not.
240       /// @returns true if the path name references a directory
241       /// @brief Determines if the path name references a directory.
242       bool isDirectory() const;
243
244       /// This function determines if the path name in this object references
245       /// the root (top level directory) of the file system. The details of what
246       /// is considered the "root" may vary from system to system so this method
247       /// will do the necessary checking. 
248       /// @returns true iff the path name references the root directory.
249       /// @brief Determines if the path references the root directory.
250       bool isRootDirectory() const;
251
252       /// This function opens the file associated with the path name provided by 
253       /// the Path object and reads its magic number. If the magic number at the
254       /// start of the file matches \p magic, true is returned. In all other
255       /// cases (file not found, file not accessible, etc.) it returns false.
256       /// @returns true if the magic number of the file matches \p magic.
257       /// @brief Determine if file has a specific magic number
258       bool hasMagicNumber(const std::string& magic) const;
259
260       /// This function retrieves the first \p len bytes of the file associated
261       /// with \p this. These bytes are returned as the "magic number" in the
262       /// \p Magic parameter.
263       /// @returns true if the Path is a file and the magic number is retrieved,
264       /// false otherwise.
265       /// @brief Get the file's magic number.
266       bool getMagicNumber(std::string& Magic, unsigned len) const;
267
268       /// This function determines if the path name in the object references an
269       /// archive file by looking at its magic number.
270       /// @returns true if the file starts with the magic number for an archive
271       /// file.
272       /// @brief Determine if the path references an archive file.
273       bool isArchive() const;
274
275       /// This function determines if the path name in the object references an
276       /// LLVM Bytecode file by looking at its magic number.
277       /// @returns true if the file starts with the magic number for LLVM 
278       /// bytecode files.
279       /// @brief Determine if the path references a bytecode file.
280       bool isBytecodeFile() const;
281
282       /// This function determines if the path name in the object references a
283       /// native Dynamic Library (shared library, shared object) by looking at
284       /// the file's magic number. The Path object must reference a file, not a
285       /// directory. 
286       /// @return strue if the file starts with the magid number for a native
287       /// shared library.
288       /// @brief Determine if the path reference a dynamic library.
289       bool isDynamicLibrary() const;
290
291       /// This function determines if the path name references an existing file
292       /// or directory in the file system. Unlike isFile and isDirectory, this
293       /// function actually checks for the existence of the file or directory.
294       /// @returns true if the pathname references an existing file.
295       /// @brief Determines if the path is a file or directory in
296       /// the file system.
297       bool exists() const;
298
299       /// This function determines if the path name references a readable file
300       /// or directory in the file system. Unlike isFile and isDirectory, this 
301       /// function actually checks for the existence and readability (by the
302       /// current program) of the file or directory.
303       /// @returns true if the pathname references a readable file.
304       /// @brief Determines if the path is a readable file or directory
305       /// in the file system.
306       bool readable() const;
307
308       /// This function determines if the path name references a writable file
309       /// or directory in the file system. Unlike isFile and isDirectory, this 
310       /// function actually checks for the existence and writability (by the
311       /// current program) of the file or directory.
312       /// @returns true if the pathname references a writable file.
313       /// @brief Determines if the path is a writable file or directory
314       /// in the file system.
315       bool writable() const;
316
317       /// This function determines if the path name references an executable 
318       /// file in the file system. Unlike isFile and isDirectory, this 
319       /// function actually checks for the existence and executability (by 
320       /// the current program) of the file.
321       /// @returns true if the pathname references an executable file.
322       /// @brief Determines if the path is an executable file in the file 
323       /// system.
324       bool executable() const;
325
326       /// This function returns the current contents of the path as a
327       /// std::string. This allows the underlying path string to be manipulated
328       /// by other software.
329       /// @returns std::string containing the path name.
330       /// @brief Returns the path as a std::string.
331       const std::string& toString() const { return path; }
332
333       /// This function returns the last component of the path name. If the
334       /// isDirectory() function would return true then this returns the name
335       /// of the last directory in the path. If the isFile() function would
336       /// return true then this function returns the name of the file without
337       /// any of the preceding directories.
338       /// @returns std::string containing the last component of the path name.
339       /// @brief Returns the last component of the path name.
340       std::string getLast() const;
341
342       /// This function strips off the path and suffix of the file name and
343       /// returns just the basename.
344       /// @returns std::string containing the basename of the path
345       /// @throws nothing
346       /// @brief Get the base name of the path
347       std::string getBasename() const;
348
349       /// This function builds a list of paths that are the names of the
350       /// files and directories in a directory.
351       /// @returns false if \p this is not a directory, true otherwise
352       /// @throws std::string if the directory cannot be searched
353       /// @brief Build a list of directory's contents.
354       bool getDirectoryContents(std::set<Path>& paths) const;
355
356       /// Obtain a 'C' string for the path name.
357       /// @returns a 'C' string containing the path name.
358       /// @brief Returns the path as a C string.
359       const char* const c_str() const { return path.c_str(); }
360
361     /// @}
362     /// @name Mutators
363     /// @{
364     public:
365       /// The path name is cleared and becomes empty. This is an invalid
366       /// path name but is the *only* invalid path name. This is provided
367       /// so that path objects can be used to indicate the lack of a 
368       /// valid path being found.
369       void clear() { path.clear(); }
370
371       /// This function returns status information about the file. The type of
372       /// path (file or directory) is updated to reflect the actual contents 
373       /// of the file system. If the file does not exist, false is returned. 
374       /// For other (hard I/O) errors, a std::string is throwing indicating the
375       /// problem.
376       /// @throws std::string if an error occurs.
377       /// @brief Get file status.
378       void getStatusInfo(StatusInfo& info) const;
379
380       /// This function returns the last modified time stamp for the file 
381       /// referenced by this path. The Path may reference a file or a directory.
382       /// If the file does not exist, a ZeroTime timestamp is returned.
383       /// @returns last modified timestamp of the file/directory or ZeroTime
384       /// @brief Get file timestamp.
385       inline TimeValue getTimestamp() const {
386         StatusInfo info; getStatusInfo(info); return info.modTime;
387       }
388
389       /// This function returns the size of the file referenced by this path. 
390       /// @brief Get file size.
391       inline size_t getSize() const {
392         StatusInfo info; getStatusInfo(info); return info.fileSize;
393       }
394
395       /// This method attempts to make the file referenced by the Path object
396       /// available for reading so that the readable() method will return true.
397       /// @brief Make the file readable;
398       void makeReadable();
399
400       /// This method attempts to make the file referenced by the Path object
401       /// available for writing so that the writable() method will return true.
402       /// @brief Make the file writable;
403       void makeWriteable();
404
405       /// This method attempts to make the file referenced by the Path object
406       /// available for execution so that the executable() method will return 
407       /// true.
408       /// @brief Make the file readable;
409       void makeExecutable();
410
411       /// This method attempts to set the Path object to \p unverified_path
412       /// and interpret the name as a directory name.  The \p unverified_path 
413       /// is verified. If verification succeeds then \p unverified_path 
414       /// is accepted as a directory and true is returned. Otherwise,
415       /// the Path object remains unchanged and false is returned.
416       /// @returns true if the path was set, false otherwise.
417       /// @param unverified_path The path to be set in Path object.
418       /// @throws nothing
419       /// @brief Set a full path from a std::string
420       bool setDirectory(const std::string& unverified_path);
421
422       /// This method attempts to set the Path object to \p unverified_path
423       /// and interpret the name as a file name.  The \p unverified_path 
424       /// is verified. If verification succeeds then \p unverified_path 
425       /// is accepted as a file name and true is returned. Otherwise,
426       /// the Path object remains unchanged and false is returned.
427       /// @returns true if the path was set, false otherwise.
428       /// @param unverified_path The path to be set in Path object.
429       /// @throws nothing
430       /// @brief Set a full path from a std::string
431       bool setFile(const std::string& unverified_path);
432
433       /// The \p dirname is added to the end of the Path if it is a legal
434       /// directory name for the operating system. The precondition for this 
435       /// function is that the Path must reference a directory name (i.e.
436       /// isDirectory() returns true).
437       /// @param dirname A string providing the directory name to
438       /// be added to the end of the path.
439       /// @returns false if the directory name could not be added
440       /// @throws nothing
441       /// @brief Adds the name of a directory to a Path.
442       bool appendDirectory( const std::string& dirname );
443
444       /// One directory component is removed from the Path name. The Path must
445       /// refer to a non-root directory name (i.e. isDirectory() returns true
446       /// but isRootDirectory() returns false). Upon exit, the Path will 
447       /// refer to the directory above it.
448       /// @throws nothing
449       /// @returns false if the directory name could not be removed.
450       /// @brief Removes the last directory component of the Path.
451       bool elideDirectory();
452
453       /// The \p filename is added to the end of the Path if it is a legal
454       /// directory name for the operating system. The precondition for this
455       /// function is that the Path reference a directory name (i.e. 
456       /// isDirectory() returns true).
457       /// @throws nothing
458       /// @returns false if the file name could not be added.
459       /// @brief Appends the name of a file.
460       bool appendFile( const std::string& filename );
461
462       /// One file component is removed from the Path name. The Path must
463       /// refer to a file (i.e. isFile() returns true). Upon exit, 
464       /// the Path will refer to the directory above it.
465       /// @throws nothing
466       /// @returns false if the file name could not be removed
467       /// @brief Removes the last file component of the path.
468       bool elideFile();
469
470       /// A period and the \p suffix are appended to the end of the pathname.
471       /// The precondition for this function is that the Path reference a file
472       /// name (i.e. isFile() returns true). If the Path is not a file, no 
473       /// action is taken and the function returns false. If the path would
474       /// become invalid for the host operating system, false is returned.
475       /// @returns false if the suffix could not be added, true if it was.
476       /// @throws nothing
477       /// @brief Adds a period and the \p suffix to the end of the pathname. 
478       bool appendSuffix(const std::string& suffix);
479
480       /// The suffix of the filename is removed. The suffix begins with and
481       /// includes the last . character in the filename after the last directory
482       /// separator and extends until the end of the name. If no . character is
483       /// after the last directory separator, then the file name is left
484       /// unchanged (i.e. it was already without a suffix) but the function 
485       /// returns false.
486       /// @returns false if there was no suffix to remove, true otherwise.
487       /// @throws nothing
488       /// @brief Remove the suffix from a path name.
489       bool elideSuffix();
490
491       /// The current Path name is made unique in the file system. Upon return,
492       /// the Path will have been changed to make a unique file in the file 
493       /// system or it will not have been changed if the current path name is
494       /// already unique. 
495       /// @throws std::string if an unrecoverable error occurs.
496       /// @brief Make the current path name unique in the file system.
497       void makeUnique();
498
499       /// This method attempts to create a directory in the file system with the
500       /// same name as the Path object. The \p create_parents parameter controls
501       /// whether intermediate directories are created or not. if \p
502       /// create_parents is true, then an attempt will be made to create all
503       /// intermediate directories. If \p create_parents is false, then only the
504       /// final directory component of the Path name will be created. The 
505       /// created directory will have no entries. 
506       /// @returns false if the Path does not reference a directory, true 
507       /// otherwise.
508       /// @param create_parents Determines whether non-existent directory
509       /// components other than the last one (the "parents") are created or not.
510       /// @throws std::string if an error occurs.
511       /// @brief Create the directory this Path refers to.
512       bool createDirectory( bool create_parents = false );
513
514       /// This method attempts to create a file in the file system with the same
515       /// name as the Path object. The intermediate directories must all exist
516       /// at the time this method is called. Use createDirectories to 
517       /// accomplish that. The created file will be empty upon return from this
518       /// function.
519       /// @returns false if the Path does not reference a file, true otherwise.
520       /// @throws std::string if an error occurs.
521       /// @brief Create the file this Path refers to.
522       bool createFile();
523
524       /// This is like createFile except that it creates a temporary file. A 
525       /// unique temporary file name is generated based on the contents of 
526       /// \p this before the call. The new name is assigned to \p this and the
527       /// file is created.  Note that this will both change the Path object
528       /// *and* create the corresponding file. This function will ensure that
529       /// the newly generated temporary file name is unique in the file system.
530       /// @throws std::string if there is an error
531       /// @brief Create a unique temporary file
532       bool createTemporaryFile();
533
534       /// This method attempts to destroy the directory named by the last in 
535       /// the Path name.  If \p remove_contents is false, an attempt will be 
536       /// made to remove just the directory that this Path object refers to 
537       /// (the final Path component). If \p remove_contents is true, an attempt
538       /// will be made to remove the entire contents of the directory, 
539       /// recursively. 
540       /// @param destroy_contents Indicates whether the contents of a destroyed
541       /// directory should also be destroyed (recursively). 
542       /// @returns false if the Path does not refer to a directory, true 
543       /// otherwise.
544       /// @throws std::string if there is an error.
545       /// @brief Removes the file or directory from the filesystem.
546       bool destroyDirectory( bool destroy_contents = false );
547
548       /// This method attempts to destroy the file named by the last item in the
549       /// Path name. 
550       /// @returns false if the Path does not refer to a file, true otherwise.
551       /// @throws std::string if there is an error.
552       /// @brief Destroy the file this Path refers to.
553       bool destroyFile(); 
554
555       /// This method renames the file referenced by \p this as \p newName. Both
556       /// files must exist before making this call.
557       /// @returns false if the Path does not refer to a file, true otherwise.
558       /// @throws std::string if there is an file system error.
559       /// @brief Rename one file as another.
560       bool renameFile(const Path& newName);
561
562       /// This method sets the access time, modification time, and permission
563       /// mode of the file associated with \p this as given by \p si.  
564       /// @returns false if the Path does not refer to a file, true otherwise.
565       /// @throws std::string if the file could not be modified
566       /// @brief Set file times and mode.
567       bool setStatusInfo(const StatusInfo& si ) const ;
568
569     /// @}
570     /// @name Data
571     /// @{
572     private:
573         mutable std::string path;   ///< Storage for the path name.
574
575     /// @}
576   };
577
578   /// This enumeration delineates the kinds of files that LLVM knows about.
579   enum LLVMFileType {
580     UnknownFileType = 0,            ///< Unrecognized file
581     BytecodeFileType = 1,           ///< Uncompressed bytecode file
582     CompressedBytecodeFileType = 2, ///< Compressed bytecode file
583     ArchiveFileType = 3,            ///< ar style archive file
584   };
585
586   /// This utility function allows any memory block to be examined in order
587   /// to determine its file type.
588   LLVMFileType IdentifyFileType(const char*magic, unsigned length);
589
590   /// This function can be used to copy the file specified by Src to the
591   /// file specified by Dest. If an error occurs, Dest is removed.
592   /// @throws std::string if an error opening or writing the files occurs.
593   /// @brief Copy one file to another.
594   void CopyFiles(const Path& Dest, const Path& Src);
595 }
596
597 inline std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath) {
598   strm << aPath.toString();
599   return strm;
600 }
601
602 }
603
604 // vim: sw=2
605
606 #endif