libmwaw_applepict1::OpCode Struct Reference

Internal and low level: a class to define each opcode and their arguments and read their data. More...

Inheritance diagram for libmwaw_applepict1::OpCode:

## Public Member Functions

| OpCode (int id, char const *nm, DataType type1=WP_NONE, DataType type2=WP_NONE, DataType type3=WP_NONE, DataType type4=WP_NONE, DataType type5=WP_NONE)
| constructor More...
virtual | ~OpCode ()
bool | readData (MWAWInputStream &input, std::vector< Value > &listValue) const
| tries to read the data in the file More...
bool | computeSize (MWAWInputStream &input, int &sz) const
| computes the size of the data More...

## Static Public Member Functions

static bool | readRect (MWAWInputStream &input, DataType type, Box2i &res)
| read a rectangles field More...

## Public Attributes

int | m_id
| the opCode More...
std::string | m_name
| the opCode name More...
std::vector< DataType > | m_types
| the different argument types More...

## Static Protected Member Functions

static int | getSize (MWAWInputStream &input, DataType type)
| returns the size of the next argument of type type. More...
static bool | readValue (MWAWInputStream &input, DataType type, Value &val)
| reads a argument of type type, if successfull updates val. More...
static bool | readInt (MWAWInputStream &input, DataType type, int &res)
| low level: reads a integer ( bytes or 2 bytes, signed or unsigned) More...
static bool | readColor (MWAWInputStream &input, DataType type, MWAWColor &col)
| low level: reads a color argument More...
static bool | readCColor (MWAWInputStream &input, DataType type, MWAWColor &col)
| low level: reads a color argument (version 2) More...
static bool | readPattern (MWAWInputStream &input, DataType type, int(&pat)[8])
| low level: reads a pattern argument More...
static bool | readPoint (MWAWInputStream &input, DataType type, Vec2i &res)
| low level: reads a point argument More...
static bool | readPoly (MWAWInputStream &input, DataType type, Box2i &box, std::vector< Vec2i > &res)
| low level: reads a polygon argument More...
static bool | readText (MWAWInputStream &input, DataType type, std::string &res)
| low level: reads a string argument More...

## Detailed Description

Internal and low level: a class to define each opcode and their arguments and read their data.

## Constructor & Destructor Documentation

libmwaw_applepict1::OpCode::OpCode | ( | int | id,
|  | char const * | nm,
|  | DataType | type1 = `WP_NONE`,
|  | DataType | type2 = `WP_NONE`,
|  | DataType | type3 = `WP_NONE`,
|  | DataType | type4 = `WP_NONE`,
|  | DataType | type5 = `WP_NONE`
| ) |  |

inline

constructor

Parameters

  id | is the code of the opcode in the file
  nm | is the short name of the opcode
  type1 |
  type2 |
  type3 |
  type4 |
  type5 | the type of the first, second, third arguments (if they exist)

virtual libmwaw_applepict1::OpCode::~OpCode | ( |  | ) |

inline virtual

## Member Function Documentation

bool libmwaw_applepict1::OpCode::computeSize | ( | MWAWInputStream & | input,
|  | int & | sz
| ) |  | const

inline

computes the size of the data

Referenced by libmwaw_applepict1::PictParser::convertToPict2().

static int libmwaw_applepict1::OpCode::getSize | ( | MWAWInputStream & | input,
|  | DataType | type
| ) |  |

inline static protected

returns the size of the next argument of type type.

Note
  This function can update the next reading position in the input, if it uses the input to compute the size of this argument

Referenced by computeSize().

static bool libmwaw_applepict1::OpCode::readCColor | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | MWAWColor & | col
| ) |  |

inline static protected

low level: reads a color argument (version 2)

Note
  check if this is not an indexed color

Referenced by readValue().

static bool libmwaw_applepict1::OpCode::readColor | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | MWAWColor & | col
| ) |  |

inline static protected

low level: reads a color argument

Note
  check if this is not an indexed color

Referenced by readValue().

bool libmwaw_applepict1::OpCode::readData | ( | MWAWInputStream & | input,
|  | std::vector< Value > & | listValue
| ) |  | const

inline

tries to read the data in the file

If the read is succefull, fills listValue with the read argument

Referenced by libmwaw_applepict1::PictParser::parse().

static bool libmwaw_applepict1::OpCode::readInt | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | int & | res
| ) |  |

inline static protected

low level: reads a integer ( bytes or 2 bytes, signed or unsigned)

Referenced by readPoint(), readPoly(), readText(), and readValue().

static bool libmwaw_applepict1::OpCode::readPattern | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | int(&) | pat[8]
| ) |  |

inline static protected

low level: reads a pattern argument

Referenced by readValue().

static bool libmwaw_applepict1::OpCode::readPoint | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | Vec2i & | res
| ) |  |

inline static protected

low level: reads a point argument

Referenced by readPoly(), readRect(), and readValue().

static bool libmwaw_applepict1::OpCode::readPoly | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | Box2i & | box,
|  | std::vector< Vec2i > & | res
| ) |  |

inline static protected

low level: reads a polygon argument

Referenced by readValue().

static bool libmwaw_applepict1::OpCode::readRect | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | Box2i & | res
| ) |  |

inline static

read a rectangles field

Note
  can be used to read the first dimensions of a picture

Referenced by libmwaw_applepict1::PictParser::parse(), readPoly(), and readValue().

static bool libmwaw_applepict1::OpCode::readText | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | std::string & | res
| ) |  |

inline static protected

low level: reads a string argument

Referenced by readValue().

static bool libmwaw_applepict1::OpCode::readValue | ( | MWAWInputStream & | input,
|  | DataType | type,
|  | Value & | val
| ) |  |

inline static protected

reads a argument of type type, if successfull updates val.

Referenced by readData(), and libmwaw_applepict2::OpCode::readData().

## Member Data Documentation

int libmwaw_applepict1::OpCode::m_id

the opCode

std::string libmwaw_applepict1::OpCode::m_name

the opCode name

Referenced by libmwaw_applepict1::PictParser::parse().

std::vector<DataType> libmwaw_applepict1::OpCode::m_types

the different argument types

Referenced by computeSize(), OpCode(), readData(), and libmwaw_applepict2::OpCode::readData().

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

- MWAWPictMac.cxx