CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

iSyntaxService Struct Reference
[Loading & Saving support]

This component provides services for other loaders to easily parse properties of standard CS world syntax. More...

#include <imap/services.h>

Inheritance diagram for iSyntaxService:

iBase List of all members.

Public Member Functions

virtual bool ParseBool (iDocumentNode *node, bool &result, bool def_result)=0
 Parse the value of this node and return a boolean depending on this value.
virtual bool WriteBool (iDocumentNode *node, const char *name, bool value)=0
 Write a node representing the value of the boolean.
bool WriteBool (iDocumentNode *node, const char *name, bool value, bool default_value)
 Write a node representing the value of the boolean, if it differs from a provided default value.
virtual bool ParseMatrix (iDocumentNode *node, csMatrix3 &m)=0
 Parse a matrix description.
virtual bool WriteMatrix (iDocumentNode *node, csMatrix3 *m)=0
 Write a matrix description.
virtual bool ParseVector (iDocumentNode *node, csVector3 &v)=0
 Parse a vector description.
virtual bool WriteVector (iDocumentNode *node, csVector3 *v)=0
 Write a vector description.
virtual bool ParseVector (iDocumentNode *node, csVector2 &v)=0
 Parse a vector description.
virtual bool WriteVector (iDocumentNode *node, csVector2 *v)=0
 Write a vector description.
virtual bool ParseBox (iDocumentNode *node, csBox3 &v)=0
 Parse a box description.
virtual bool WriteBox (iDocumentNode *node, csBox3 *v)=0
 Write a box description.
virtual bool ParseColor (iDocumentNode *node, csColor &c)=0
 Parse a color description.
virtual bool WriteColor (iDocumentNode *node, csColor *c)=0
 Write a color description.
virtual bool ParseColor (iDocumentNode *node, csColor4 &c)=0
 Parse a color description.
virtual bool WriteColor (iDocumentNode *node, csColor4 *c)=0
 Write a color description.
virtual bool ParseMixmode (iDocumentNode *node, uint &mixmode, bool allowFxMesh=false)=0
 Parse a mixmode description.
virtual bool WriteMixmode (iDocumentNode *node, uint mixmode, bool allowFxMesh)=0
 Write a mixmode description.
virtual bool HandlePortalParameter (iDocumentNode *child, iLoaderContext *ldr_context, uint32 &flags, bool &mirror, bool &warp, int &msv, csMatrix3 &m, csVector3 &before, csVector3 &after, iString *destSector, bool &handled, bool &autoresolve)=0
 Handles a common portal parameter.
virtual bool ParseGradient (iDocumentNode *node, csGradient &gradient)=0
 Parse a color gradient.
virtual bool WriteGradient (iDocumentNode *node, csGradient *gradient)=0
 Write a color gradient.
virtual bool ParseShaderVar (iDocumentNode *node, csShaderVariable &var)=0
 Parse a shader variable declaration.
virtual bool WriteShaderVar (iDocumentNode *node, csShaderVariable *var)=0
 Write a shader variable declaration.
virtual void ReportError (const char *msgid, iDocumentNode *errornode, const char *msg,...)=0
 Report an error and also gives a path in the XML tree.
virtual void ReportBadToken (iDocumentNode *badtokennode)=0
 Report a bad token.
virtual void Report (const char *msgid, int severity, iDocumentNode *errornode, const char *msg,...)=0
 Report something, also gives a path in the XML tree.
virtual bool ParseAlphaMode (iDocumentNode *node, iStringSet *strings, csAlphaMode &alphaMode, bool allowAutoMode=true)=0
 Parse an alphamode description.
virtual bool WriteAlphaMode (iDocumentNode *node, iStringSet *strings, csAlphaMode *alphaMode)=0
 Write an alphamode description.
virtual bool ParseZMode (iDocumentNode *node, csZBufMode &zmode, bool allowZmesh=false)=0
 Attempt to parse a zmode from node.
virtual bool WriteZMode (iDocumentNode *node, csZBufMode *zmode, bool allowZmesh)=0
 Write a ZMode description.
virtual bool ParseKey (iDocumentNode *node, iKeyValuePair *&keyvalue)=0
 Parse a key definition.
virtual bool WriteKey (iDocumentNode *node, iKeyValuePair *keyvalue)=0
 Write a key definition and add the key to the given object, Returns true if successful.
virtual csRef< iRenderBuffer > ParseRenderBuffer (iDocumentNode *node)=0
 Parse a user render buffer.

Detailed Description

This component provides services for other loaders to easily parse properties of standard CS world syntax.

Definition at line 66 of file services.h.


Member Function Documentation

virtual bool iSyntaxService::HandlePortalParameter (  iDocumentNode *  child,
iLoaderContext *  ldr_context,
uint32 &  flags,
bool &  mirror,
bool &  warp,
int &  msv,
csMatrix3 &  m,
csVector3 &  before,
csVector3 &  after,
iString *  destSector,
bool &  handled,
bool &  autoresolve
)  [pure virtual]
 

Handles a common portal parameter.

flags: contains all flags found in the description. Returns false on failure. Returns false in 'handled' if it couldn't understand the token.

virtual bool iSyntaxService::ParseAlphaMode (  iDocumentNode *  node,
iStringSet *  strings,
csAlphaMode &  alphaMode,
bool  allowAutoMode = true
)  [pure virtual]
 

Parse an alphamode description.

Returns true if successful.

virtual bool iSyntaxService::ParseBool (  iDocumentNode *  node,
bool &  result,
bool  def_result
)  [pure virtual]
 

Parse the value of this node and return a boolean depending on this value.

The following mapping happens (case insensitive):

  • yes -> true
  • no -> false
  • true -> true
  • false -> false
  • on -> true
  • off -> false
  • (empty value) -> (def_result)
  • (everyting else) -> error

virtual bool iSyntaxService::ParseBox (  iDocumentNode *  node,
csBox3 &  v
)  [pure virtual]
 

Parse a box description.

Returns true if successful.

virtual bool iSyntaxService::ParseColor (  iDocumentNode *  node,
csColor4 &  c
)  [pure virtual]
 

Parse a color description.

Returns true if successful.

virtual bool iSyntaxService::ParseColor (  iDocumentNode *  node,
csColor &  c
)  [pure virtual]
 

Parse a color description.

Returns true if successful.

virtual bool iSyntaxService::ParseGradient (  iDocumentNode *  node,
csGradient &  gradient
)  [pure virtual]
 

Parse a color gradient.

virtual bool iSyntaxService::ParseKey (  iDocumentNode *  node,
iKeyValuePair *&  keyvalue
)  [pure virtual]
 

Parse a key definition.

A iKeyValuePair instance is return in "keyvalue", with refcount 1 Returns true if successful.

virtual bool iSyntaxService::ParseMatrix (  iDocumentNode *  node,
csMatrix3 &  m
)  [pure virtual]
 

Parse a matrix description.

Returns true if successful.

virtual bool iSyntaxService::ParseMixmode (  iDocumentNode *  node,
uint &  mixmode,
bool  allowFxMesh = false
)  [pure virtual]
 

Parse a mixmode description.

Returns true if successful.

virtual csRef<iRenderBuffer> iSyntaxService::ParseRenderBuffer (  iDocumentNode *  node  )  [pure virtual]
 

Parse a user render buffer.

virtual bool iSyntaxService::ParseShaderVar (  iDocumentNode *  node,
csShaderVariable &  var
)  [pure virtual]
 

Parse a shader variable declaration.

virtual bool iSyntaxService::ParseVector (  iDocumentNode *  node,
csVector2 &  v
)  [pure virtual]
 

Parse a vector description.

Returns true if successful.

virtual bool iSyntaxService::ParseVector (  iDocumentNode *  node,
csVector3 &  v
)  [pure virtual]
 

