Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

FileHandleC Class Reference

File handle class. More...

#include <FileHandleC.h>

Inheritance diagram for FileHandleC:

EditableI DataBlockI List of all members.

Public Methods

virtual Edit::DataBlockIcreate ()
 Creates new file handle.

virtual Edit::DataBlockIcreate (Edit::EditableI *pOriginal)
 Creates new file handle (used internally), see Edit::EditableI::create().

virtual void copy (Edit::EditableI *pEditable)
 Deep copy from a data block, see Edit::DataBlockI::copy().

virtual void restore (Edit::EditableI *pEditable)
 Shallow copy from a editable, see Edit::EditableI::restore().

virtual ImportableIget_importable ()
 Returns the importable the file handle refers to.

virtual void set_importable (ImportableI *pImportable)
 Sets the importable the file handle refers to. Used internally.

virtual PajaTypes::uint32 get_id ()
 Get serialization ID.

virtual void set_id (PajaTypes::uint32 i32ID)
 Set serialization ID.

virtual void inc_reference_count ()
 Increase reference count (used internally).

virtual void reset_reference_count ()
 Reset reference count (used internally).

virtual PajaTypes::int32 get_reference_count ()
 Returns reference count (used internally).

virtual FileHandleC * get_parent ()
 Returns file handle which is parent to this handle (used only in editor).

virtual void set_parent (FileHandleC *pHandle)
 Sets the file handle which is parent to this handle (used only in editor).

virtual PajaTypes::int32 get_parent_id ()
 Returns file handle ID which is parent to this handle (used only in editor).

virtual void set_parent_id (PajaTypes::int32 i32ID)
 Sets the file handle ID which is parent to this handle (used only in editor).

virtual const char * get_folder_name () const
 Returns the name of the folder if the file handle is used as a folder (used only in editor).

virtual void set_folder_name (const char *szName)
 Sets the the name of the folder if the file handle is used as a folder (used only in editor).

virtual void set_flags (PajaTypes::int32 i32Flags)
virtual void add_flags (PajaTypes::int32 i32Flags)
virtual void del_flags (PajaTypes::int32 i32Flags)
virtual void toggle_flags (PajaTypes::int32 i32Flags)
virtual PajaTypes::int32 get_flags ()
virtual PajaTypes::uint32 save (FileIO::SaveC *pSave)
 Save editable to a Demopaja output stream.

virtual PajaTypes::uint32 load (FileIO::LoadC *pLoad)
 Load editable from a Demopaja input stream.


Static Public Methods

FileHandleC * create_new ()
 Creates new file handle.


Protected Methods

 FileHandleC ()
 Default constructor.

 FileHandleC (Edit::EditableI *pOriginal)
 Default constructor with reference to the original.

virtual ~FileHandleC ()
 Default destructor.


Detailed Description

File handle class.

The data loaded into Demopaja can be accessed via ImportableI interface. This file handle class is used to hold that interface. Even if files fail to load the file handle will always be there, so the file handle works as kind of smart reference to the file.

This class is implemented by the system.


Constructor & Destructor Documentation

FileHandleC   [protected]
 

Default constructor.

FileHandleC Edit::EditableI   pOriginal [protected]
 

Default constructor with reference to the original.

virtual ~FileHandleC   [protected, virtual]
 

Default destructor.


Member Function Documentation

virtual void copy Edit::EditableI   pEditable [virtual]
 

Deep copy from a data block, see Edit::DataBlockI::copy().

Implements EditableI.

virtual Edit::DataBlockI* create Edit::EditableI   pOriginal [virtual]
 

Creates new file handle (used internally), see Edit::EditableI::create().

Implements EditableI.

virtual Edit::DataBlockI* create   [virtual]
 

Creates new file handle.

Implements EditableI.

FileHandleC* create_new   [static]
 

Creates new file handle.

virtual const char* get_folder_name   const [virtual]
 

Returns the name of the folder if the file handle is used as a folder (used only in editor).

virtual PajaTypes::uint32 get_id   [virtual]
 

Get serialization ID.

virtual ImportableI* get_importable   [virtual]
 

Returns the importable the file handle refers to.

The return value can be NULL if the file is not present (failure in load, etc.). Always check the return value.

virtual FileHandleC* get_parent   [virtual]
 

Returns file handle which is parent to this handle (used only in editor).

virtual PajaTypes::int32 get_parent_id   [virtual]
 

Returns file handle ID which is parent to this handle (used only in editor).

virtual PajaTypes::int32 get_reference_count   [virtual]
 

Returns reference count (used internally).

virtual void inc_reference_count   [virtual]
 

Increase reference count (used internally).

virtual PajaTypes::uint32 load FileIO::LoadC   pLoad [virtual]
 

Load editable from a Demopaja input stream.

Implements EditableI.

virtual void reset_reference_count   [virtual]
 

Reset reference count (used internally).

virtual void restore Edit::EditableI   pEditable [virtual]
 

Shallow copy from a editable, see Edit::EditableI::restore().

Implements EditableI.

virtual PajaTypes::uint32 save FileIO::SaveC   pSave [virtual]
 

Save editable to a Demopaja output stream.

Implements EditableI.

virtual void set_folder_name const char *    szName [virtual]
 

Sets the the name of the folder if the file handle is used as a folder (used only in editor).

virtual void set_id PajaTypes::uint32    i32ID [virtual]
 

Set serialization ID.

When the data is serialized out each file handle is given an ID which is used on to patch the file handles when the data is serialized in. The system sets this ID and it should not be changed.

See also:
FileIO::LoadC::add_file_handle_patch

virtual void set_importable ImportableI   pImportable [virtual]
 

Sets the importable the file handle refers to. Used internally.

virtual void set_parent FileHandleC *    pHandle [virtual]
 

Sets the file handle which is parent to this handle (used only in editor).

virtual void set_parent_id PajaTypes::int32    i32ID [virtual]
 

Sets the file handle ID which is parent to this handle (used only in editor).


Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions