Sha256: e9a7a5f51c11a4b567b5e1c7fd8c67ee00ee115d055d68cccdcf97eb2355ac6f

Contents?: true

Size: 1.68 KB

Versions: 10

Compression:

Stored size: 1.68 KB

Contents

#ifndef _RHOFILE_H_
#define _RHOFILE_H_

#include "RhoStd.h"
#include "InputStream.h"

namespace rho{
namespace common{

class CRhoFile {
    FILE* m_file;
    String m_strPath;
    InputStream* m_pInputStream;

public:
    enum EOpenModes{ OpenForAppend = 1, OpenReadOnly = 2, OpenForWrite = 3, OpenForReadWrite = 4 };

    CRhoFile() : m_file(0), m_pInputStream(0){}
    ~CRhoFile(){close();}

    bool isOpened();
    bool open( const char* szFilePath, EOpenModes eMode );
    unsigned int write( const void* data, unsigned int len );
    void flush();
    void close();
    void movePosToStart();
    void movePosToEnd();
    void setPosTo(int nPos);
    unsigned int size();

    void readString(String& strData);
    void readStringW(StringW& strTextW);

    InputStream* getInputStream();
    int readByte();
    int readData(void* buffer, int bufOffset, int bytesToRead);

    static unsigned int getFileSize( const char* szFilePath );
    static bool         isFileExist( const char* szFilePath );
    static void         deleteFile( const char* szFilePath );
    static void         renameFile( const char* szOldFilePath, const char* szNewFilePath );
    static void         deleteFilesInFolder(const char* szFolderPath);
    static void         loadTextFile(const char* szFilePath, String& strFile);
    static void         createFolder(const char* szDirPath);
    static void         readStringFromFile( const char* szFilePath, String& strData );
    static void         writeStringToFile( const char* szFilePath, String& strData );
private:
    CRhoFile(const CRhoFile&);
    void operator=(const CRhoFile&);

};

}
}

extern "C" void delete_files_in_folder(const char *szFolderPath);

#endif //_RHOFILE_H_

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rhodes-2.4.1 platform/shared/common/RhoFile.h
rhodes-2.4.1.beta.1 platform/shared/common/RhoFile.h
rhodes-2.4.0 platform/shared/common/RhoFile.h
rhodes-2.4.0.beta.2 platform/shared/common/RhoFile.h
rhodes-2.4.0.beta.1 platform/shared/common/RhoFile.h
rhodes-2.3.2 platform/shared/common/RhoFile.h
rhodes-2.3.2.beta.2 platform/shared/common/RhoFile.h
rhodes-2.3.2.beta.1 platform/shared/common/RhoFile.h
rhodes-2.3.1 platform/shared/common/RhoFile.h
rhodes-2.3.1.beta.1 platform/shared/common/RhoFile.h