src/Platform.h
changeset 251 ca99a81745fe
parent 86 32ad0523b309
     1.1 --- a/src/Platform.h	Sat Dec 29 00:55:38 2012 -0800
     1.2 +++ b/src/Platform.h	Tue Jan 01 15:34:07 2013 -0800
     1.3 @@ -2,19 +2,19 @@
     1.4   *
     1.5   * Copyright (C) 2012 David Anderson
     1.6   *
     1.7 - * This file is part of JITCraft.
     1.8 + * This file is part of SourcePawn.
     1.9   *
    1.10 - * JITCraft is free software: you can redistribute it and/or modify it under
    1.11 + * SourcePawn is free software: you can redistribute it and/or modify it under
    1.12   * the terms of the GNU General Public License as published by the Free
    1.13   * Software Foundation, either version 3 of the License, or (at your option)
    1.14   * any later version.
    1.15   * 
    1.16 - * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
    1.17 + * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY
    1.18   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.19   * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    1.20   *
    1.21   * You should have received a copy of the GNU General Public License along with
    1.22 - * JITCraft. If not, see http://www.gnu.org/licenses/.
    1.23 + * SourcePawn. If not, see http://www.gnu.org/licenses/.
    1.24   */
    1.25  #ifndef _include_jitcraft_platform_h_
    1.26  #define _include_jitcraft_platform_h_
    1.27 @@ -72,10 +72,28 @@
    1.28          }
    1.29      };
    1.30  
    1.31 +    enum PathType {
    1.32 +        Path_Invalid,
    1.33 +        Path_File,
    1.34 +        Path_Folder
    1.35 +    };
    1.36 +
    1.37 +    PathType InspectPath(const char *path);
    1.38 +
    1.39 +    // Converts a relative path into an absolute path, based on the current
    1.40 +    // working directory.
    1.41 +    bool GetAbsolutePath(const char *path, AutoFree<char> &chars);
    1.42 +
    1.43 +    // Splits a path into its constituent base folder and file. The path must
    1.44 +    // be an absolute path.
    1.45 +    bool SplitPath(const char *path, AutoFree<char> &base, AutoFree<char> &name);
    1.46 +
    1.47      // MapAlignedMemory is guaranteed to return zeroed memory.
    1.48      AlignableMapping MapAlignedMemory(size_t amount, size_t alignment, MapMode mode);
    1.49      void UnmapAlignedMemory(Address address, size_t size);
    1.50  
    1.51 +    const char *PathSeparator();
    1.52 +
    1.53      // The default alignment of memory returned via MapMemory().
    1.54      // :TODO: better ifdefs
    1.55  #ifdef _MSC_VER