source: extensions/AMetaData/JpegMetaData/Readers/SegmentReader.class.php @ 4705

Last change on this file since 4705 was 4705, checked in by grum, 14 years ago

Change Locale class by L10n class ; add Readers for Nikon and Canon cameras ; some bug corrected

  • Property svn:executable set to *
File size: 3.2 KB
Line 
1<?php
2/*
3 * --:: JPEG MetaDatas ::-------------------------------------------------------
4 *
5 *  Author    : Grum
6 *   email    : grum at piwigo.org
7 *   website  : http://photos.grum.fr
8 *
9 *   << May the Little SpaceFrog be with you ! >>
10 *
11 *
12 * +-----------------------------------------------------------------------+
13 * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
14 * +-----------------------------------------------------------------------+
15 * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
16 * +-----------------------------------------------------------------------+
17 * | This program is free software; you can redistribute it and/or modify  |
18 * | it under the terms of the GNU General Public License as published by  |
19 * | the Free Software Foundation                                          |
20 * |                                                                       |
21 * | This program is distributed in the hope that it will be useful, but   |
22 * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
23 * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
24 * | General Public License for more details.                              |
25 * |                                                                       |
26 * | You should have received a copy of the GNU General Public License     |
27 * | along with this program; if not, write to the Free Software           |
28 * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
29 * | USA.                                                                  |
30 * +-----------------------------------------------------------------------+
31 *
32 *
33 * -----------------------------------------------------------------------------
34 *
35 * The SegmentReader is a generic class providing methods to manage datas
36 * segments
37 *
38 * -----------------------------------------------------------------------------
39 *
40 * .. Notes ..
41 *
42 * This class is not declared as an abstract class, but it's not recommanded to
43 * create object with it.
44 *
45 *
46 * Derived classes :
47 *  - TiffReader        (for Tiff data block)
48 *
49 * This class provides theses public functions :
50 *  - getIsValid
51 *  - getIsLoaded
52 *
53 * -----------------------------------------------------------------------------
54 */
55
56  class SegmentReader
57  {
58    protected $data = null;
59    protected $isValid = false;
60    protected $isLoaded = false;
61
62    /**
63     * The constructor need the segment's datas
64     *
65     * @param Data $data : a Data object
66     */
67    function __construct(Data $data)
68    {
69      $this->data = $data;
70      $this->data->seek();
71    }
72
73    function __destruct()
74    {
75      unset($this->data);
76      unset($this->isValid);
77      unset($this->isLoaded);
78    }
79
80    /**
81     * return true if the segment is valid
82     *
83     * @return Boolean
84     */
85    public function getIsValid()
86    {
87      return($this->isValid);
88    }
89
90    /**
91     * return true if the segment is loaded
92     *
93     * @return Boolean
94     */
95    public function getIsLoaded()
96    {
97      return($this->isLoaded);
98    }
99
100    public function toString()
101    {
102      $returned="";
103      return($returned);
104    }
105
106  }
107
108
109?>
Note: See TracBrowser for help on using the repository browser.