IO Namespace Reference

Namespace for all file loading/saving functions. More...


Classes

struct  _PWTHeader
 The header for the PWT file format. More...

Typedefs

typedef struct _PWTHeader PWTHeader

Enumerations

enum  Code {
  CODE_OK = 1, CODE_OPEN_FAILED = 0, CODE_WRONG_MAGIC_NUM = -1, CODE_WRONG_VERSION = -2,
  CODE_VALIDATE_FAILED = -3
}
 Various error codes that are used to identify if something went wrong.

Functions

IO::Code save_case_to_file (const Glib::ustring &path, const Case::Case &pcase, const BufferMap &buffers, std::map< Glib::ustring, Glib::ustring > &bufferDescriptions)
 Save a case and its associated data to file.
IO::Code export_case_to_file (const Glib::ustring &path, const Case::Case &pcase, const BufferMap &buffers)
 Export a case to file.
IO::Code load_case_from_file (const Glib::ustring &path, Case::Case &pcase, BufferMap &buffers, std::map< Glib::ustring, Glib::ustring > &bufferDescriptions)
 Load a case from file.
IO::Code save_sprite_to_file (const Glib::ustring &path, const Sprite &spr)
 Save a sprite to file.
IO::Code export_sprite_to_file (const Glib::ustring &path, const Sprite &spr)
 Export a sprite to file.
IO::Code load_sprite_from_file (const Glib::ustring &path, Sprite &spr)
 Load a sprite from file.
void write_string (FILE *f, const Glib::ustring &str)
 Write a string to file.
Glib::ustring read_string (FILE *f)
 Read a string from file.
void write_export_image (FILE *f, const Glib::RefPtr< Gdk::Pixbuf > &pixbuf)
 Write a pixbuf to compressed, internal format.
void write_pixbuf (FILE *f, const Glib::RefPtr< Gdk::Pixbuf > &pixbuf)
 Write a pixbuf in uncompressed format to file.
Glib::RefPtr
< Gdk::Pixbuf > 
read_pixbuf (FILE *f)
 Read an uncompressed pixbuf from file.
void add_recent_file (const Glib::ustring &uri, const Glib::ustring &display)
 Add a file to the recent files record.
IO::Code read_recent_files (std::vector< StringPair > &vec)
 Read the recent files record.
IO::Code unpack_resource_file (const Glib::ustring &file)
 Unpack the resource file.
IO::Code read_icons_from_file (IconMap &icons)
 Read icons from a theme file.

Variables

const int FILE_MAGIC_NUM = (('T' << 16) + ('W' << 8) + 'P')
 Magic number for PWT file format.
const int FILE_VERSION = 10
 Supported version for PWT file.
const Glib::ustring SPR_MAGIC_NUM = "SPR"
 Magic number for SPR file format.
const int SPR_VERSION = 10
 Supported SPR file version.
const long RESOURCE_FILE_SIZE = 192434
 The expected size in bytes of the resource file.


Detailed Description

Namespace for all file loading/saving functions.

Function Documentation

void IO::add_recent_file ( const Glib::ustring &  uri,
const Glib::ustring &  display 
)

Add a file to the recent files record.

Parameters:
uri The path to the recent file
display The display string

IO::Code IO::export_case_to_file ( const Glib::ustring &  path,
const Case::Case pcase,
const BufferMap &  buffers 
)

Export a case to file.

Parameters:
path The path to export to
pcase The case to export
buffers The buffers in this case
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

IO::Code IO::export_sprite_to_file ( const Glib::ustring &  path,
const Sprite spr 
)

Export a sprite to file.

Parameters:
path The path to export to
spr The Sprite to export
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

IO::Code IO::load_case_from_file ( const Glib::ustring &  path,
Case::Case pcase,
BufferMap &  buffers,
std::map< Glib::ustring, Glib::ustring > &  bufferDescriptions 
)

Load a case from file.

Parameters:
path The path to the case file to load
pcase Empty Case object to populate
buffers Empty buffer map to populate
bufferDescriptions Empty map of descriptions to populate
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

IO::Code IO::load_sprite_from_file ( const Glib::ustring &  path,
Sprite spr 
)

Load a sprite from file.

Parameters:
path The path to the sprite to load
spr Empty Sprite object to populate
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

IO::Code IO::read_icons_from_file ( IconMap &  icons  ) 

Read icons from a theme file.

Parameters:
icons Empty map of icons to populate
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

Glib::RefPtr< Gdk::Pixbuf > IO::read_pixbuf ( FILE *  f  ) 

Read an uncompressed pixbuf from file.

Parameters:
f Pointer to open FILE handle
Returns:
The resulting image

IO::Code IO::read_recent_files ( std::vector< StringPair > &  vec  ) 

Read the recent files record.

Parameters:
vec Empty vector to populate with files
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

Glib::ustring IO::read_string ( FILE *  f  ) 

Read a string from file.

Parameters:
f Pointer to open FILE handle
Returns:
The resulting string

IO::Code IO::save_case_to_file ( const Glib::ustring &  path,
const Case::Case pcase,
const BufferMap &  buffers,
std::map< Glib::ustring, Glib::ustring > &  bufferDescriptions 
)

Save a case and its associated data to file.

Parameters:
path The path to save to
pcase The case to save
buffers The buffers in this case
bufferDescriptions Descriptions of buffers
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

IO::Code IO::save_sprite_to_file ( const Glib::ustring &  path,
const Sprite spr 
)

Save a sprite to file.

Parameters:
path The path to save to
spr The Sprite object to save
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

IO::Code IO::unpack_resource_file ( const Glib::ustring &  file  ) 

Unpack the resource file.

Parameters:
file The path to the resource file
Returns:
IO::CODE_OK if successful, other codes if an error occurred.

void IO::write_export_image ( FILE *  f,
const Glib::RefPtr< Gdk::Pixbuf > &  pixbuf 
)

Write a pixbuf to compressed, internal format.

Parameters:
f Pointer to open FILE handle
pixbuf The actual image data to write

void IO::write_pixbuf ( FILE *  f,
const Glib::RefPtr< Gdk::Pixbuf > &  pixbuf 
)

Write a pixbuf in uncompressed format to file.

Parameters:
f Pointer to open FILE handle
pixbuf The image data to write

void IO::write_string ( FILE *  f,
const Glib::ustring &  str 
)

Write a string to file.

Parameters:
f Pointer to open FILE handle
str The string to write


Generated on Fri Feb 22 22:34:19 2008 for Phoenix Wright Case Editor API by  doxygen 1.5.3