Parse a vector description.

Returns true if successful.

virtual bool iSyntaxService::ParseZMode (  iDocumentNode *  node,
csZBufMode &  zmode,
bool  allowZmesh = false
)  [pure virtual]
 

Attempt to parse a zmode from node.

allowZmesh specifies whether ZMESH and ZMESH2 zmodes should be saved to zmode or rejected, causing the method to fail and return 'false'.

Remarks:
As z modes usually appear "in between" other document nodes, this function does not report an error if the token isn't recognized, but only returns 'false'.

virtual void iSyntaxService::Report (  const char *  msgid,
int  severity,
iDocumentNode *  errornode,
const char *  msg,
  ...
)  [pure virtual]
 

Report something, also gives a path in the XML tree.

virtual void iSyntaxService::ReportBadToken (  iDocumentNode *  badtokennode  )  [pure virtual]
 

Report a bad token.

This is a convenience function which will eventually call ReportError().

virtual void iSyntaxService::ReportError (  const char *  msgid,
iDocumentNode *  errornode,
const char *  msg,
  ...
)  [pure virtual]
 

Report an error and also gives a path in the XML tree.

virtual bool iSyntaxService::WriteAlphaMode (  iDocumentNode *  node,
iStringSet *  strings,
csAlphaMode *  alphaMode
)  [pure virtual]
 

Write an alphamode description.

Returns true if successful.

bool iSyntaxService::WriteBool (  iDocumentNode *  node,
const char *  name,
bool  value,
bool  default_value
)  [inline]
 

Write a node representing the value of the boolean, if it differs from a provided default value.

Definition at line 95 of file services.h.

References WriteBool().

virtual bool iSyntaxService::WriteBool (  iDocumentNode *  node,
const char *  name,
bool  value
)  [pure virtual]
 

Write a node representing the value of the boolean.

Referenced by WriteBool().

virtual bool iSyntaxService::WriteBox (  iDocumentNode *  node,
csBox3 *  v
)  [pure virtual]
 

Write a box description.

Returns true if successful.

virtual bool iSyntaxService::WriteColor (  iDocumentNode *  node,
csColor4 *  c
)  [pure virtual]
 

Write a color description.

Returns true if successful.

virtual bool iSyntaxService::WriteColor (  iDocumentNode *  node,
csColor *  c
)  [pure virtual]
 

Write a color description.

Returns true if successful.

virtual bool iSyntaxService::WriteGradient (  iDocumentNode *  node,
csGradient *  gradient
)  [pure virtual]
 

Write a color gradient.

virtual bool iSyntaxService::WriteKey (  iDocumentNode *  node,
iKeyValuePair *  keyvalue
)  [pure virtual]
 

Write a key definition and add the key to the given object, Returns true if successful.

virtual bool iSyntaxService::WriteMatrix (  iDocumentNode *  node,
csMatrix3 *  m
)  [pure virtual]
 

Write a matrix description.

Returns true if successful.

virtual bool iSyntaxService::WriteMixmode (  iDocumentNode *  node,
uint  mixmode,
bool  allowFxMesh
)  [pure virtual]
 

Write a mixmode description.

Returns true if successful.

virtual bool iSyntaxService::WriteShaderVar (  iDocumentNode *  node,
csShaderVariable *  var
)  [pure virtual]
 

Write a shader variable declaration.

virtual bool iSyntaxService::WriteVector (  iDocumentNode *  node,
csVector2 *  v
)  [pure virtual]
 

Write a vector description.

Returns true if successful.

virtual bool iSyntaxService::WriteVector (  iDocumentNode *  node,
csVector3 *  v
)  [pure virtual]
 

Write a vector description.

Returns true if successful.

virtual bool iSyntaxService::WriteZMode (  iDocumentNode *  node,
csZBufMode *  zmode,
bool  allowZmesh
)  [pure virtual]
 

Write a ZMode description.

Returns true if successful.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1