SequoiaDB
 All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
SequoiaLob Class Reference

Public Member Functions

 close ()
 
 getSize ()
 
 getCreateTime ()
 
 write (string $buffer)
 
 read (integer|SequoiaINT64 $length)
 
 seek (integer|SequoiaINT64 $offset, integer $whence=SDB_LOB_SET)
 

Public Attributes

const SDB_LOB_SET 0
 
const SDB_LOB_CUR 1
 
const SDB_LOB_END 2
 

Detailed Description

SequoiaLob Class. To get this Class object must be call SequoiaCL::openLob.

Member Function Documentation

SequoiaLob::close ( )

Close lob.

Returns
Returns the result, default return array.
Return values
arrayarray( 'errno' => 0 )
string{ "errno": 0 }

Example:

$err = $lobObj -> close() ;
if( $err['errno'] != 0 ) {
echo "Failed to close lob, error code: ".$err['errno'] ;
return ;
}
SequoiaLob::getCreateTime ( )

Get the lob create time (millisecond).

Returns
Returns the create time.
Return values
integer|SequoiaINT64millisecond

Example:

$times = $lobObj -> getCreateTime() ;
$err = $db -> getError() ;
if( $err['errno'] != 0 ) {
echo "Failed to get lob create time, error code: ".$err['errno'] ;
return ;
}
echo "Lob create time is: ".$times ;
SequoiaLob::getSize ( )

Get the lob size.

Returns
Returns the number of lob size.
Return values
integer|SequoiaINT64lob size

Example:

$lobSize = $lobObj -> getSize() ;
$err = $db -> getError() ;
if( $err['errno'] != 0 ) {
echo "Failed to get lob size, error code: ".$err['errno'] ;
return ;
}
echo "Lob size is: ".$lobSize ;
SequoiaLob::read ( integer|SequoiaINT64  $length)

Read lob.

Parameters
$lengthan integer or the SequoiaINT64 object argument. The length want to read.
Returns
Returns the string of read.
Return values
stringread buffer

Example:

$buffer = $lobObj -> read( 5 ) ;
$err = $db -> getError() ;
if( $err['errno'] != 0 ) {
echo "Failed to read lob, error code: ".$err['errno'] ;
return ;
}
SequoiaLob::seek ( integer|SequoiaINT64  $offset,
integer  $whence = SDB_LOB_SET 
)

Seek the place to read.

Parameters
$offsetan integer or the SequoiaINT64 object argument. Lob offset position.
$whencean integer argument. Where to start position.
SDB_LOB_SET : Set position equal to offset bytes.
SDB_LOB_CUR : Set position to current location plus offset.
SDB_LOB_END : Set position to end of lob plus offset.
Returns
Returns the result, default return array.
Return values
arrayarray( 'errno' => 0 )
string{ "errno": 0 }

Example:

$err = $lobObj -> seek( 10, SDB_LOB_CUR ) ;
if( $err['errno'] != 0 ) {
echo "Failed to call seek, error code: ".$err['errno'] ;
return ;
}
SequoiaLob::write ( string  $buffer)

Write lob.

Parameters
$bufferthe string argument. The buffer of write.
Returns
Returns the result, default return array.
Return values
arrayarray( 'errno' => 0 )
string{ "errno": 0 }

Example:

$err = $lobObj -> write( 'hello' ) ;
if( $err['errno'] != 0 ) {
echo "Failed to write lob, error code: ".$err['errno'] ;
return ;
}

Member Data Documentation

const SequoiaLob::SDB_LOB_CUR 1

Set position to current location plus offset.

const SequoiaLob::SDB_LOB_END 2

Set position to end of lob plus offset.

const SequoiaLob::SDB_LOB_SET 0

Set position equal to offset bytes.


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