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

#include <AssetsManager.h>

Public Types

enum  ErrorCode { kCreateFile, kNetwork, kNoNewVersion, kUncompress }
 

Public Member Functions

 AssetsManager (const char *packageUrl=NULL, const char *versionFileUrl=NULL, const char *storagePath=NULL)
 
virtual ~AssetsManager ()
 
virtual bool checkUpdate ()
 
var checkUpdate ()
 
local checkUpdate ()
 
virtual void update ()
 
local update ()
 
const char * getPackageUrl () const
 
var getPackageUrl ()
 
local getPackageUrl ()
 
void setPackageUrl (const char *packageUrl)
 
local setPackageUrl ( local packageUrl)
 
const char * getVersionFileUrl () const
 
void setVersionFileUrl (const char *versionFileUrl)
 
var setVersionFileUrl ( var versionFileUrl)
 
local setVersionFileUrl ( local versionFileUrl)
 
std::string getVersion ()
 
void deleteVersion ()
 
var deleteVersion ()
 
local deleteVersion ()
 
const char * getStoragePath () const
 
local getStoragePath ()
 
void setStoragePath (const char *storagePath)
 
void setDelegate (AssetsManagerDelegateProtocol *delegate)
 Sets delegate, the delegate will receive messages. More...
 
local setDelegate ( local delegate)
 Sets delegate, the delegate will receive messages. More...
 
void setConnectionTimeout (unsigned int timeout)
 Sets connection time out in seconds. More...
 
var setConnectionTimeout ( var timeout)
 Sets connection time out in seconds. More...
 
local setConnectionTimeout ( local timeout)
 Sets connection time out in seconds. More...
 
unsigned int getConnectionTimeout ()
 Gets connection time out in secondes. More...
 

Protected Member Functions

bool downLoad ()
 
void checkStoragePath ()
 
bool uncompress ()
 
bool createDirectory (const char *path)
 
var createDirectory ( var path)
 
local createDirectory ( local path)
 
void setSearchPath ()
 
void sendErrorMessage (ErrorCode code)
 

Friends

void * assetsManagerDownloadAndUncompress (void *)
 
int assetsManagerProgressFunc (void *, double, double, double, double)
 

Member Enumeration Documentation

enum ErrorCode
Enumerator
kCreateFile 
kNetwork 

Error caused by network – network unavaivable – timeout – ...

kNoNewVersion 

There is not a new version.

kUncompress 

Error caused in uncompressing stage – can not open zip file – can not read file global information – can not read file information – can not create a directory – ...

var ErrorCode
Enumerator
kCreateFile 
kNetwork 

Error caused by network – network unavaivable – timeout – ...

kNoNewVersion 

There is not a new version.

kUncompress 

Error caused in uncompressing stage – can not open zip file – can not read file global information – can not read file information – can not create a directory – ...

local ErrorCode
Enumerator
kCreateFile 
kNetwork 

Error caused by network – network unavaivable – timeout – ...

kNoNewVersion 

There is not a new version.

kUncompress 

Error caused in uncompressing stage – can not open zip file – can not read file global information – can not read file information – can not create a directory – ...

Constructor & Destructor Documentation

AssetsManager ( const char *  packageUrl = NULL,
const char *  versionFileUrl = NULL,
const char *  storagePath = NULL 
)
virtual ~AssetsManager ( )
virtual
var ~AssetsManager ( )
virtual
local ~AssetsManager ( )
virtual

Member Function Documentation

void checkStoragePath ( )
protected
var checkStoragePath ( )
protected
local checkStoragePath ( )
protected
virtual bool checkUpdate ( )
virtual
var checkUpdate ( )
virtual
local checkUpdate ( )
virtual
bool createDirectory ( const char *  path)
protected
var createDirectory ( var  path)
protected
local createDirectory ( local  path)
protected
void deleteVersion ( )
var deleteVersion ( )
local deleteVersion ( )
bool downLoad ( )
protected
var downLoad ( )
protected
local downLoad ( )
protected
unsigned int getConnectionTimeout ( )

Gets connection time out in secondes.

var getConnectionTimeout ( )

Gets connection time out in secondes.

local getConnectionTimeout ( )

Gets connection time out in secondes.

const char* getPackageUrl ( ) const
var getPackageUrl ( )
local getPackageUrl ( )
const char* getStoragePath ( ) const
var getStoragePath ( )
local getStoragePath ( )
std::string getVersion ( )
var getVersion ( )
local getVersion ( )
const char* getVersionFileUrl ( ) const
var getVersionFileUrl ( )
local getVersionFileUrl ( )
void sendErrorMessage ( ErrorCode  code)
protected
var sendErrorMessage ( var  code)
protected
local sendErrorMessage ( local  code)
protected
void setConnectionTimeout ( unsigned int  timeout)

Sets connection time out in seconds.

var setConnectionTimeout ( var  timeout)

Sets connection time out in seconds.

local setConnectionTimeout ( local  timeout)

Sets connection time out in seconds.

void setDelegate ( AssetsManagerDelegateProtocol delegate)

Sets delegate, the delegate will receive messages.

var setDelegate ( var  delegate)

Sets delegate, the delegate will receive messages.

local setDelegate ( local  delegate)

Sets delegate, the delegate will receive messages.

void setPackageUrl ( const char *  packageUrl)
var setPackageUrl ( var  packageUrl)
local setPackageUrl ( local  packageUrl)
void setSearchPath ( )
protected
var setSearchPath ( )
protected
local setSearchPath ( )
protected
void setStoragePath ( const char *  storagePath)
var setStoragePath ( var  storagePath)
local setStoragePath ( local  storagePath)
void setVersionFileUrl ( const char *  versionFileUrl)
var setVersionFileUrl ( var  versionFileUrl)
local setVersionFileUrl ( local  versionFileUrl)
bool uncompress ( )
protected
var uncompress ( )
protected
local uncompress ( )
protected
virtual void update ( )
virtual
var update ( )
virtual
local update ( )
virtual

Friends And Related Function Documentation

void*
assetsManagerDownloadAndUncompress
( void *  )
friend
var
assetsManagerDownloadAndUncompress
( var  )
friend
local
assetsManagerDownloadAndUncompress
( local  )
friend
int assetsManagerProgressFunc ( void *  ,
double  ,
double  ,
double  ,
double   
)
friend
var assetsManagerProgressFunc ( var  ,
var  ,
var  ,
var  ,
var   
)
friend
local assetsManagerProgressFunc ( local  ,
local  ,
local  ,
local  ,
local   
)
friend

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