LCOV - code coverage report
Current view: directory - frmts/pcidsk/sdk - pcidsk_buffer.h (source / functions) Found Hit Coverage
Test: gdal_filtered.info Lines: 2 2 100.0 %
Date: 2010-01-09 Functions: 1 1 100.0 %

       1                 : /******************************************************************************
       2                 :  *
       3                 :  * Purpose:  Declaration of the PCIDSKBuffer class
       4                 :  * 
       5                 :  ******************************************************************************
       6                 :  * Copyright (c) 2009
       7                 :  * PCI Geomatics, 50 West Wilmot Street, Richmond Hill, Ont, Canada
       8                 :  *
       9                 :  * Permission is hereby granted, free of charge, to any person obtaining a
      10                 :  * copy of this software and associated documentation files (the "Software"),
      11                 :  * to deal in the Software without restriction, including without limitation
      12                 :  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      13                 :  * and/or sell copies of the Software, and to permit persons to whom the
      14                 :  * Software is furnished to do so, subject to the following conditions:
      15                 :  *
      16                 :  * The above copyright notice and this permission notice shall be included
      17                 :  * in all copies or substantial portions of the Software.
      18                 :  *
      19                 :  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
      20                 :  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      21                 :  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
      22                 :  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      23                 :  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
      24                 :  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
      25                 :  * DEALINGS IN THE SOFTWARE.
      26                 :  ****************************************************************************/
      27                 : #ifndef __INCLUDE_PCIDSKBUFFER_H
      28                 : #define __INCLUDE_PCIDSKBUFFER_H
      29                 : 
      30                 : #include "pcidsk_config.h"
      31                 : 
      32                 : #include <string>
      33                 : 
      34                 : namespace PCIDSK
      35                 : {
      36                 : /************************************************************************/
      37                 : /*                             PCIDSKBuffer                             */
      38                 : /*                                                                      */
      39                 : /*      Convenience class for managing ascii headers of various         */
      40                 : /*      sorts.  Primarily for internal use.                             */
      41                 : /************************************************************************/
      42                 : 
      43                 :     class PCIDSKBuffer 
      44                 :     {
      45                 :         friend class MetadataSegment; // ?
      46                 :     public:
      47                 :         PCIDSKBuffer( int size = 0 );
      48                 :         PCIDSKBuffer( const char *src, int size );
      49                 :         ~PCIDSKBuffer();
      50                 : 
      51                 :         char  *buffer;
      52                 :         int         buffer_size;
      53                 : 
      54                 :         PCIDSKBuffer &operator=(const PCIDSKBuffer& src);
      55                 : 
      56                 :         const char *Get( int offset, int size );
      57                 :         void        Get( int offset, int size, std::string &target, int unpad=1 );
      58                 : 
      59                 :         double      GetDouble( int offset, int size );
      60                 :         int         GetInt( int offset, int size );
      61                 :         int64       GetInt64( int offset, int size );
      62                 :         uint64      GetUInt64( int offset, int size );
      63                 : 
      64                 :         void        Put( const char *value,  int offset, int size );
      65                 :         void        Put( uint64 value, int offset, int size );
      66                 :         void        Put( double value, int offset, int size, const char *fmt=NULL );
      67            1310 :         void        Put( int value, int offset, int size ) 
      68            1310 :             { Put( (uint64) value, offset, size ); }
      69                 : 
      70                 :         void        SetSize( int size );
      71                 :         
      72                 :     private:
      73                 :         std::string work_field;
      74                 :     };
      75                 : } // end namespace PCIDSK
      76                 : #endif // __INCLUDE_PCIDSKBUFFER_H 

Generated by: LCOV version 1.7