Ignore:
Timestamp:
Jul 25, 2007, 5:59:35 PM (14 years ago)
Author:
Eugene Romanenko
Message:

DJVU plugin: djvulibre updated to version 3.5.19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libdjvu/GSmartPointer.h

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: GSmartPointer.h,v 1.11 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: $
     56// $Id: GSmartPointer.h,v 1.13 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifndef _GSMARTPOINTER_H_
     
    8789
    8890    @version
    89     #$Id: GSmartPointer.h,v 1.11 2003/11/07 22:08:21 leonb Exp $#
     91    #$Id: GSmartPointer.h,v 1.13 2007/03/25 20:48:32 leonb Exp $#
    9092    @args
    9193*/
     
    108110
    109111
    110 
    111 /* What is this innovation ?
    112    What does it do that a GArray does not do ? */
    113 
    114 class GPBufferBase
    115 {
    116 public:
    117   GPBufferBase(void *&,const size_t n,const size_t t);
    118   void swap(GPBufferBase &p);
    119   void resize(const size_t n,const size_t t);
    120   void replace(void *nptr,const size_t n);
    121   void set(const size_t t,const char c);
    122   ~GPBufferBase();
    123   operator int(void) const { return ptr ? num : 0; }
    124 private:
    125   void *&ptr;
    126   size_t num;
    127 };
    128 
    129 template<class TYPE>
    130 class GPBuffer : public GPBufferBase
    131 {
    132 public:
    133   GPBuffer(TYPE *&xptr,const size_t n=0) : GPBufferBase((void *&)xptr,n,sizeof(TYPE)) {}
    134   inline void resize(const size_t n) {GPBufferBase::resize(n,sizeof(TYPE));}
    135   inline void clear(void) {GPBufferBase::set(sizeof(TYPE),0);}
    136   inline void set(const char c) {GPBufferBase::set(sizeof(TYPE),c);}
    137   inline operator int(void) const {return GPBufferBase::operator int();}
    138 };
    139112
    140113/** Base class for reference counted objects. 
     
    480453}
    481454
     455/* GPBUFFER */
     456
     457/* What is this LT innovation ?
     458   What does it do that a GArray does not do ?
     459   What about the objects construction and destruction ? */
     460
     461class GPBufferBase
     462{
     463public:
     464  GPBufferBase(void *&,const size_t n,const size_t t);
     465  void swap(GPBufferBase &p);
     466  void resize(const size_t n,const size_t t);
     467  void replace(void *nptr,const size_t n);
     468  void set(const size_t t,const char c);
     469  ~GPBufferBase();
     470  operator int(void) const { return ptr ? num : 0; }
     471private:
     472  void *&ptr;
     473  size_t num;
     474};
     475
     476template<class TYPE>
     477class GPBuffer : public GPBufferBase
     478{
     479public:
     480  GPBuffer(TYPE *&xptr,const size_t n=0) : GPBufferBase((void *&)xptr,n,sizeof(TYPE)) {}
     481  inline void resize(const size_t n) {GPBufferBase::resize(n,sizeof(TYPE));}
     482  inline void clear(void) {GPBufferBase::set(sizeof(TYPE),0);}
     483  inline void set(const char c) {GPBufferBase::set(sizeof(TYPE),c);}
     484  inline operator int(void) const {return GPBufferBase::operator int();}
     485};
     486
     487
    482488
    483489#ifdef HAVE_NAMESPACES
Note: See TracChangeset for help on using the changeset viewer.