GODPAPER | All Packages | All Classes | Index | Frames No Frames |
PGN

Package | com.godpaper.as3.serialization
Class | public final class PGN
Inheritance | PGN Object

This class provides encoding and decoding of the PGN format. Example usage: `// create a PGN string from an internal object PGN.encode( myObject ); // read a PGN string into an internal object var myObject:Object = PGN.decode( pgnString );`

See also

http://www.xqbase.com/protocol/cchess_pgn.htm
http://www.xqbase.com/protocol/pgnfen1.htm

Public Methods

| Method | Defined By
--- | --- | ---
|  | decode(s:String, strict:Boolean = true):* [static] Decodes a PGN string into a native object. | PGN
|  | encode(o:Object):String [static] Encodes a object into a PGN string. | PGN

Method Detail

decode | () | method

`public static function decode(s:String, strict:Boolean = true):*`

Language Version : | ActionScript 3.0

Runtime Versions : | AIR 1.0, Flash Player 9.0

Decodes a PGN string into a native object.

Parameters

| `s:String` — The PGN string representing the object
| `strict:Boolean` (default = `true`)`` — Flag indicating if the decoder should strictly adhere to the PGN standard or not. The default of `true` throws errors if the format does not match the PGN syntax exactly. Pass `false` to allow for non-properly-formatted PGN strings to be decoded with more leniancy.

Returns

| `*` — A native object as specified by s

encode | () | method |

`public static function encode(o:Object):String`

Language Version : | ActionScript 3.0

Runtime Versions : | AIR 1.0, Flash Player 9.0

Encodes a object into a PGN string.

Parameters

| `o:Object` — The object to create a PGN string for

Returns

| `String` — the PGN string representing o

Thu Jan 16 2014, 01:11 PM +08:00