Changeset 2476 in Sophya for trunk/SophyaLib/BaseTools/ppfbinstream.h
- Timestamp:
- Dec 5, 2003, 12:02:27 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/ppfbinstream.h
r2475 r2476 55 55 }; 56 56 57 PPFBinaryIOStream() ;58 virtual ~PPFBinaryIOStream() ;57 PPFBinaryIOStream() { } 58 virtual ~PPFBinaryIOStream() { } 59 59 int Version() {return version;} // PIn/OutPersist version number 60 string FileName() { return filename; } // Retourne le nom de fichier61 60 62 61 protected: 63 62 64 63 map<string, int_8> tags; 65 string filename;66 64 int version; // PPersist(In/Out) version 67 65 }; … … 71 69 class PPFBinaryInputStream : public PPFBinaryIOStream { 72 70 public: 73 PPFBinaryInputStream( );71 PPFBinaryInputStream(RawInOutStream * is, bool ad, bool scan=false); 74 72 PPFBinaryInputStream(string const& flnm, bool scan=true); 75 73 virtual ~PPFBinaryInputStream(); 74 75 inline string FileName() { return s->getFileName(); } // Retourne le nom de fichier 76 76 77 77 // Gestion des tags … … 85 85 // Saut jusqu'au prochain objet 86 86 bool SkipToNextObject(); 87 // Saut d'un item de base (tag+donnees correspondantes) 88 bool SkipItem(); 87 // Saut d'un item de base (tag+donnees correspondantes), le suivant ds le flot 88 bool SkipNextItem(); 89 // Lecture du tag de type next item + infos correspondantes 90 // Le stream est re-positionne avant le tag 91 char NextItemTag(short datasz, size_t sz); 89 92 90 93 // Lecture donnees de base et tableaux de donnees de base … … 157 160 158 161 protected: 162 void Init(bool scan); 163 void ReadNameTagTableV2(); 164 void ReadNameTagTable(); 165 166 void SkipItem(bool fgrdi, char itag); 167 159 168 void CheckTag (short datasz, short datatype); 160 169 void CheckArrayTag(short datasz, size_t sz, short datatype); … … 168 177 void GetRawU8 (uint_8&); 169 178 170 void Scan();171 172 179 RawInOutStream* s; 180 bool _ads; // delete/close the stream at the end 173 181 174 182 bool bigEndian; … … 181 189 class PPFBinaryOutputStream : public PPFBinaryIOStream { 182 190 public: 183 PPFBinaryOutputStream( );191 PPFBinaryOutputStream(RawInOutStream* os, bool ad, int endianness = PPS_NATIVE); 184 192 PPFBinaryOutputStream(string const& flnm, int endianness = PPS_NATIVE); 185 193 virtual ~PPFBinaryOutputStream(); 194 195 inline string FileName() { return s->getFileName(); } // Retourne le nom de fichier 186 196 187 197 // Ecriture de tags … … 253 263 254 264 protected: 255 RawInOutStream* s; 256 bool bigEndian; 257 265 void Init(int endianness); 266 void WriteNameTagTable(); 267 void WriteNameTagTableV2(); 268 258 269 void PutArrayTag(short datasz, size_t sz, short datatype); 259 270 void PutRawByte (char); … … 264 275 void PutRawU8 (uint_8); 265 276 void PutRawBytes(void const* ptr, size_t bytes); 266 277 278 // Attributs, variables 279 RawInOutStream* s; 280 bool _ads; // delete/close the stream at the end 281 282 bool bigEndian; 283 267 284 }; 268 285
Note:
See TracChangeset
for help on using the changeset viewer.