Demo entry 5862480

BinaryDataReader.h

   

Submitted by anonymous on Aug 06, 2016 at 13:43
Language: C++. Code size: 501 Bytes.

#pragma once
#include "cocos2d.h"
using namespace cocos2d;

class BinaryDataReader
{
private:
    CC_SYNTHESIZE(Data, m_Data, Data);

    CC_SYNTHESIZE(int, m_Seek, Seek);

    CC_SYNTHESIZE(int, m_FileSize, FileSize);

    CC_SYNTHESIZE(char*, m_Buffer, Buffer);

public:
    BinaryDataReader(const char* file);

    int readInt();
    short readShort();
    double readDouble();
    float readFloat();
    std::string readString();

    void clear();
    bool hasNext();
};

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).