virtual void engage(const char* url, const char* user, const char* passwd)
- Connect protocol.
This does not really connect, it just initializes and prepares
for connection.
virtual void disengage(void)
- Close the ftp connection
virtual void put(const char* file)
- Put a file.
Put the other->file to CWD.
virtual void get(const char* file)
- Get a file.
Get the file and store it at other->CWD.
virtual void put(const char* file, void (*f)(unsigned int), bool isOtherTried)
- 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.
virtual void get(const char* file, void (*f)(unsigned int), bool isOtherTried)
- 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.
virtual void rm(const char* file)
- Remove a file
virtual const char* ls(const char* dir)
- List contents of a directory. (Deprecated)
This method is not implemented, at the moment.
virtual List* copy_flist()
- Copies internal directory listing to List object
Creates a list of links found in the current html file
virtual List* repeat_flist()
- Get a pointer to the current flist
virtual void mk_dir(const char* dir)
- Create a new directory.
Not implemented, this is a read-only protocol implementation.
virtual void rm_dir(const char* dir)
- Remove a empty directory.
Not implemented, this is a read-only protocol implementation.
virtual void append(const char* file, const char* dest, unsigned int offset)
- Append a file to another file.
Start reading other->file at offset, append that data
to this->dest.
!NOTE! Not implemented, either, read-only protocol.
virtual void setCurrDir(const char*)
- Sets current working directory
virtual Protocol* setCurrDir(ListItem* litm)
- Changes the working directory.
The r is a reference to a internal list, the list
can be retrieved with getDirectoryList().
virtual const char* getCurrDir(char* inbuf)
- Gets current working directory
virtual void set_state(State* istate)
- Set the local state reference
virtual int open_stream(const char* name, const char* mode, int flg, int offset, unsigned int* file_size)
- Open a stream.
Open a stream with mode.
success: return 0
failure: return <something not 0>
virtual const char* open_read_stream(ListItem* litm, int offset)
- Open a stream for reading.
Throws a protoerr on failure.
Offset indicates where to resume
virtual void open_write_stream(const char* fname, int offset)
- Open a stream for writing.
Throws a protoerr on failure.
Offset indicates where to append
virtual int get_stream_size()
- Returns size of read_stream
virtual void close_stream(void)
- Close a stream.
Close the latest stream
opened with open_stream()
virtual int read_stream(char* buffer, unsigned int size)
- Read data.
Read data from the stream to buffer.
virtual int write_stream(const char* buffer, unsigned int size)
- Write data.
Write data to the stream from buffer.