Reid Spencer | b89a223 | 2004-08-25 06:20:07 +0000 | [diff] [blame] | 1 | //===-- Path.cpp - Implement OS Path 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 header file implements the operating system Path concept. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
Reid Spencer | 8e66595 | 2004-08-29 05:24:01 +0000 | [diff] [blame^] | 13 | |
Reid Spencer | b89a223 | 2004-08-25 06:20:07 +0000 | [diff] [blame] | 14 | #include "llvm/System/Path.h" |
| 15 | |
| 16 | namespace llvm { |
Reid Spencer | 8e66595 | 2004-08-29 05:24:01 +0000 | [diff] [blame^] | 17 | using namespace sys; |
Reid Spencer | b89a223 | 2004-08-25 06:20:07 +0000 | [diff] [blame] | 18 | |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | //=== WARNING: Implementation here must contain only TRULY operating system |
| 21 | //=== independent code. |
| 22 | //===----------------------------------------------------------------------===// |
| 23 | |
| 24 | bool |
Reid Spencer | 8e66595 | 2004-08-29 05:24:01 +0000 | [diff] [blame^] | 25 | Path::is_file() const { |
| 26 | return (is_valid() && path[path.length()-1] != '/'); |
Reid Spencer | b89a223 | 2004-08-25 06:20:07 +0000 | [diff] [blame] | 27 | } |
| 28 | |
Reid Spencer | 8e66595 | 2004-08-29 05:24:01 +0000 | [diff] [blame^] | 29 | bool |
| 30 | Path::is_directory() const { |
| 31 | return (is_valid() && path[path.length()-1] == '/'); |
Reid Spencer | b89a223 | 2004-08-25 06:20:07 +0000 | [diff] [blame] | 32 | } |
| 33 | |
Reid Spencer | b89a223 | 2004-08-25 06:20:07 +0000 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | // Include the truly platform-specific parts of this class. |
| 37 | #include "platform/Path.cpp" |
Reid Spencer | b89a223 | 2004-08-25 06:20:07 +0000 | [diff] [blame] | 38 | |
| 39 | // vim: sw=2 |