Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 2c9d30f3cf217a6cae41860ebc0d6704 > files > 130

libid3lib3.8_0-devel-3.8.0-0.pre2.1.1mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>src/header.h Source File</title>
<link href="id3lib.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.12 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>src/header.h</h1><a href="header_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">// -*- C++ -*-</font>
00002 <font class="comment">// $Id: header.h,v 1.1 2000/10/24 16:13:52 eldamitri Exp $</font>
00003 
00004 <font class="comment">// id3lib: a C++ library for creating and manipulating id3v1/v2 tags</font>
00005 <font class="comment">// Copyright 1999, 2000  Scott Thomas Haug</font>
00006 
00007 <font class="comment">// This library is free software; you can redistribute it and/or modify it</font>
00008 <font class="comment">// under the terms of the GNU Library General Public License as published by</font>
00009 <font class="comment">// the Free Software Foundation; either version 2 of the License, or (at your</font>
00010 <font class="comment">// option) any later version.</font>
00011 <font class="comment">//</font>
00012 <font class="comment">// This library is distributed in the hope that it will be useful, but WITHOUT</font>
00013 <font class="comment">// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</font>
00014 <font class="comment">// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public</font>
00015 <font class="comment">// License for more details.</font>
00016 <font class="comment">//</font>
00017 <font class="comment">// You should have received a copy of the GNU Library General Public License</font>
00018 <font class="comment">// along with this library; if not, write to the Free Software Foundation,</font>
00019 <font class="comment">// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</font>
00020 
00021 <font class="comment">// The id3lib authors encourage improvements and optimisations to be sent to</font>
00022 <font class="comment">// the id3lib coordinator.  Please see the README file for details on where to</font>
00023 <font class="comment">// send such submissions.  See the AUTHORS file for a list of people who have</font>
00024 <font class="comment">// contributed to id3lib.  See the ChangeLog file for a list of changes to</font>
00025 <font class="comment">// id3lib.  These files are distributed with id3lib at</font>
00026 <font class="comment">// http://download.sourceforge.net/id3lib/</font>
00027 
00028 <font class="preprocessor">#ifndef _ID3LIB_HEADER_H_</font>
00029 <font class="preprocessor"></font><font class="preprocessor">#define _ID3LIB_HEADER_H_</font>
00030 <font class="preprocessor"></font>
00031 <font class="preprocessor">#include "<a class="code" href="globals_8h.html">globals.h</a>"</font>
00032 <font class="preprocessor">#include "<a class="code" href="flags_8h.html">flags.h</a>"</font>
00033 
00034 <font class="keyword">class </font><a class="code" href="class_i_d3___reader.html">ID3_Reader</a>;
00035 <font class="keyword">class </font><a class="code" href="class_i_d3___writer.html">ID3_Writer</a>;
00036 
<a name="l00037"></a><a class="code" href="class_i_d3___header.html">00037</a> <font class="keyword">class </font><a class="code" href="class_i_d3___header.html">ID3_Header</a>
00038 {
00039 <font class="keyword">public</font>:
<a name="l00040"></a><a class="code" href="struct_i_d3___header_1_1_info.html">00040</a>   <font class="keyword">struct </font>Info
00041   {
<a name="l00042"></a><a class="code" href="struct_i_d3___header_1_1_info.html#m0">00042</a>     <a class="code" href="globals_8h.html#a33">uchar</a>      <a class="code" href="struct_i_d3___header_1_1_info.html#m0">frame_bytes_id</a>;
<a name="l00043"></a><a class="code" href="struct_i_d3___header_1_1_info.html#m1">00043</a>     <a class="code" href="globals_8h.html#a33">uchar</a>      <a class="code" href="struct_i_d3___header_1_1_info.html#m1">frame_bytes_size</a>;
<a name="l00044"></a><a class="code" href="struct_i_d3___header_1_1_info.html#m2">00044</a>     <a class="code" href="globals_8h.html#a33">uchar</a>      <a class="code" href="struct_i_d3___header_1_1_info.html#m2">frame_bytes_flags</a>;
<a name="l00045"></a><a class="code" href="struct_i_d3___header_1_1_info.html#m3">00045</a>     <font class="keywordtype">bool</font>       <a class="code" href="struct_i_d3___header_1_1_info.html#m3">is_extended</a>;
<a name="l00046"></a><a class="code" href="struct_i_d3___header_1_1_info.html#m4">00046</a>     size_t     <a class="code" href="struct_i_d3___header_1_1_info.html#m4">extended_bytes</a>;
<a name="l00047"></a><a class="code" href="struct_i_d3___header_1_1_info.html#m5">00047</a>     <font class="keywordtype">bool</font>       <a class="code" href="struct_i_d3___header_1_1_info.html#m5">is_experimental</a>;
00048   };
00049 
<a name="l00050"></a><a class="code" href="class_i_d3___header.html#a0">00050</a>   <a class="code" href="class_i_d3___header.html#a0">ID3_Header</a>() 
00051     : <a class="code" href="class_i_d3___header.html#n0">_spec</a> (<a class="code" href="globals_8h.html#a216a52">ID3V2_UNKNOWN</a>),
00052       <a class="code" href="class_i_d3___header.html#n1">_data_size</a> (0),
00053       <a class="code" href="class_i_d3___header.html#n4">_changed</a> (false)
00054   { 
00055     this-&gt;<a class="code" href="class_i_d3___header.html#a6">Clear</a>();
00056     <a class="code" href="class_i_d3___header.html#n4">_changed</a> = <font class="keyword">false</font>;
00057   }
<a name="l00058"></a><a class="code" href="class_i_d3___header.html#a1">00058</a>   <font class="keyword">virtual</font> <a class="code" href="class_i_d3___header.html#a1">~ID3_Header</a>() { ; }
00059   
00060   <font class="keyword">virtual</font> <font class="keywordtype">bool</font>       <a class="code" href="class_i_d3___header.html#a2">SetSpec</a>(<a class="code" href="globals_8h.html#a216">ID3_V2Spec</a>);
<a name="l00061"></a><a class="code" href="class_i_d3___header.html#a3">00061</a>   <font class="comment">/*   */</font> <a class="code" href="globals_8h.html#a216">ID3_V2Spec</a> <a class="code" href="class_i_d3___header.html#a3">GetSpec</a>()<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <a class="code" href="class_i_d3___header.html#n0">_spec</a>; }
00062 
<a name="l00063"></a><a class="code" href="class_i_d3___header.html#a4">00063</a>   <font class="comment">/*   */</font> <font class="keywordtype">bool</font>       <a class="code" href="class_i_d3___header.html#a4">SetDataSize</a>(size_t size)
00064   { 
00065     <font class="keywordtype">bool</font> changed = size != <a class="code" href="class_i_d3___header.html#n1">_data_size</a>; 
00066     <a class="code" href="class_i_d3___header.html#n4">_changed</a> = <a class="code" href="class_i_d3___header.html#n4">_changed</a> || changed;
00067     <a class="code" href="class_i_d3___header.html#n1">_data_size</a> = size;
00068     <font class="keywordflow">return</font> changed;
00069   }
<a name="l00070"></a><a class="code" href="class_i_d3___header.html#a5">00070</a>   <font class="comment">/*   */</font> size_t     <a class="code" href="class_i_d3___header.html#a5">GetDataSize</a>()<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <a class="code" href="class_i_d3___header.html#n1">_data_size</a>; }
00071   
<a name="l00072"></a><a class="code" href="class_i_d3___header.html#a6">00072</a>   <font class="keyword">virtual</font> <font class="keywordtype">bool</font>       <a class="code" href="class_i_d3___header.html#a6">Clear</a>()
00073   {
00074     <font class="keywordtype">bool</font> changed = this-&gt;<a class="code" href="class_i_d3___header.html#a4">SetDataSize</a>(0);
00075     <font class="keywordflow">if</font> (this-&gt;<a class="code" href="class_i_d3___header.html#a3">GetSpec</a>() == <a class="code" href="globals_8h.html#a216a52">ID3V2_UNKNOWN</a>)
00076     {
00077       this-&gt;<a class="code" href="class_i_d3___header.html#a2">SetSpec</a>(<a class="code" href="globals_8h.html#a216a58">ID3V2_LATEST</a>);
00078       changed = <font class="keyword">true</font>;
00079     }
00080     changed = <a class="code" href="class_i_d3___header.html#n2">_flags</a>.<a class="code" href="class_i_d3___flags.html#a7">clear</a>() || changed;
00081     <a class="code" href="class_i_d3___header.html#n4">_changed</a> = changed || <a class="code" href="class_i_d3___header.html#n4">_changed</a>;
00082     <font class="keywordflow">return</font> changed;
00083   }
00084   <font class="keyword">virtual</font> size_t     <a class="code" href="class_i_d3___header.html#a7">Size</a>() <font class="keyword">const</font> = 0;
00085   
00086   <font class="keyword">virtual</font> <font class="keywordtype">void</font>       <a class="code" href="class_i_d3___header.html#a8">Render</a>(<a class="code" href="class_i_d3___writer.html">ID3_Writer</a>&amp;) <font class="keyword">const</font> = 0;
00087   <font class="keyword">virtual</font> <font class="keywordtype">bool</font>       <a class="code" href="class_i_d3___header.html#a9">Parse</a>(<a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp;) = 0;
00088 
<a name="l00089"></a><a class="code" href="class_i_d3___header.html#a10">00089</a>   <a class="code" href="class_i_d3___header.html">ID3_Header</a> &amp;<a class="code" href="class_i_d3___header.html#a10">operator=</a>( <font class="keyword">const</font> <a class="code" href="class_i_d3___header.html">ID3_Header</a> &amp;rhs)
00090   { 
00091     <font class="keywordflow">if</font> (<font class="keyword">this</font> != &amp;rhs)
00092     { 
00093       this-&gt;<a class="code" href="class_i_d3___header.html#a2">SetSpec</a>(rhs.<a class="code" href="class_i_d3___header.html#a3">GetSpec</a>());
00094       this-&gt;<a class="code" href="class_i_d3___header.html#a4">SetDataSize</a>(rhs.<a class="code" href="class_i_d3___header.html#a3">GetSpec</a>());
00095       this-&gt;<a class="code" href="class_i_d3___header.html#n2">_flags</a> = rhs.<a class="code" href="class_i_d3___header.html#n2">_flags</a>;
00096     }
00097     <font class="keywordflow">return</font> *<font class="keyword">this</font>;
00098   }
00099 
00100 <font class="keyword">protected</font>:
<a name="l00101"></a><a class="code" href="class_i_d3___header.html#n0">00101</a>   <a class="code" href="globals_8h.html#a216">ID3_V2Spec</a>      <a class="code" href="class_i_d3___header.html#n0">_spec</a>;             <font class="comment">// which version of the spec </font>
<a name="l00102"></a><a class="code" href="class_i_d3___header.html#n1">00102</a>   size_t          <a class="code" href="class_i_d3___header.html#n1">_data_size</a>;        <font class="comment">// how big is the data?</font>
<a name="l00103"></a><a class="code" href="class_i_d3___header.html#n2">00103</a>   <a class="code" href="class_i_d3___flags.html">ID3_Flags</a>       <a class="code" href="class_i_d3___header.html#n2">_flags</a>;            <font class="comment">// header flags</font>
<a name="l00104"></a><a class="code" href="class_i_d3___header.html#n3">00104</a>   <font class="keyword">const</font> Info*     <a class="code" href="class_i_d3___header.html#n3">_info</a>;             <font class="comment">// header info w.r.t. id3v2 spec</font>
<a name="l00105"></a><a class="code" href="class_i_d3___header.html#n4">00105</a>   <font class="keywordtype">bool</font>            <a class="code" href="class_i_d3___header.html#n4">_changed</a>;          <font class="comment">// has the header changed since parsing</font>
00106 }
00107 ;
00108 
00109 <font class="preprocessor">#endif </font><font class="comment">/* _ID3LIB_HEADER_H */</font>
</pre></div><hr><address><small>Generated on Thu Jan 3 07:35:55 2002 for id3lib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.12 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>