cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BundleReader Class Reference

BundleReader is an interface for reading sequence of bytes. More...

#include <CCBundleReader.h>

Inheritance diagram for BundleReader:
Ref

Public Member Functions

 BundleReader ()
 Structor. More...
 
 BundleReader ()
 Structor. More...
 
 BundleReader ()
 Structor. More...
 
 ~BundleReader ()
 inicial More...
 
 ~BundleReader ()
 inicial More...
 
 ~BundleReader ()
 inicial More...
 
void init (char *buffer, ssize_t length)
 initialise More...
 
var init ( var buffer, var length)
 initialise More...
 
local init ( local buffer, local length)
 initialise More...
 
ssize_t read (void *ptr, ssize_t size, ssize_t count)
 Reads an array of elements. More...
 
local read ( local ptr, local size, local count)
 Reads an array of elements. More...
 
char * readLine (int num, char *line)
 Reads a line from the buffer. More...
 
bool eof ()
 Returns true if the end of the buffer has been reached. More...
 
local eof ()
 Returns true if the end of the buffer has been reached. More...
 
ssize_t length ()
 Returns the length of the buffer in bytes. More...
 
local length ()
 Returns the length of the buffer in bytes. More...
 
ssize_t tell ()
 Returns the position of the file pointer. More...
 
local tell ()
 Returns the position of the file pointer. More...
 
bool seek (long int offset, int origin)
 Sets the position of the file pointer. More...
 
var seek ( var offset, var origin)
 Sets the position of the file pointer. More...
 
local seek ( local offset, local origin)
 Sets the position of the file pointer. More...
 
bool rewind ()
 Sets the file pointer at the start of the file. More...
 
var rewind ()
 Sets the file pointer at the start of the file. More...
 
local rewind ()
 Sets the file pointer at the start of the file. More...
 
template<typename T >
bool read (T *ptr)
 read binary typed value. More...
 
template<typename T >
var read ( var ptr)
 read binary typed value. More...
 
template<typename T >
local read ( local ptr)
 read binary typed value. More...
 
template<typename T >
bool readArray (unsigned int *length, std::vector< T > *values)
 template function to read array of value. More...
 
std::string readString ()
 first read length, then read string text More...
 
bool readMatrix (float *m)
 Read the matrix. More...
 
var readMatrix ( var m)
 Read the matrix. More...
 
local readMatrix ( local m)
 Read the matrix. More...
 
template<>
bool read (char *ptr)
 specalization for char More...
 
template<>
local read ( local ptr)
 specalization for char More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Detailed Description

BundleReader is an interface for reading sequence of bytes.

Constructor & Destructor Documentation

Structor.

var BundleReader ( )

Structor.

local BundleReader ( )

Structor.

inicial

var ~BundleReader ( )

inicial

local ~BundleReader ( )

inicial

Member Function Documentation

bool eof ( )

Returns true if the end of the buffer has been reached.

var eof ( )

Returns true if the end of the buffer has been reached.

local eof ( )

Returns true if the end of the buffer has been reached.

void init ( char *  buffer,
ssize_t  length 
)

initialise

Parameters
lpbufferThe data buffer pointer
lengthThe data buffer size
var init ( var  buffer,
var  length 
)

initialise

Parameters
lpbufferThe data buffer pointer
lengthThe data buffer size
local init ( local  buffer,
local  length 
)

initialise

Parameters
lpbufferThe data buffer pointer
lengthThe data buffer size
ssize_t length ( )

Returns the length of the buffer in bytes.

var length ( )

Returns the length of the buffer in bytes.

local length ( )

Returns the length of the buffer in bytes.

ssize_t read ( void *  ptr,
ssize_t  size,
ssize_t  count 
)

Reads an array of elements.

Parameters
ptrThe pointer to the memory to copy into. The available size should be at least bytes.
sizeThe size of each element to be read, in bytes.
countThe number of elements to read.
Returns
The number of elements read.
var read ( var  ptr,
var  size,
var  count 
)

Reads an array of elements.

Parameters
ptrThe pointer to the memory to copy into. The available size should be at least bytes.
sizeThe size of each element to be read, in bytes.
countThe number of elements to read.
Returns
The number of elements read.
local read ( local  ptr,
local  size,
local  count 
)

Reads an array of elements.

Parameters
ptrThe pointer to the memory to copy into. The available size should be at least bytes.
sizeThe size of each element to be read, in bytes.
countThe number of elements to read.
Returns
The number of elements read.
bool read ( T *  ptr)
inline

read binary typed value.

template read routines

var read ( var  ptr)
inline

read binary typed value.

template read routines

local read ( local  ptr)
inline

read binary typed value.

template read routines

bool read ( char *  ptr)
inline

specalization for char

var read ( var  ptr)
inline

specalization for char

local read ( local  ptr)
inline

specalization for char

bool readArray ( unsigned int *  length,
std::vector< T > *  values 
)
inline

template function to read array of value.

var readArray ( var  length,
var  values 
)
inline

template function to read array of value.

local readArray ( local  length,
local  values 
)
inline

template function to read array of value.

char* readLine ( int  num,
char *  line 
)

Reads a line from the buffer.

var readLine ( var  num,
var  line 
)

Reads a line from the buffer.

local readLine ( local  num,
local  line 
)

Reads a line from the buffer.

bool readMatrix ( float *  m)

Read the matrix.

Note
the matrix type must be the 4*4 float matrix
var readMatrix ( var  m)

Read the matrix.

Note
the matrix type must be the 4*4 float matrix
local readMatrix ( local  m)

Read the matrix.

Note
the matrix type must be the 4*4 float matrix
std::string readString ( )

first read length, then read string text

var readString ( )

first read length, then read string text

local readString ( )

first read length, then read string text

bool rewind ( )

Sets the file pointer at the start of the file.

var rewind ( )

Sets the file pointer at the start of the file.

local rewind ( )

Sets the file pointer at the start of the file.

bool seek ( long int  offset,
int  origin 
)

Sets the position of the file pointer.

var seek ( var  offset,
var  origin 
)

Sets the position of the file pointer.

local seek ( local  offset,
local  origin 
)

Sets the position of the file pointer.

ssize_t tell ( )

Returns the position of the file pointer.

var tell ( )

Returns the position of the file pointer.

local tell ( )

Returns the position of the file pointer.


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