93c1e0a7100718b4b73e5e30875e7a964f1b0670
[oota-llvm.git] / lib / System / Path.cpp
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 //===----------------------------------------------------------------------===//
13
14 #include "llvm/System/Path.h"
15
16 namespace llvm {
17 using namespace sys;
18
19 //===----------------------------------------------------------------------===//
20 //=== WARNING: Implementation here must contain only TRULY operating system
21 //===          independent code. 
22 //===----------------------------------------------------------------------===//
23
24 bool
25 Path::is_file() const {
26   return (is_valid() && path[path.length()-1] != '/');
27 }
28
29 bool
30 Path::is_directory() const {
31   return (is_valid() && path[path.length()-1] == '/');
32 }
33
34 }
35
36 // Include the truly platform-specific parts of this class.
37 #include "platform/Path.cpp"
38
39 // vim: sw=2