1 //===-- Path.cpp - Implement OS Path Concept --------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This header file implements the operating system Path concept.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/System/Path.h"
19 //===----------------------------------------------------------------------===//
20 //=== WARNING: Implementation here must contain only TRULY operating system
21 //=== independent code.
22 //===----------------------------------------------------------------------===//
25 IdentifyFileType(const char*magic, unsigned length) {
26 assert(magic && "Invalid magic number string");
27 assert(length >=4 && "Invalid magic number length");
30 if (magic[1] == 'l' && magic[2] == 'v') {
32 return CompressedBytecodeFileType;
33 else if (magic[3] == 'm')
34 return BytecodeFileType;
40 if (memcmp(magic,"!<arch>\n",8) == 0)
41 return ArchiveFileType;
48 return UnknownFileType;
53 // Include the truly platform-specific parts of this class.
54 #include "platform/Path.cpp"
56 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab