00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "Marker.h"
00035 #include "Partial.h"
00036 #include "PartialList.h"
00037
00038 #include <string>
00039 #include <vector>
00040
00041
00042 namespace Loris {
00043
00044
00045
00046
00096
00097 class SdifFile
00098 {
00099
00100 public:
00101
00102
00103
00105 typedef std::vector< Marker > markers_type;
00106
00108 typedef PartialList partials_type;
00109
00110
00111
00114 explicit SdifFile( const std::string & filename );
00115
00121 #if !defined(NO_TEMPLATE_MEMBERS)
00122 template<typename Iter>
00123 SdifFile( Iter begin_partials, Iter end_partials );
00124 #else
00125 SdifFile( PartialList::const_iterator begin_partials,
00126 PartialList::const_iterator end_partials );
00127 #endif
00128
00130 SdifFile( void );
00131
00132
00133
00134
00135
00138 markers_type & markers( void );
00139
00142 const markers_type & markers( void ) const;
00143
00146 partials_type & partials( void );
00147
00150 const partials_type & partials( void ) const;
00151
00152
00154 void addPartial( const Loris::Partial & p );
00155
00161 #if !defined(NO_TEMPLATE_MEMBERS)
00162 template<typename Iter>
00163 void addPartials( Iter begin_partials, Iter end_partials );
00164 #else
00165 void addPartials( PartialList::const_iterator begin_partials,
00166 PartialList::const_iterator end_partials );
00167 #endif
00168
00169
00170
00173 void write( const std::string & path );
00174
00178 void write1TRC( const std::string & path );
00179
00180
00181
00191 static void Export( const std::string & filename,
00192 const PartialList & plist,
00193 const bool enhanced = true );
00194
00195 private:
00196
00197 partials_type partials_;
00198 markers_type markers_;
00199
00200 };
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213 #if !defined(NO_TEMPLATE_MEMBERS)
00214 template< typename Iter >
00215 SdifFile::SdifFile( Iter begin_partials, Iter end_partials )
00216 #else
00217 SdifFile::SdifFile( PartialList::const_iterator begin_partials,
00218 PartialList::const_iterator end_partials )
00219 #endif
00220 {
00221 addPartials( begin_partials, end_partials );
00222 }
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233 #if !defined(NO_TEMPLATE_MEMBERS)
00234 template<typename Iter>
00235 void SdifFile::addPartials( Iter begin_partials, Iter end_partials )
00236 #else
00237 void SdifFile::addPartials( PartialList::const_iterator begin_partials,
00238 PartialList::const_iterator end_partials )
00239 #endif
00240 {
00241 partials_.insert( partials_.end(), begin_partials, end_partials );
00242 }
00243
00244 }
00245