Feature #800
Implement GUrl class for transparent handling of URL operations
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assigned To: | % Done: | 100% | ||
| Category: | - | |||
| Target version: | 00-08-00 | |||
| Duration: |
Description
GUrl that implements the following basic operations:
openfor opening (e.g. file opening, socket opening, string clearing, etc.)closefor closing (e.g. file closing, socket closing, etc.)readreading of the mediawritewriting to the mediagetcgetting a character from the mediaputcputting a character into the media
GUrlStringhandles a simple stringGUrlFilehandles a flat fileGUrlHttphandles a network connection using httpGUrlHttpshandles a secured network connection (need to check whether this should be merged withGUrlHttpGUrlFtphandles ftp connections
Recurrence
No recurrence.
History
#1
Updated by Knödlseder Jürgen over 13 years ago
- Description updated (diff)
- Priority changed from Normal to High
#2
Updated by Knödlseder Jürgen over 13 years ago
- Target version set to 00-08-00
#3
Updated by Knödlseder Jürgen over 13 years ago
- Subject changed from Implement GUrl class for transparent handling of URL handling operations to Implement GUrl class for transparent handling of URL operations
#4
Updated by Knödlseder Jürgen over 13 years ago
- % Done changed from 0 to 80
The GUrl abstract base class has been implemented that defines the standard interface for the URL classes:
class GUrl : public GBase {
public:
// Constructors and destructors
GUrl(void);
GUrl(const GUrl& url);
virtual ~GUrl(void);
// Operators
GUrl& operator=(const GUrl& url);
// Pure virtual methods
virtual void clear(void) = 0;
virtual GUrl* clone(void) const = 0;
virtual void open(const std::string& url, const std::string& mode) = 0;
virtual void close(void) = 0;
virtual int read(void* buffer, const int& nbyte) = 0;
virtual int write(const void* buffer, const int& nbyte) = 0;
virtual int getchar(void) = 0;
virtual void putchar(const int& character) = 0;
virtual void scanf(const char* format, ...) = 0;
virtual void printf(const char* format, ...) = 0;
virtual std::string print(void) const = 0;
};
The GUrlFile class has been implemented that handles flat files. Unit tests have been added for C++ and Python to validate the class. Note that the Python interface differs slightly from the C++ interface. In particular, the scanf() and printf() methods are so far missing. We may see later how those could be implemented. I guess this requires some deep SWIG coding.
#5
Updated by Knödlseder Jürgen over 13 years ago
- Status changed from New to In Progress
#6
Updated by Knödlseder Jürgen over 13 years ago
- Status changed from In Progress to Feedback
- % Done changed from 80 to 100
The class GUrlString has been added for reading and writing to strings. This completes the functionality that is needed for the moment, hence the feature can be closed.
Note that the printf() method has an internal buffer limitation and the scanf() method does not advance the internal pointer, hence printf() can be used with limitations and scanf() cannot really be used.
See #801.
#7
Updated by Knödlseder Jürgen almost 13 years ago
- Status changed from Feedback to Closed
- Assigned To set to Knödlseder Jürgen