- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# IconSys Class Reference

A loader for the PS2 icon.sys files. More...

`#include <ps2_iconsys.hpp>`

List of all members.

## Public Member Functions
| IconSys ()
| Constructor.
| IconSys (const char *fname)
| Constructor.
| ~IconSys ()
| Destructor.
void | SetToDefault ()
| Fills the File structure with default values.
char const * | GetTitle () const
| Get the title string as displayed by the PS2s file manager.
void | SetTitle (char const *str)
| Set the title string (both S-JIS and ASCII).
void | SetLinebreak (int lb)
| Set the title string linebreak.
char const * | GetTitleSingleLine () const
| Get the title string without enclosed linebreaks.
char const * | GetIconFilename () const
| Get the filename of the standard icon referenced by the file.
void | SetIconFilename (char const *fname)
| Set the standard icon filename.
char const * | GetIconCopyFilename () const
| Get the filename of the copy icon referenced by the file.
void | SetIconCopyFilename (char const *fname)
| Set the copy icon filename.
char const * | GetIconDeleteFilename () const
| Get the filename of the delete icon referenced by the file.
void | SetIconDeleteFilename (char const *fname)
| Set the delete icon filename.
int | GetBackgroundOpacity () const
| Get the background opacity value.
void | SetBackgroundOpacity (int i)
| Set the background opacity.
IconSys_Color | GetBackgroundColor_UL () const
| Get the color of the upper left corner.
void | SetBackgroundColor_UL (IconSys_Color const &c)
| Set the color of the upper left corner.
IconSys_Color | GetBackgroundColor_UR () const
| Get the color of the upper right corner.
void | SetBackgroundColor_UR (IconSys_Color const &c)
| Set the color of the upper right corner.
IconSys_Color | GetBackgroundColor_LL () const
| Get the color of the lower left corner.
void | SetBackgroundColor_LL (IconSys_Color const &c)
| Set the color of the lower left corner.
IconSys_Color | GetBackgroundColor_LR () const
| Get the color of the lower right corner.
void | SetBackgroundColor_LR (IconSys_Color const &c)
| Set the color of the lower right corner.
IconSys_LightColor | GetLight1Color () const
| Get the color of light source #1.
void | SetLight1Color (IconSys_LightColor const &c)
| Set the color of light source #1.
IconSys_LightColor | GetLight2Color () const
| Get the color of light source #2.
void | SetLight2Color (IconSys_LightColor const &c)
| Set the color of light source #2.
IconSys_LightColor | GetLight3Color () const
| Get the color of light source #3.
void | SetLight3Color (IconSys_LightColor const &c)
| Set the color of light source #3.
IconSys_LightColor | GetLightAmbientColor () const
| Get the color of the ambient light source.
void | SetLightAmbientColor (IconSys_LightColor const &c)
| Set the color of the ambient light source.
IconSys_LightVec | GetLight1Dir () const
| Get the direction of light source #1.
void | SetLight1Dir (IconSys_LightVec const &v)
| Set the direction of light source #1.
IconSys_LightVec | GetLight2Dir () const
| Get the direction of light source #2.
void | SetLight2Dir (IconSys_LightVec const &v)
| Set the direction of light source #2.
IconSys_LightVec | GetLight3Dir () const
| Get the direction of light source #3.
void | SetLight3Dir (IconSys_LightVec const &v)
| Set the direction of light source #3.
void | WriteFile (char const *fname)
| Write the current data to a file.
## Classes
struct | File_t
| The main struct resembling a complete icon.sys file.
class | IconSys_Color
| This class stores integer color value data. More...
class | IconSys_LightColor
| This class stores float color value data. More...
class | IconSys_LightVec
| This class stores the light direction vectors. More...

## Detailed Description

A loader for the PS2 icon.sys files.

This class can be used to read and write icon.sys files.

The heart of the class is the File_t struct which resembles a complete icon.sys file on a binary basis. Due to their static structure, icon.sys files can be load by directly reading to a a File_t and written by directly writing from a File_t, which makes the implementation pretty straightforward.

The implementation of the S-JIS/ASCII converter is not very good and far from complete. While it supports all of alphanumeric characters and a few special chars it will certainly fail when encountering some more exotic chars. Feel free to augment/replace the DecodeTitle() function at your needs.

## Constructor & Destructor Documentation

IconSys::IconSys | ( | const char * | fname | ) |

Constructor.

Parameters:

  `[in]` | fname | Complete path to a valid icon.sys file

Exceptions:

  | Ghulbus::gbException | GB_FAILED indicates either a file read error or corrupt file;

## Member Function Documentation

char const * IconSys::GetTitle | ( |  | ) | const

Get the title string as displayed by the PS2s file manager.

Returns:
  The file's title as a null terminated C-String

