dtDAL::DirectoryResourceTypeHandler Class Reference

Resource type handler for importing, removing, and describing directory based resources. More...

#include <directoryresourcetypehandler.h>

Inheritance diagram for dtDAL::DirectoryResourceTypeHandler:

dtDAL::ResourceTypeHandler

List of all members.

Public Member Functions

 DirectoryResourceTypeHandler (const DataType &dataType, const std::string &masterFile, const std::string &masterExtension, const std::string &resourceDirectoryExtension, const std::string &resourceDescription, std::vector< std::string > alternateMasterFiles)
virtual bool HandlesFile (const std::string &path, dtUtil::FileType type) const
 
Parameters:
path The full path to the file or directory to check.

virtual ResourceDescriptor CreateResourceDescriptor (const std::string &category, const std::string &fileName) const
 Creates a resource descriptor based on the path to the resource.
virtual const std::string ImportResourceToPath (const std::string &newName, const std::string &srcPath, const std::string &destCategoryPath) const
 Import a resource into a project given the file, and the path.
virtual void RemoveResource (const std::string &resourcePath) const
 removes a resource.
virtual bool ImportsDirectory () const
 
Returns:
true.

virtual bool ResourceIsDirectory () const
 
Returns:
true.

virtual const std::string & GetResourceDirectoryExtension () const
 
Returns:
the extension that the resource directory will have when imported

virtual const std::map
< std::string, std::string > & 
GetFileFilters () const
 
Returns:
a map of file extensions and their associated descriptions for rbody.

virtual const std::string & GetTypeHandlerDescription () const
 
Returns:
A short description of the type of resources this imports.

virtual const DataTypeGetResourceType () const
 
Returns:
The DataType for this instance.


Protected Member Functions

virtual ~DirectoryResourceTypeHandler ()


Detailed Description

Resource type handler for importing, removing, and describing directory based resources.

Constructor & Destructor Documentation

dtDAL::DirectoryResourceTypeHandler::DirectoryResourceTypeHandler ( const DataType dataType,
const std::string &  masterFile,
const std::string &  masterExtension,
const std::string &  resourceDirectoryExtension,
const std::string &  resourceDescription,
std::vector< std::string >  alternateMasterFiles 
)

dtDAL::DirectoryResourceTypeHandler::~DirectoryResourceTypeHandler (  )  [protected, virtual]


Member Function Documentation

bool dtDAL::DirectoryResourceTypeHandler::HandlesFile ( const std::string &  path,
dtUtil::FileType  type 
) const [virtual]

Parameters:
path The full path to the file or directory to check.

Parameters:
type The filetype, whether a directory or file.
Returns:
true if the file name refers to an rbody file.

Implements dtDAL::ResourceTypeHandler.

ResourceDescriptor dtDAL::DirectoryResourceTypeHandler::CreateResourceDescriptor ( const std::string &  category,
const std::string &  fileName 
) const [virtual]

Creates a resource descriptor based on the path to the resource.

Parameters:
category the category of the resource.
fileName the name of the file.
Returns:
The resource descriptor base on the path to the resource.

Implements dtDAL::ResourceTypeHandler.

const std::string dtDAL::DirectoryResourceTypeHandler::ImportResourceToPath ( const std::string &  newName,
const std::string &  srcPath,
const std::string &  destCategoryPath 
) const [virtual]

Import a resource into a project given the file, and the path.

THe path can be retrieved by calling ResourceHelper::createResourceCategory

See also:
ResourceHelper::createResourceCategory
Parameters:
newName the name to give the resource. This should not include the extension.
srcPath the path to the file or directory to import
destCategoryPath the full path to the destination. This must exist already.
Exceptions:
ExceptionEnum::ProjectFileNotFound if source of destination files do not exist.
ExceptionEnum::ProjectIOException if an error occurs copying the data.
Returns:
the display fileName associated with this resource

Implements dtDAL::ResourceTypeHandler.

void dtDAL::DirectoryResourceTypeHandler::RemoveResource ( const std::string &  resourcePath  )  const [virtual]

removes a resource.

The current directory will be the root of the project when this is called.

Parameters:
resourcePath path to the file the file getResourcePath returns

Implements dtDAL::ResourceTypeHandler.

virtual bool dtDAL::DirectoryResourceTypeHandler::ImportsDirectory (  )  const [inline, virtual]

Returns:
true.

A directory will be imported.

Implements dtDAL::ResourceTypeHandler.

virtual bool dtDAL::DirectoryResourceTypeHandler::ResourceIsDirectory (  )  const [inline, virtual]

Returns:
true.

Rbody resources are imported into a directory to hold all of the files.

Implements dtDAL::ResourceTypeHandler.

virtual const std::string& dtDAL::DirectoryResourceTypeHandler::GetResourceDirectoryExtension (  )  const [inline, virtual]

Returns:
the extension that the resource directory will have when imported

Implements dtDAL::ResourceTypeHandler.

virtual const std::map<std::string, std::string>& dtDAL::DirectoryResourceTypeHandler::GetFileFilters (  )  const [inline, virtual]

Returns:
a map of file extensions and their associated descriptions for rbody.

Implements dtDAL::ResourceTypeHandler.

virtual const std::string& dtDAL::DirectoryResourceTypeHandler::GetTypeHandlerDescription (  )  const [inline, virtual]

Returns:
A short description of the type of resources this imports.

This is set in the constructor.

Implements dtDAL::ResourceTypeHandler.

virtual const DataType& dtDAL::DirectoryResourceTypeHandler::GetResourceType (  )  const [inline, virtual]

Returns:
The DataType for this instance.

Implements dtDAL::ResourceTypeHandler.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008