Changeset 2481 in Sophya for trunk/SophyaLib/BaseTools


Ignore:
Timestamp:
Dec 9, 2003, 9:29:45 AM (22 years ago)
Author:
ansari
Message:

Corrections bugs ds PPFStream::Write/ReadPositionTag() - Reza 9 Dec 2003

Location:
trunk/SophyaLib/BaseTools
Files:
2 edited

Legend:

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

    r2477 r2481  
    202202  int_8 pos;
    203203  GetRawI8(pos);
    204   GetTypeTag(ppstype);
     204  GetRawUByte(ppstype);
    205205  if (ppstype != PPS_EOF)
    206206    throw FileFormatExc("PPFBinaryInputStream::ReadNameTagTable()  Corrupted file, no EOF tag at end of file");
     
    208208  // On se positionne au debut du NameTagTable
    209209  s->seekg(pos);
    210   GetTypeTag(ppstype);
     210  GetRawUByte(ppstype);
    211211  if (ppstype != PPS_NAMETAG_TABLE)
    212212    throw FileFormatExc("PPFBinaryInputStream::ReadNameTagTable()  Corrupted file PPS_NAMETAG_TABLE not found");
     
    242242  s->seekg(-(sizeof(int_8)+1), ios::end);
    243243
    244   GetTypeTag(ppstype);
     244  GetRawUByte(ppstype);
    245245  if (ppstype != PPS_EOF)
    246246    throw FileFormatExc("PPFBinaryInputStream::ReadNameTagTableV2() Corrupted file, no eof entry at end of file");
     
    256256  s->seekg(pos);
    257257  while (true) {
    258     GetTypeTag(ppstype);
     258    GetRawUByte(ppstype);
    259259    if (ppstype == PPS_EOF) break;
    260260   
     
    280280{
    281281  s->seekg(pos);
     282  unsigned char ppstag;
     283  GetRawUByte(ppstag);
     284  if (ppstag != PPS_POSTAG_MARK)
     285    throw FileFormatExc("PPFBinaryInputStream::GotoPositionTag() - PPS_POSTAG_MARK not found!");   
    282286  int_8 tpos;
    283287  GetRawI8(tpos);
     
    411415      GetRawU8(ui8);
    412416      datasz = dsize;
    413       asz = i8;     
     417      asz = ui8;     
    414418      break;
    415419    }
     
    12971301  tagpos = s->tellp();
    12981302  PutRawByte(PPS_POSTAG_MARK);
    1299   PutI8(tagpos);
     1303  PutRawI8(tagpos);
    13001304  _nbpostag++;  // Compteur de nombre de tags
    13011305  return(tagpos);
  • trunk/SophyaLib/BaseTools/ppfnametag.h

    r2462 r2481  
    1414class PPFNameTag {
    1515public:
     16  PPFNameTag(PPFNameTag const & ptn) { _tname = ptn._tname; }
    1617  PPFNameTag(string const & tn) { _tname = tn; }
    1718  PPFNameTag(const char * tn) { _tname = tn; }
    1819  ~PPFNameTag() { }
    19   inline bool GotoNameTag(PInPersist& pi)
     20  inline bool GotoNameTag(PInPersist& pi) const
    2021  { return pi.GotoNameTag(_tname); }
    21   inline void WriteTag(POutPersist& po)
     22  inline void WriteTag(POutPersist& po) const
    2223  { return po.WriteNameTag(_tname); }
    2324  inline char*  operator= (char* s) { _tname = s; return s; }
     
    2829};
    2930
    30 inline PInPersist& operator >> (PInPersist& si, PPFNameTag & pnt)
     31inline PInPersist& operator >> (PInPersist& si, PPFNameTag const & pnt)
    3132{ pnt.GotoNameTag(si); return(si); }
    3233
    33 inline POutPersist& operator >> (POutPersist& so, PPFNameTag & pnt)
     34inline POutPersist& operator << (POutPersist& so, PPFNameTag const & pnt)
    3435{ pnt.WriteTag(so); return(so); }
    3536
Note: See TracChangeset for help on using the changeset viewer.