XRef Class Reference


Detailed Description

XRef provides functionality to resolve relative paths to external.

files into absolute paths

Definition at line 35 of file xref.h.

#include <xref.h>

Inheritance diagram for XRef:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void  AddAbsoluteUrl (QString sAbsoluteUrl)
  Adds an absolute url to the XRef object.
QString  ResolveUrl (const QString &sRelativeUrl) const
  Attempts to resolve the given url to a absolute url to an existing file or directory.
QStringList  ResolveUrls (const QString &sRelativeUrl) const
  Attempts to resolve the given url to absolute urls to existing files or directories.
QFileInfoList  ResolveUrls (const QString &sRelativeUrl, const QString &sNameFilter, QDir::Filters eTypeFilters=QDir::Files) const
  Attempts to resolve the given url to absolute urls to existing files or directories.

Protected Member Functions

virtual  ~XRef ()

Protected Attributes

QVector< QFileInfo >  m_aAbsPaths

Constructor & Destructor Documentation

virtual ~XRef ( ) [protected, virtual]

Member Function Documentation

void AddAbsoluteUrl ( QString  sAbsoluteUrl )

Adds an absolute url to the XRef object.

The XRef object will attempt to resolve relative urls using the absolute urls registered with this method.

Parameters:
[in] sAbsoluteUrl The new absolute url to register
QString ResolveUrl ( const QString &  sRelativeUrl ) const

Attempts to resolve the given url to a absolute url to an existing file or directory.

If none is found, this method will return the url that was passed in. Note that resolution against the absolute urls takes place in the reverse order that they were added. In other words the last absolute url registered with this object is the first to be checked.

Parameters:
[in] sRelativeUrl The relative url to resolve
QStringList ResolveUrls ( const QString &  sRelativeUrl ) const

Attempts to resolve the given url to absolute urls to existing files or directories.

Returns a list of matching urls. If no valid urls are found, this method will return an empty list.

Parameters:
[in] sRelativeUrl The relative url to resolve
QFileInfoList ResolveUrls ( const QString &  sRelativeUrl,
const QString &  sNameFilter,
QDir::Filters  eTypeFilters = QDir::Files 
) const

Attempts to resolve the given url to absolute urls to existing files or directories.

Returns a list of matching urls. If no valid urls are found, this method will return an empty list.

For example, say you have the following directory structure: c:/folder1/folder2/file1.png c:/folder1/folder2/file2.tga c:/folder3/folder2/file1.png c:/folder3/folder2/file2.tga

And your code looks like: Kernel()->XRef()->AddAbsoluteUrl( "c:/folder1/" ); Kernel()->XRef()->AddAbsoluteUrl( "c:/folder3/" );

QFileInfoList cList = Kernel()->XRef()->ResolveUrls( "folder2", "*.png" );

cList will contain two elements: c:/folder3/folder2/file1.png c:/folder1/folder2/file1.png

Parameters:
[in] sRelativeUrl The relative url to resolve
[in] sNameFilter wildcard pattern to match urls, for example "*.mud"
[in] eTypeFilters The types of directory entries to match. See the QDir docs for more details.

Member Data Documentation

QVector< QFileInfo > m_aAbsPaths [protected]

Definition at line 97 of file xref.h.


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

XRef XRef XRef XRef XRef XRef XRef XRef XRef XRef
XRef XRef XRef XRef XRef XRef XRef XRef XRef XRef