#include <xsi_filereference.h>
The FileReference class represents a reference to a file on disk.
When the user specifies the location of a file in a property page (for example, specifying the image file to use on a texture map) the string location is represented by the FileReference. This class uses two levels of path:
You can access the user path using the FileReference::GetPath function and it can contain environment variables and be relative to a project.
You can access the resolved path using either FileReference::GetResolvedPath or the FileReference::GetUNCPath which represents the actual full path (as a local or UNCPath).
Public Member Functions |
|
FileReference () | |
~FileReference () | |
FileReference (const CRef &in_ref) | |
FileReference (const FileReference &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
FileReference & | operator= (const FileReference &in_obj) |
FileReference & | operator= (const CRef &in_ref) |
CString | GetName () const |
CString | GetPath () |
CStatus | PutPath (const CString &in_Path) |
CString | GetFileType () const |
CString | GetResolvedPath () const |
bool | FileExists () const |
CString | GetUNCPath () const |
CString | GetGUID () const |
CRefArray | GetOwners () const |
ULONG | GetNumberOfFilesInSequence () const |
CString | GetFileInSequence (ULONG in_iIndex) const |
FileReference | ( | ) |
Default constructor.
~FileReference | ( | ) |
Default destructor.
FileReference | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
FileReference | ( | const FileReference & | in_obj | ) |
Copy constructor.
in_obj | constant class object. |
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from SIObject.
siClassID GetClassID | ( | ) | const [virtual] |
FileReference& operator= | ( | const FileReference & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
FileReference& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class object. |
Reimplemented from SIObject.
CString GetName | ( | ) | const |
Returns the name of the item.
Reimplemented from SIObject.
CString GetPath | ( | ) |
Returns the user path of the file object. The user path can
contain environment variables specified with either $
or %
(for example, $USERNAME
on Linux and
%USERNAME%
on Windows).
This function supports relative paths (relative to the project, the factory or the user location).
Sets the user path. The user path can contain environment
variables specified with either $
or %
(for example, $USERNAME
on Linux and
%USERNAME%
on Windows).
This function supports relative paths (relative to the project, the factory or the user location).
in_Path | The user path to set. |
CString GetFileType | ( | ) | const |
Returns the type of file. The different types include models, pictures, audio, actions, scripts, simulation, queries, and synoptic.
CString GetResolvedPath | ( | ) | const |
Returns the resolved path of this file object. If the path is on a local drive or is on a shared network resource mapped to a drive letter, the local path or drive letter is returned; otherwise, the UNCPath is returned.
c:\images\mysequence.[1..10].pic
bool FileExists | ( | ) | const |
Checks whether the file is valid or not.
CString GetUNCPath | ( | ) | const |
CString GetGUID | ( | ) | const |
Returns the GUID of the path. The GUID is a unique identifier for the dynamic life of a path. It should be used to retrieve a handle on the path object when dealing with the external file list.
CRefArray GetOwners | ( | ) | const |
ULONG GetNumberOfFilesInSequence | ( | ) | const |
Returns the number of files that this sequence of files contains. If the sequence consists of only one file, this property returns 1.
A file sequence is a set of multiple files with the same base
name, such as myfile.1.pic
, myfile.2.pic
,
etc. When rendering to disk, Softimage creates file sequences based
on a base filename that you provide in the Render
Options property page and when browsing the output folder,
Softimage displays file sequences as a single entity with an
annotation like: myfile
[1..2].pic.
CString GetFileInSequence | ( | ULONG | in_iIndex | ) | const |
Returns the resolved path of the specified file in the file sequence.
A file sequence is a set of multiple files with the same base
name, such as myfile.1.pic
, myfile.2.pic
,
etc. When rendering to disk, Softimage creates file sequences based
on a base filename that you provide in the Render
Options property page and when browsing the output folder,
Softimage displays file sequences as a single entity with an
annotation like: myfile
[1..2].pic.
in_iIndex | The zero-based index of the desired file. |
0
0