void IconSys::SetTitle | ( | char const * | str | ) |

Set the title string (both S-JIS and ASCII).

Parameters:

  `[in]` | str | A null-terminated C-string (at most 32 characters!)

Exceptions:

  | Ghulbus::gbException | GB_ILLEGALPARAMETER

void IconSys::SetLinebreak | ( | int | lb | ) |

Set the title string linebreak.

Parameters:

  `[in]` | lb | Position of the linebreak in the ASCII string (0..32)

Exceptions:

  | Ghulbus::gbException | GB_ILLEGALPARAMETER

char const * IconSys::GetTitleSingleLine | ( |  | ) | const

Get the title string without enclosed linebreaks.

Returns:
  The file's title as a null terminated C-string without enclosed linebreaks

char const * IconSys::GetIconFilename | ( |  | ) | const

Get the filename of the standard icon referenced by the file.

Returns:
  The standard icon's path as a null terminated C-string

void IconSys::SetIconFilename | ( | char const * | fname | ) |

Set the standard icon filename.

Parameters:

  `[in]` | fname | A null-terminated C-string (length at most 32)

Exceptions:

  | Ghulbus::gbException | GB_ILLEGALPARAMETER

char const * IconSys::GetIconCopyFilename | ( |  | ) | const

Get the filename of the copy icon referenced by the file.

Returns:
  The copy icon's path as a null terminated C-string

void IconSys::SetIconCopyFilename | ( | char const * | fname | ) |

Set the copy icon filename.

Parameters:

  `[in]` | fname | A null-terminated C-string (length at most 32)

Exceptions:

  | Ghulbus::gbException | GB_ILLEGALPARAMETER

char const * IconSys::GetIconDeleteFilename | ( |  | ) | const

Get the filename of the delete icon referenced by the file.

Returns:
  The delete icon's path as a null terminated C-string

void IconSys::SetIconDeleteFilename | ( | char const * | fname | ) |

Set the delete icon filename.

Parameters:

  `[in]` | fname | A null-terminated C-string (length at most 32)

Exceptions:

  | Ghulbus::gbException | GB_ILLEGALPARAMETER

int IconSys::GetBackgroundOpacity | ( |  | ) | const

Get the background opacity value.

Returns:
  The specified background opacity

Exceptions:

  | Ghulbus::gbException | GB_FAILED uint overflow;

void IconSys::SetBackgroundOpacity | ( | int | i | ) |

Set the background opacity.

Parameters:

  `[in]` | i | The new background opacity [0..255]

Exceptions:

  | Ghulbus::gbException | GB_ILLEGALPARAMETER

IconSys::IconSys_Color IconSys::GetBackgroundColor_UL | ( |  | ) | const

Get the color of the upper left corner.

Returns:
  The color of the upper left corner

IconSys::IconSys_Color IconSys::GetBackgroundColor_UR | ( |  | ) | const

Get the color of the upper right corner.

Returns:
  The color of the upper right corner

IconSys::IconSys_Color IconSys::GetBackgroundColor_LL | ( |  | ) | const

Get the color of the lower left corner.

Returns:
  The color of the lower left corner

IconSys::IconSys_Color IconSys::GetBackgroundColor_LR | ( |  | ) | const

Get the color of the lower right corner.

Returns:
  The color of the lower right corner

IconSys::IconSys_LightColor IconSys::GetLight1Color | ( |  | ) | const

Get the color of light source #1.

Returns:
  Light source's color

IconSys::IconSys_LightColor IconSys::GetLight2Color | ( |  | ) | const

Get the color of light source #2.

Returns:
  Light source's color

IconSys::IconSys_LightColor IconSys::GetLight3Color | ( |  | ) | const

Get the color of light source #3.

Returns:
  Light source's color

IconSys::IconSys_LightColor IconSys::GetLightAmbientColor | ( |  | ) | const

Get the color of the ambient light source.

Returns:
  Light source's color

IconSys::IconSys_LightVec IconSys::GetLight1Dir | ( |  | ) | const

Get the direction of light source #1.

Returns:
  The light source's direction vector

IconSys::IconSys_LightVec IconSys::GetLight2Dir | ( |  | ) | const

Get the direction of light source #2.

Returns:
  The light source's direction vector

IconSys::IconSys_LightVec IconSys::GetLight3Dir | ( |  | ) | const

Get the direction of light source #3.

Returns:
  The light source's direction vector

void IconSys::WriteFile | ( | char const * | fname | ) |

Write the current data to a file.

Parameters:

  `[in]` | fname | Name of the file to save to

Exceptions:

  | Ghulbus::gbException | GB_FAILED indicates a file access error;

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

- include/ps2_iconsys.hpp
- src/ps2_iconsys.cpp