Menu

## QRDataModeInterface
in

QRDataModeInterface.php : 18

Specifies the methods reqired for the data modules (Number, Alphanum, Byte and Kanji)

### Table of Contents

convertEncoding() : string
  encoding conversion helper
decodeSegment() : string
  reads a segment from the BitBuffer and decodes in the current data mode
getDataMode() : int
  returns the current data mode constant
getLengthInBits() : int
  retruns the length in bits of the data string
validateString() : bool
  checks if the given string qualifies for the encoder module
write() : void
  writes the actual data string to the BitBuffer, uses the given version to determine the length bits

### Methods

#### convertEncoding()

QRDataModeInterface.php : 35

encoding conversion helper

`public static convertEncoding(string $string) : string`

##### Parameters

$string : string

##### Tags

throws
  QRCodeDataException

##### Return values

string —

#### decodeSegment()

QRDataModeInterface.php : 52

reads a segment from the BitBuffer and decodes in the current data mode

`public static decodeSegment(BitBuffer $bitBuffer, int $versionNumber) : string`

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Return values

string —

#### getDataMode()

QRDataModeInterface.php : 23

returns the current data mode constant

`public getDataMode() : int`

##### Return values

int —

#### getLengthInBits()

QRDataModeInterface.php : 28

retruns the length in bits of the data string

`public getLengthInBits() : int`

##### Return values

int —

#### validateString()

QRDataModeInterface.php : 40

checks if the given string qualifies for the encoder module

`public static validateString(string $string) : bool`

##### Parameters

$string : string

##### Return values

bool —

#### write()

QRDataModeInterface.php : 47

writes the actual data string to the BitBuffer, uses the given version to determine the length bits

`public write(BitBuffer $bitBuffer, int $versionNumber) : void`

##### Parameters

$bitBuffer : BitBuffer
$versionNumber : int

##### Tags

see
  QRData::writeBitBuffer()

##### Return values

void —

## Search results