Class that interacts with COB files (c1 and c2 formats)
More...
List of all members.
Detailed Description
Class that interacts with COB files (c1 and c2 formats)
Definition at line 23 of file COB.php.
Member Function Documentation
COB::COB |
( |
IReader $ |
reader = null | ) |
|
Creates a new COB file.
If you want to create a COB file from scratch, simply don't pass anything to the constructor.
Alternatively, if you know which kind of COB file you are reading, or only want to deal with a specific kind of COB file, you can call the LoadC1COB and LoadC2COB functions after creating a blank cob file. E.g. ($reader is a IReader)
$cob = new COB;
$cob->LoadC1COB($reader);
This code will only parse C1 cobs.
- Parameters:
-
$reader | The reader which contains the cob to read from. Can be null. |
Definition at line 45 of file COB.php.
COB::Compile |
( |
$ |
format = null | ) |
|
Compiles the COB in the given format.
- Parameters:
-
$format | The format of the COB. If null, assumed it's a creatures 2 COB |
- Returns:
- A binary string containing the COB.
Definition at line 175 of file COB.php.
Compiles to a C1 COB. Unimplemented
Definition at line 194 of file COB.php.
Compiles a C2 COB. May not actually work.
Definition at line 199 of file COB.php.
COB::GetBlocks |
( |
$ |
type = false | ) |
|
Accessor method to get blocks of the given type.
If $type is false, will return all blocks in this agent.
In a C1 COB, there is only one block and it is of the agnt type.
- Parameters:
-
$type | The type of block to get (agnt, auth, file). False by default. |
- Returns:
- An array of COBBlocks.
Definition at line 160 of file COB.php.
Loads a C1 COB from the specified reader.
C1 COBs have just one block, which is a COBAgentBlock. This is accessible by calling COB::GetBlocks
- Parameters:
-
$reader | the reader to load from |
Definition at line 101 of file COB.php.
Loads a C2 COB from the IReader given.
C2 COBs have multiple blocks, which are accessible via the COB::GetBlocks function.
- Parameters:
-
Definition at line 84 of file COB.php.
The documentation for this class was generated from the following file: