Mini application server API for C++.

 Overview   Project   Class   Tree   Deprecated   Index 
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

base
Class CzzFile

   in zz_file.h
Direct Known Subclasses:
CzzZip

class CzzFile

File

Author:
Toni Thomsson, toni@tonjac.org

Field Summary
protected FILE* m_Handle
          Handle
protected CzzString m_Mode
          Mode
protected bool m_Open
          Open?
protected CzzString m_Path
          Path
protected size_t m_Size
          Size
protected time_t m_Time
          Time
 
Constructor Summary
CzzFile( const char* path )
          Create a wrapper object for a file
~CzzFile()
          
 
Method Summary
 void Close( void )
          Close file
 void CopyTo( const char* path )
          Copy file
 void Delete( void )
          Delete file
 bool Exist( void )
          Does the file exist?
 FILE* GetHandle( void )
          File handle
 CzzString& GetPath( void )
          Path
 void Open( const char* mode )
          Open file
 size_t Read( void* p, size_t size )
          Read a block from the file
 void Rename( const char* newname )
          Rename file
 void SetPath( const char* path )
          Change path
 size_t Size( void )
          File size
 time_t Time( void )
          File modify time
 size_t Write( void* p, size_t size )
          Write a block to the file
 

Field Detail

m_Handle

protected FILE* m_Handle;
Handle

m_Mode

protected CzzString m_Mode;
Mode

m_Open

protected bool m_Open;
Open?

m_Path

protected CzzString m_Path;
Path

m_Size

protected size_t m_Size;
Size

m_Time

protected time_t m_Time;
Time


Constructor Detail

CzzFile

public CzzFile( const char* path );
Create a wrapper object for a file
Parameters:
path - Full path to file

~CzzFile

public ~CzzFile();


Method Detail

Close

public void Close( void );
Close file

CopyTo

public void CopyTo( const char* path );
Copy file
Parameters:
path - Path to copy file to

Delete

public void Delete( void );
Delete file

Exist

public bool Exist( void );
Does the file exist?

GetHandle

public FILE* GetHandle( void );
File handle

GetPath

public CzzString& GetPath( void );
Path

Open

public void Open( const char* mode );
Open file
Parameters:
mode - mode (a,w,r + b) see fopen()

Read

public size_t Read( void* p, size_t size );
Read a block from the file
Parameters:
p - Pointer to a memoryblock to receive data read
size - Size of p

Rename

public void Rename( const char* newname );
Rename file
Parameters:
newname - New file name including path

SetPath

public void SetPath( const char* path );
Change path

Size

public size_t Size( void );
File size

Time

public time_t Time( void );
File modify time

Write

public size_t Write( void* p, size_t size );
Write a block to the file
Parameters:
p - Pointer to a memoryblock to be written
size - Size of p

 Overview   Project   Class   Tree   Deprecated   Index 
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD