LLVM API Documentation

llvm::sys::PathWithStatus Class Reference

Path with file status class. More...

#include <PathV1.h>

Inheritance diagram for llvm::sys::PathWithStatus:
Inheritance graph
[legend]
Collaboration diagram for llvm::sys::PathWithStatus:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Constructors
 PathWithStatus ()
 Default constructor.
 PathWithStatus (const PathWithStatus &that)
 Copy constructor.
 PathWithStatus (const Path &other)
 Path constructor.
 PathWithStatus (StringRef p)
 Construct a Path from a string.
 PathWithStatus (const char *StrStart, unsigned StrLen)
 Construct a Path from a string.
PathWithStatusoperator= (const PathWithStatus &that)
 Assignment Operator.
PathWithStatusoperator= (const Path &that)
 Assignment Operator.
Methods
const FileStatusgetFileStatus (bool forceUpdate=false, std::string *Error=0) const
 Get file status.

Detailed Description

Path with file status class.

This class is identical to Path class except it allows you to obtain the file status of the Path as well. The reason for the distinction is one of efficiency. First, the file status requires additional space and the space is incorporated directly into PathWithStatus without an additional malloc. Second, obtaining status information is an expensive operation on most operating systems so we want to be careful and explicit about where we allow this operation in LLVM.

Definition at line 626 of file PathV1.h.


Constructor & Destructor Documentation

llvm::sys::PathWithStatus::PathWithStatus ( ) [inline]

Default constructor.

Definition at line 631 of file PathV1.h.

llvm::sys::PathWithStatus::PathWithStatus ( const PathWithStatus that) [inline]

Copy constructor.

Definition at line 634 of file PathV1.h.

llvm::sys::PathWithStatus::PathWithStatus ( const Path other) [inline]

Path constructor.

This constructor allows construction from a Path object

Definition at line 640 of file PathV1.h.

llvm::sys::PathWithStatus::PathWithStatus ( StringRef  p) [inline, explicit]

Construct a Path from a string.

This constructor will accept a char* or std::string as a path. No checking is done on this path to determine if it is valid. To determine validity of the path, use the isValid method.

Parameters:
pThe path to assign.

Definition at line 647 of file PathV1.h.

llvm::sys::PathWithStatus::PathWithStatus ( const char *  StrStart,
unsigned  StrLen 
) [inline, explicit]

Construct a Path from a string.

This constructor will accept a character range as a path. No checking is done on this path to determine if it is valid. To determine validity of the path, use the isValid method.

Parameters:
StrStartPointer to the first character of the path
StrLenLength of the path.

Definition at line 655 of file PathV1.h.


Member Function Documentation

const FileStatus* llvm::sys::PathWithStatus::getFileStatus ( bool  forceUpdate = false,
std::string *  Error = 0 
) const

Get file status.

This function returns status information about the file. The type of path (file or directory) is updated to reflect the actual contents of the file system.

Returns:
0 on failure, with Error explaining why (if non-zero), otherwise returns a pointer to a FileStatus structure on success.
Parameters:
forceUpdateForce an update from the file system
ErrorOptional place to return an error msg.

Referenced by llvm::Archive::addFileBefore(), llvm::DiffFilesWithTolerance(), ExpandResponseFiles(), and llvm::ArchiveMember::replaceWith().

PathWithStatus& llvm::sys::PathWithStatus::operator= ( const PathWithStatus that) [inline]

Assignment Operator.

Makes a copy of that to this.

Returns:
this

Definition at line 663 of file PathV1.h.

PathWithStatus& llvm::sys::PathWithStatus::operator= ( const Path that) [inline]

Assignment Operator.

Makes a copy of that to this.

Returns:
this

Reimplemented from llvm::sys::Path.

Definition at line 673 of file PathV1.h.


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