class Protocol

Standard protocol class.

Inheritance:


Public Methods

[more]virtual void engage(const char* url, const char* user, const char* passwd) = 0
Activate connection.
[more]virtual void disengage(void) = 0
Close down the connection
[more]virtual void put(const char* file) = 0
Put a file.
[more]virtual void get(const char* file) = 0
Get a file.
[more]virtual void put(const char* file, void (*f)(unsigned int), bool isOtherTested) = 0
Visual put Put a file <file> from the other protocol to CWD+(get_fname(file)) ie, file is a the name (and path) of the file in the other protocol object that we want to put into this protocol object.
[more]virtual void get(const char* file, void (*f)(unsigned int), bool isOtherTested) = 0
Visual get Get a file <file> from this protocol to the other protocol.
[more]virtual void rm(const char* file) = 0
Remove a file.
[more]virtual const char* ls(const char* dir) = 0
List contents of a directory.
[more]virtual List* copy_flist() = 0
Append directory listing to List object.
[more]virtual List* repeat_flist() = 0
Get a pointer to the current flist
[more]virtual void mk_dir(const char* dir) = 0
Create a directory
[more]virtual void rm_dir(const char* dir) = 0
Remove a directory
[more]virtual void append(const char* file, const char* dest, unsigned int offset) = 0
Append a file to another file.
[more]virtual void setCurrDir(const char*) = 0
Sets current working directory
[more]virtual Protocol* setCurrDir(ListItem* litm) = 0
Changes the working directory.
[more]virtual const char* getCurrDir(char* inbuf) = 0
Gets current working directory
[more]virtual int open_stream(const char* name, const char* mode, int flag, int offset, unsigned int* file_size) = 0
Open a stream.
[more]virtual const char* open_read_stream(ListItem* litm, int offset) = 0
Open a stream for reading.
[more]virtual void open_write_stream(const char* fname, int offset) = 0
Open a stream for writing.
[more]virtual int get_stream_size() = 0
Returns size of read_stream
[more]virtual void close_stream(void) = 0
Close a stream.
[more]virtual int read_stream(char* buffer, unsigned int size) = 0
Read data.
[more]virtual int write_stream(const char* buffer, unsigned int size) = 0
Write data.
[more]void parse_url(const char* urlin, struct url_data* retdat)
Parse a url.
[more]void set_state(State* istate)
Set the local state reference
[more]void abort_all(void)
Abort all data transfers

Protected Methods

[more]const char* get_fname(const char* fname)
Return only the file name in a path.
[more]int is_absolute(const char* i)
Determins if the file name is absolute path


Documentation

Standard protocol class. Protocol is the abstract base class for all protocol implementations.
ovirtual void engage(const char* url, const char* user, const char* passwd) = 0
Activate connection. Engage is used to activate the protocol, for example connect the FTP protocol client object to a FTP server.

ovirtual void disengage(void) = 0
Close down the connection

ovirtual void put(const char* file) = 0
Put a file. Put the <opposite protocol>->file to current dir.

ovirtual void get(const char* file) = 0
Get a file. Get the file and store it at <opposite protocol>-><current dir>.

ovirtual void put(const char* file, void (*f)(unsigned int), bool isOtherTested) = 0
Visual put Put a file <file> from the other protocol to CWD+(get_fname(file)) ie, file is a the name (and path) of the file in the other protocol object that we want to put into this protocol object.

f is a function pointer that we use to update a progress bar.

the isOtherTested parameter is obsolete.

ovirtual void get(const char* file, void (*f)(unsigned int), bool isOtherTested) = 0
Visual get Get a file <file> from this protocol to the other protocol. The file is stored at the other protocl in it's CWD.

f is a function pointer that we use to update a progress bar.

the isOtherTested parameter is obsolete.

ovirtual void rm(const char* file) = 0
Remove a file.

ovirtual const char* ls(const char* dir) = 0
List contents of a directory.

ovirtual List* copy_flist() = 0
Append directory listing to List object. This request updates the internal flist

ovirtual List* repeat_flist() = 0
Get a pointer to the current flist

ovirtual void mk_dir(const char* dir) = 0
Create a directory

ovirtual void rm_dir(const char* dir) = 0
Remove a directory

ovirtual void append(const char* file, const char* dest, unsigned int offset) = 0
Append a file to another file. Start reading other->file at offset, append that data to this->dest.

ovirtual void setCurrDir(const char*) = 0
Sets current working directory

ovirtual Protocol* setCurrDir(ListItem* litm) = 0
Changes the working directory. The r is a reference to a internal list, the list can be retrieved with getDirectoryList().

ovirtual const char* getCurrDir(char* inbuf) = 0
Gets current working directory

ovirtual int open_stream(const char* name, const char* mode, int flag, int offset, unsigned int* file_size) = 0
Open a stream. Open a stream with mode. success: return 0 failure: return <something not 0>

ovirtual const char* open_read_stream(ListItem* litm, int offset) = 0
Open a stream for reading. Throws a protoerr on failure. Offset indicates where to resume

ovirtual void open_write_stream(const char* fname, int offset) = 0
Open a stream for writing. Throws a protoerr on failure. Offset indicates where to append

ovirtual int get_stream_size() = 0
Returns size of read_stream

ovirtual void close_stream(void) = 0
Close a stream. Close the latest stream opened with open_stream()

ovirtual int read_stream(char* buffer, unsigned int size) = 0
Read data. Reads data from the stream to buffer.

ovirtual int write_stream(const char* buffer, unsigned int size) = 0
Write data. Writes data to the stream from buffer.

ovoid parse_url(const char* urlin, struct url_data* retdat)
Parse a url. Stores the data in a url_data structure.

ovoid set_state(State* istate)
Set the local state reference

ovoid abort_all(void)
Abort all data transfers

oconst char* get_fname(const char* fname)
Return only the file name in a path. Returns a pointer to the first character in the filename (stripping the path).

oint is_absolute(const char* i)
Determins if the file name is absolute path


Direct child classes:
hdd
SFTP
HTTP
FTP

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.