Slice Tools
  • Home
  • SourceForge Page


  • libFoundation
  • Home
  • Class Hierarchy
  • Class List
  • Class Members
  • Examples


  • SourceForge.net Logo
     

    FileSystem Class Reference

    #include <FileSystem.hh>

    List of all members.


    Detailed Description

    Simple Wrappers for checking various attributes of the file system.

    All methods are static, so instantiating this class is not required (methods can be accessed via result = FileSystem::methodName())


    Public Member Functions

     FileSystem ()
     All methods are static so instantiating this class is not required.


    Static Public Member Functions

    bool doesFileExist (const char *pathname)
    bool isReadableFile (const char *filename)
    bool isExecutableFile (const char *filename)
    bool isWritableFile (const char *filename)
    bool isCreatableFile (const char *filename)
    bool isDirectory (const char *dirname)
    bool isReadableDir (const char *dirname)
    bool isWritableDir (const char *dirname)
    bool isCreatableDir (const char *dirname)
    bool isCreatablePath (const char *pathname)
    char * getAbsolutePath ()
     Returns a pointer to a static buffer containing the absolute path of the CWD.

    int getPID ()
    std::string getPIDString ()
    std::ofstream * openOutputFile (const std::string &filename)
     Tries to open a file for appending, and throws an exception if it cant.

    std::ifstream * openInputFile (const std::string &filename)
     Tries to open a file for reading, and throws an exception if it cant.


    Constructor & Destructor Documentation

    FileSystem::FileSystem  ) 
     

    All methods are static so instantiating this class is not required.


    Member Function Documentation

    bool FileSystem::doesFileExist const char *  pathname  )  [static]
     

    char * FileSystem::getAbsolutePath  )  [static]
     

    Returns a pointer to a static buffer containing the absolute path of the CWD.

    Note: The buffer will be overwritten by each call to getAbsolutePath

    int FileSystem::getPID  )  [static]
     

    std::string FileSystem::getPIDString  )  [static]
     

    bool FileSystem::isCreatableDir const char *  dirname  )  [static]
     

    bool FileSystem::isCreatableFile const char *  filename  )  [static]
     

    bool FileSystem::isCreatablePath const char *  pathname  )  [static]
     

    bool FileSystem::isDirectory const char *  dirname  )  [static]
     

    bool FileSystem::isExecutableFile const char *  filename  )  [static]
     

    bool FileSystem::isReadableDir const char *  dirname  )  [static]
     

    bool FileSystem::isReadableFile const char *  filename  )  [static]
     

    bool FileSystem::isWritableDir const char *  dirname  )  [static]
     

    bool FileSystem::isWritableFile const char *  filename  )  [static]
     

    std::ifstream * FileSystem::openInputFile const std::string &  filename  )  [static]
     

    Tries to open a file for reading, and throws an exception if it cant.

    Wraps ifstream constructor.

    Parameters:
    filename Name of file to open
    Exceptions:
    UnableToOpenError If the file can't be opened for some reason
    Returns:
    Pointer to ifstream of filename or NULL if filename == ""

    std::ofstream * FileSystem::openOutputFile const std::string &  filename  )  [static]
     

    Tries to open a file for appending, and throws an exception if it cant.

    Parameters:
    filename Name of file to open
    Exceptions:
    UnableToOpenError If the file can't be opened for some reason
    Returns:
    Pointer to ofstream of filename or NULL if filename == ""


    The documentation for this class was generated from the following files: