PHP QrCode Liblary 2.0

- Main Page
- Related Pages
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QRbitstream Class Reference
Standard API Core

PHP bit stream. More...

## Public Member Functions
| size ()
| allocate ($setLength)
| Allocates bit stream, fills bit data stream with 0's. More...
| append (QRbitstream $arg)
| Appends given bit stream at end of this stream. More...
| appendNum ($bits, $num)
| Appends bit stream cteated from given Integer number at end of current stream. More...
| appendBytes ($size, $data)
| Appends bit stream created from from given byte array at end of current stream. More...
| toByte ()
| Converts current bit stream into byte array. More...

## Static Public Member Functions
static | newFromNum ($bits, $num)
| Creates new bit stream from given Integer number. More...
static | newFromBytes ($size, $data)
| Creates new bit stream from given byte array. More...

## Public Attributes
| $data = array()
| Array containing bit data stream.

## Detailed Description

PHP bit stream.

Class implementing array of bits (= 1 or 0 ints). Allows to initialize and append bits from given Integer or array of Bytes.

## Member Function Documentation

QRbitstream::allocate | ( |  | $setLength) |  |

Allocates bit stream, fills bit data stream with 0's.

This operation is destructive, will replace orginal stream contents!

Parameters

  Integer | $setLength | desired target stream size

Returns
  Integer 0 on success, other on failure

QRbitstream::append | ( | QRbitstream | $arg) |  |

Appends given bit stream at end of this stream.

Parameters

  QRbitstream | $arg | bit stream to be appended

Returns
  Integer status of append operation, 0 when success, -1 when $arg is null

QRbitstream::appendBytes | ( |  | $size,
|  |  | $data
| ) |  |

Appends bit stream created from from given byte array at end of current stream.

Parameters

  Integer | $size | size of array
  Array | $data | array ob bytes

Returns
  Integer status of append operation, status of append operation, 0 when success, -1 otherwise

QRbitstream::appendNum | ( |  | $bits,
|  |  | $num
| ) |  |

Appends bit stream cteated from given Integer number at end of current stream.

Parameters

  Integer | $bits | bit count
  Integer | $num | integer to convert

Returns
  Integer status of append operation, status of append operation, 0 when success, -1 otherwise

static QRbitstream::newFromBytes | ( |  | $size,
|  |  | $data
| ) |  |
| static

Creates new bit stream from given byte array.

Parameters

  Integer | $size | size of array
  Array | $data | array ob bytes

Returns
  QRbitstream bit stream object containing bit contents of given bytes array

static QRbitstream::newFromNum | ( |  | $bits,
|  |  | $num
| ) |  |
| static

Creates new bit stream from given Integer number.

Parameters

  Integer | $bits | bit count
  Integer | $num | integer to convert

Returns
  QRbitstream bit stream object containing first $bits bits from $num in order from LSB to MSB

QRbitstream::size | ( | ) |  |

Returns
  Integer size of byte stream

QRbitstream::toByte | ( | ) |  |

Converts current bit stream into byte array.

Returns
  Array array of bytes

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

- lib/full/qrbitstream.php