blob: 93c1e0a7100718b4b73e5e30875e7a964f1b0670 [file] [log] [blame]
Reid Spencerb89a2232004-08-25 06:20:07 +00001//===-- 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 Spencer8e665952004-08-29 05:24:01 +000013
Reid Spencerb89a2232004-08-25 06:20:07 +000014#include "llvm/System/Path.h"
15
16namespace llvm {
Reid Spencer8e665952004-08-29 05:24:01 +000017using namespace sys;
Reid Spencerb89a2232004-08-25 06:20:07 +000018
19//===----------------------------------------------------------------------===//
20//=== WARNING: Implementation here must contain only TRULY operating system
21//=== independent code.
22//===----------------------------------------------------------------------===//
23
24bool
Reid Spencer8e665952004-08-29 05:24:01 +000025Path::is_file() const {
26 return (is_valid() && path[path.length()-1] != '/');
Reid Spencerb89a2232004-08-25 06:20:07 +000027}
28
Reid Spencer8e665952004-08-29 05:24:01 +000029bool
30Path::is_directory() const {
31 return (is_valid() && path[path.length()-1] == '/');
Reid Spencerb89a2232004-08-25 06:20:07 +000032}
33
Reid Spencerb89a2232004-08-25 06:20:07 +000034}
35
36// Include the truly platform-specific parts of this class.
37#include "platform/Path.cpp"
Reid Spencerb89a2232004-08-25 06:20:07 +000038
39// vim: sw=2