Ignore:
Timestamp:
Dec 5, 2003, 12:02:27 AM (22 years ago)
Author:
ansari
Message:

Debug/correction des ppersist suite a la separation des PInOutPersist en PPFInOutStream - Reza 5 Dec 2003

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/ppfbinstream.h

    r2475 r2476  
    5555  };
    5656 
    57   PPFBinaryIOStream();
    58   virtual ~PPFBinaryIOStream();
     57  PPFBinaryIOStream() { }
     58  virtual ~PPFBinaryIOStream() { }
    5959  int    Version() {return version;}  // PIn/OutPersist version number
    60   string FileName() { return filename; }   // Retourne le nom de fichier
    6160 
    6261protected:
    6362 
    6463  map<string, int_8> tags;
    65   string filename;
    6664  int version;     // PPersist(In/Out) version
    6765};
     
    7169class PPFBinaryInputStream : public PPFBinaryIOStream {
    7270public:
    73   PPFBinaryInputStream();
     71  PPFBinaryInputStream(RawInOutStream * is, bool ad, bool scan=false);
    7472  PPFBinaryInputStream(string const& flnm, bool scan=true);
    7573  virtual  ~PPFBinaryInputStream();
     74
     75  inline string FileName() { return s->getFileName(); }   // Retourne le nom de fichier
    7676 
    7777  // Gestion des tags
     
    8585  // Saut jusqu'au prochain objet
    8686  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);
    8992 
    9093  // Lecture donnees de base et tableaux de donnees de base
     
    157160 
    158161protected:
     162  void   Init(bool scan);
     163  void   ReadNameTagTableV2();
     164  void   ReadNameTagTable();
     165
     166  void   SkipItem(bool fgrdi, char itag);
     167
    159168  void   CheckTag   (short datasz, short datatype);
    160169  void   CheckArrayTag(short datasz, size_t sz, short datatype);
     
    168177  void   GetRawU8   (uint_8&);
    169178 
    170   void   Scan();
    171  
    172179  RawInOutStream* s;
     180  bool _ads; // delete/close the stream at the end
    173181 
    174182  bool bigEndian;
     
    181189class PPFBinaryOutputStream : public PPFBinaryIOStream {
    182190public:
    183   PPFBinaryOutputStream();
     191  PPFBinaryOutputStream(RawInOutStream* os, bool ad, int endianness = PPS_NATIVE);
    184192  PPFBinaryOutputStream(string const& flnm, int endianness = PPS_NATIVE);
    185193  virtual ~PPFBinaryOutputStream();
     194
     195  inline string FileName() { return s->getFileName(); }   // Retourne le nom de fichier
    186196 
    187197  // Ecriture de tags
     
    253263 
    254264protected:
    255   RawInOutStream* s;
    256   bool bigEndian;
    257  
     265  void     Init(int endianness);
     266  void     WriteNameTagTable();
     267  void     WriteNameTagTableV2();
     268
    258269  void     PutArrayTag(short datasz, size_t sz, short datatype);
    259270  void     PutRawByte (char);
     
    264275  void     PutRawU8   (uint_8);
    265276  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
    267284};
    268285 
Note: See TracChangeset for help on using the changeset viewer.