GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GUrl Class Referenceabstract

Abstract URL base class. More...

#include <GUrl.hpp>

Inheritance diagram for GUrl:
GBase GUrlFile GUrlString

Public Member Functions

 GUrl (void)
 Void constructor. More...
 
 GUrl (const GUrl &url)
 Copy constructor. More...
 
virtual ~GUrl (void)
 Destructor. More...
 
GUrloperator= (const GUrl &url)
 Assignment operator. More...
 
virtual void clear (void)=0
 Clear object. More...
 
virtual GUrlclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
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 get_char (void) const =0
 
virtual void put_char (const int &character)=0
 
virtual void scanf (const char *format,...)=0
 
virtual void printf (const char *format,...)=0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GUrl &url)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Detailed Description

Abstract URL base class.

This class defines the abstract interface for all URL classes. The URL classes implement handling of various URL types through a standard interface. This allows to develop URL independent code.

Definition at line 44 of file GUrl.hpp.

Constructor & Destructor Documentation

GUrl::GUrl ( void  )

Void constructor.

Definition at line 51 of file GUrl.cpp.

References init_members().

GUrl::GUrl ( const GUrl url)

Copy constructor.

Parameters
[in]urlURL.

Definition at line 66 of file GUrl.cpp.

References copy_members(), and init_members().

GUrl::~GUrl ( void  )
virtual

Destructor.

Definition at line 82 of file GUrl.cpp.

References free_members().

Member Function Documentation

virtual std::string GUrl::classname ( void  ) const
pure virtual

Return class name.

Returns
String containing the class name.

Returns the class name for non-abstract classes in a human readable way.

Implements GBase.

Implemented in GUrlString, and GUrlFile.

virtual void GUrl::clear ( void  )
pure virtual

Clear object.

Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.

Implements GBase.

Implemented in GUrlString, and GUrlFile.

virtual GUrl* GUrl::clone ( void  ) const
pure virtual

Clones object.

Returns
Pointer to deep copy of object.

Creates a deep copy of the object and returns a pointer to the object.

Implements GBase.

Implemented in GUrlString, and GUrlFile.

virtual void GUrl::close ( void  )
pure virtual

Implemented in GUrlString, and GUrlFile.

void GUrl::copy_members ( const GUrl url)
protected

Copy class members.

Parameters
[in]urlURL.

Definition at line 153 of file GUrl.cpp.

Referenced by GUrl(), and operator=().

void GUrl::free_members ( void  )
protected

Delete class members.

Definition at line 163 of file GUrl.cpp.

Referenced by GUrlFile::clear(), GUrlString::clear(), operator=(), and ~GUrl().

virtual int GUrl::get_char ( void  ) const
pure virtual

Implemented in GUrlString, and GUrlFile.

Referenced by GXml::parse().

void GUrl::init_members ( void  )
protected

Initialise class members.

Definition at line 141 of file GUrl.cpp.

Referenced by GUrlFile::clear(), GUrlString::clear(), GUrl(), and operator=().

virtual void GUrl::open ( const std::string &  url,
const std::string &  mode 
)
pure virtual

Implemented in GUrlString, and GUrlFile.

GUrl & GUrl::operator= ( const GUrl url)

Assignment operator.

Parameters
[in]urlURL.
Returns
URL.

Definition at line 104 of file GUrl.cpp.

References copy_members(), free_members(), and init_members().

Referenced by GUrlFile::operator=(), and GUrlString::operator=().

virtual std::string GUrl::print ( const GChatter chatter = NORMAL) const
pure virtual

Print content of object.

Parameters
[in]chatterChattiness (defaults to NORMAL).
Returns
String containing the content of the object.

Formats the content in a standard way and puts this content in a C++ string that is returned.

Implements GBase.

Implemented in GUrlString, and GUrlFile.

virtual void GUrl::printf ( const char *  format,
  ... 
)
pure virtual
virtual void GUrl::put_char ( const int &  character)
pure virtual

Implemented in GUrlString, and GUrlFile.

virtual int GUrl::read ( void *  buffer,
const int &  nbyte 
)
pure virtual

Implemented in GUrlString, and GUrlFile.

virtual void GUrl::scanf ( const char *  format,
  ... 
)
pure virtual

Implemented in GUrlString, and GUrlFile.

virtual int GUrl::write ( const void *  buffer,
const int &  nbyte 
)
pure virtual

Implemented in GUrlString, and GUrlFile.


The documentation for this class was generated from the following files: