InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDFile Class Reference

#include <IDFile.h>

Inheritance diagram for IDFile:

Public Types

typedef AFile inherited
 
typedef object_type data_type
 

Public Member Functions

 IDFile ()
 
 IDFile (const APath &path)
 
 IDFile (const IDPath &path)
 
 IDFile (const AString &pathStr)
 
 IDFile (const WideString &pathStr)
 
 IDFile (const AFile &file)
 
 IDFile (const IDFile &file)
 
virtual ~IDFile ()
 
IDFileoperator= (const IDFile &rhs)
 
 IDFile (IDFile &&rhs) noexcept
 
IDFileoperator= (IDFile &&rhs) noexcept
 
IDFileoperator= (const AFile &rhs)
 
bool operator== (const IDFile &rhs) const
 
bool operator!= (const IDFile &rhs) const
 
void SetPath (const IDPath &path)
 
void SetPath (const WideString &pathStr)
 
bool IsStationary () const
 
bool SetStationary (bool bStationary)
 
void ReadWrite (IPMStream *s)
 
 IDFile (const PMString &pathStr)
 
PMString GetFileName () const
 
bool16 SetFileName (const PMString &nameStr)
 

Friends

void swap (IDFile &a, IDFile &b) noexcept
 

Detailed Description

InDesign class used to manipulate a file or directory specified by a path.

See Also
AFile

Constructor & Destructor Documentation

IDFile::IDFile ()

Default constructor. Constructs an IDFile object pointing to the current working directory.

IDFile::IDFile (const APath & path)

Constructor. Constructs an IDFile object pointing to the given path.

Parameters
pathIN Path to set the file's path to.
IDFile::IDFile (const IDPathpath)

Constructor. Constructs an IDFile object pointing to the given path.

Parameters
pathIN Path to set the file's path to.
IDFile::IDFile (const AString & pathStr)

Constructor. Constructs an IDFile object pointing to the given path.

Parameters
pathStrIN String containing the path to set the file's path to.\ On Windows, a UTF16 UNC or local path.\ On the Mac, a UTF16 POSIX path
IDFile::IDFile (const WideStringpathStr)
explicit

Constructor. Constructs an IDFile object pointing to the given path.

Parameters
pathStrIN String containing the path to set the file's path to.\ On Windows, a UTF16 UNC or local path.\ On the Mac, a UTF16 POSIX path
IDFile::IDFile (const AFile & file)

Copy constructor. Constructs an IDFile object that is a copy of the given file.

Parameters
fileIN File object to copy.
IDFile::IDFile (const IDFilefile)

Copy constructor. Constructs an IDFile object that is a copy of the given file.

Parameters
fileIN File object to copy.
virtual IDFile::~IDFile ()
virtual

Destructor. Destroys the IDFile object.

IDFile::IDFile (const PMStringpathStr)
explicit

Constructor. Constructs an IDFile object pointing to the given path.

Parameters
pathStrIN String containing the path to set the file's path to.\ On Windows, a UTF16 UNC or local path.\ On the Mac, a Unicode POSIX path.

Member Function Documentation

PMString IDFile::GetFileName () const

Returns the last component of the file's path as a Unicode name. On the Mac, the name is returned as a Unicode POSIX file name; colons in the name are changed to forward slashes.

Returns
The last path component as a Unicode name.
bool IDFile::IsStationary () const

Returns whether the file is a stationary file. Returns the value of the file's stationary attribute.

Returns
True if a stationary file, else false.\ False if the file or directory does not exist and the attribute has not been set.
bool IDFile::operator!= (const IDFilerhs) const

Non-equality operator. Test whether this file's path is not identical to the given file's path.

Parameters
rhsIN File to test for non-equality against this file.
Returns
True if this file's path is not identical to the given file's path, else false.
IDFile& IDFile::operator= (const IDFilerhs)

Assignment operator. Assigns the given file to this file.

Parameters
rhsIN File to assign to this file.
Returns
Reference to this file.
IDFile& IDFile::operator= (const AFile & rhs)

Assignment operator. Assigns the given file to this file.

Parameters
rhsIN File to assign to this file.
Returns
Reference to this file.
bool IDFile::operator== (const IDFilerhs) const

Equality operator. Test whether this file's path is identical to the given file's path.

Parameters
rhsIN File to test for equality against this file.
Returns
True if this file's path is identical to the given file's path, else false.
void IDFile::ReadWrite (IPMStreams)

Persistence-related method for saving or restoring the state of an IDFile object instance.

Parameters
sIN Stream to read from or write to.
bool16 IDFile::SetFileName (const PMStringnameStr)

Sets the last component in the file's path. On the Mac, all forward slashes in the name are changed to colons.

Parameters
nameStrIN String containing the new file name, or an empty string to remove the last component in the file's path.
Returns
True if the last component was set, else false.
void IDFile::SetPath (const IDPathpath)

Sets the file's path.

Parameters
pathIN Path to set the file's path to. An empty path to remove file's path.
void IDFile::SetPath (const WideStringpathStr)

Sets the file's path.

Parameters
pathStrIN String containing the path to set the file's path to. An empty string to remove file's path.\ On Windows, a UTF16 UNC or local path.\ On the Mac, a UTF16 POSIX path
bool IDFile::SetStationary (bool bStationary)

Sets the file's stationary attribute.

Parameters
bStationaryIN Value of the stationary attribute.
Returns
True if the stationary attribute was successfully set, else false.

Friends And Related Function Documentation

void swap (IDFilea,
IDFileb 
)
friend

Swap function. Swaps this object with the passed in object.

Parameters
rhsIN File to swap with this file.