logo

Macro Programming

logo
Contents

file Class Reference

file read/write More...

#include <file.h>

List of all members.


Public Member Functions

void close ()
 close file
void find (string path, string s)
 find file
void findNext ()
 find next
bool open (bool mode=true)
 open file
string read ()
 read file
void write (string s)
 write file

Public Attributes

string filename
 filename

Detailed Description

file read/write

This class provides a interface for reading and writing on files.


Member Function Documentation

void file::close (  ) 

close file

The file is closed.

void file::find ( string  path,
string  s 
)

find file

Find a file matching to the search string s. If a match is found, filename is set. Otherwise filename is set to "".

void file::findNext (  ) 

find next

Find an other file match to a previous find. If a match is found, filename is set. Otherwise filename is set to "".

bool file::open ( bool  mode = true  ) 

open file

Open a file. The filename had to be set prior to the property filename. If mode is true, the file is opened in readonly mode. If mode is false, the file is open as writeonly mode.

Returns:
true if operation was successfull. Otherwise false.

string file::read (  ) 

read file

Returns:
the hole file is returned as a string

void file::write ( string  s  ) 

write file

The file is overwrite with the string s


Member Data Documentation

string file::filename

filename

Name of the file to operate with.


Contents
SourceForge.net Logo