cocos2d-x
3.3
|
#include <Manifest.h>
Classes | |
struct | Asset |
Asset object. More... | |
struct | AssetDiff |
Object indicate the difference between two Assets. More... | |
Public Types | |
enum | DiffType { ADDED, DELETED, MODIFIED } |
The type of difference. More... | |
enum | DownloadState { UNSTARTED, DOWNLOADING, SUCCESSED } |
Public Member Functions | |
bool | isVersionLoaded () const |
Check whether the version informations have been fully loaded. More... | |
bool | isLoaded () const |
Check whether the manifest have been fully loaded. More... | |
const std::string & | getPackageUrl () const |
Gets remote package url. More... | |
const std::string & | getManifestFileUrl () const |
Gets remote manifest file url. More... | |
const std::string & | getVersionFileUrl () const |
Gets remote version file url. More... | |
const std::string & | getVersion () const |
Gets manifest version. More... | |
![]() | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
NA NA More... | |
Protected Member Functions | |
Manifest (const std::string &manifestUrl="") | |
Constructor for Manifest class. More... | |
void | loadJson (const std::string &url) |
Load the json file into local json object. More... | |
void | parseVersion (const std::string &versionUrl) |
Parse the version file information into this manifest. More... | |
void | parse (const std::string &manifestUrl) |
Parse the manifest file information into this manifest. More... | |
bool | versionEquals (const Manifest *b) const |
Check whether the version of this manifest equals to another. More... | |
std::unordered_map < std::string, AssetDiff > | genDiff (const Manifest *b) const |
Generate difference between this Manifest and another. More... | |
void | genResumeAssetsList (Downloader::DownloadUnits *units) const |
Generate resuming download assets list. More... | |
void | prependSearchPaths () |
Prepend all search paths to the FileUtils. More... | |
void | loadVersion (const rapidjson::Document &json) |
void | loadManifest (const rapidjson::Document &json) |
void | saveToFile (const std::string &filepath) |
Asset | parseAsset (const std::string &path, const rapidjson::Value &json) |
void | clear () |
const std::vector< std::string > & | getGroups () const |
Gets all groups. More... | |
const std::unordered_map < std::string, std::string > & | getGroupVerions () const |
Gets all groups version. More... | |
const std::string & | getGroupVersion (const std::string &group) const |
Gets version for the given group. More... | |
const std::unordered_map < std::string, Asset > & | getAssets () const |
Gets assets. More... | |
void | setAssetDownloadState (const std::string &key, const DownloadState &state) |
Set the download state for an asset. More... | |
![]() | |
Ref () | |
Constructor. More... | |
Friends | |
class | AssetsManagerEx |
Additional Inherited Members | |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
|
strong |
|
strong |
|
protected |
Constructor for Manifest class.
manifestUrl | Url of the local manifest |
|
protected |
Generate difference between this Manifest and another.
b | The other manifest |
|
protected |
Generate resuming download assets list.
units | The download units reference to be modified by the generation result |
|
protected |
Gets assets.
|
protected |
Gets all groups.
|
protected |
Gets all groups version.
|
protected |
Gets version for the given group.
group | Key of the requested group |
const std::string& getManifestFileUrl | ( | ) | const |
Gets remote manifest file url.
const std::string& getPackageUrl | ( | ) | const |
Gets remote package url.
const std::string& getVersion | ( | ) | const |
Gets manifest version.
const std::string& getVersionFileUrl | ( | ) | const |
Gets remote version file url.
bool isLoaded | ( | ) | const |
Check whether the manifest have been fully loaded.
bool isVersionLoaded | ( | ) | const |
Check whether the version informations have been fully loaded.
|
protected |
Load the json file into local json object.
url | Url of the json file |
|
protected |
|
protected |
|
protected |
Parse the manifest file information into this manifest.
manifestUrl | Url of the local manifest |
|
protected |
|
protected |
Parse the version file information into this manifest.
versionUrl | Url of the local version file |
|
protected |
Prepend all search paths to the FileUtils.
|
protected |
|
protected |
Set the download state for an asset.
key | Key of the asset to set |
state | The current download state of the asset |
|
protected |
Check whether the version of this manifest equals to another.
b | The other manifest |
|
friend |