ROOT logo
// @(#)root/base:$Id$
// Author: Rene Brun   15/11/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TStringLong                                                          //
//                                                                      //
// ATTENTION: this class is obsolete. It's functionality has been taken //
// over by TString.                                                     //
//                                                                      //
// The long string class (unlimited number of chars in I/O).            //
//                                                                      //
// This class redefines only the I/O member functions of TString.       //
// It uses 4 bytes to store the string length (1 byte only for TString).//
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TStringLong.h"
#include "TBuffer.h"
#include "Bytes.h"

ClassImp(TStringLong)


//______________________________________________________________________________
TStringLong::TStringLong() : TString()
{
   //constructor
}

//______________________________________________________________________________
TStringLong::TStringLong(Ssiz_t ic) : TString(ic)
{
   //constructor
}

//______________________________________________________________________________
TStringLong::TStringLong(const TString& s) : TString(s)
{
   //copy constructor
}

//______________________________________________________________________________
TStringLong::TStringLong(const char* cs) : TString(cs)
{
   //copy constructor
}

//______________________________________________________________________________
TStringLong::TStringLong(const char* cs, Ssiz_t n) : TString(cs,n)
{
   //constructor from a char*
}

//______________________________________________________________________________
TStringLong::TStringLong(char c) : TString(c)
{
   //constructor from a char
}

//______________________________________________________________________________
TStringLong::TStringLong(char c, Ssiz_t n) : TString(c,n)
{
   //constructor from a char
}

//______________________________________________________________________________
TStringLong::TStringLong(const TSubString& substr) : TString(substr)
{
   //constructor from a substring
}

//______________________________________________________________________________
TStringLong::~TStringLong()
{
   //destructor
}

//______________________________________________________________________________
void TStringLong::FillBuffer(char *&buffer) const
{
   // Fill buffer.

   Int_t nchars = Length();
   tobuf(buffer, nchars);
   const char *data = GetPointer();
   for (Int_t i = 0; i < nchars; i++) buffer[i] = data[i];
   buffer += nchars;
}

//______________________________________________________________________________
void TStringLong::ReadBuffer(char *&buffer)
{
   // Read this string from the buffer.
   
   UnLink();
   Zero();

   Int_t nchars;
   frombuf(buffer, &nchars);

   char *data = Init(nchars, nchars);

   for (Int_t i = 0; i < nchars; i++) frombuf(buffer, &data[i]);
}

//______________________________________________________________________________
Int_t TStringLong::Sizeof() const
{
   // Return the sizeof the string.

   return Length()+sizeof(Int_t);
}

//_______________________________________________________________________
void TStringLong::Streamer(TBuffer &b)
{
   // Stream a long (>255 characters) string object.

   Int_t nwh;
   if (b.IsReading()) {
      b >> nwh;
      Clobber(nwh);
      char *data = GetPointer();
      data[nwh] = 0;
      SetSize(nwh);
      for (int i = 0; i < nwh; i++) b >> data[i];
   } else {
      nwh = Length();
      b << nwh;
      const char *data = GetPointer();
      for (int i = 0; i < nwh; i++) b << data[i];
   }
}
 TStringLong.cxx:1
 TStringLong.cxx:2
 TStringLong.cxx:3
 TStringLong.cxx:4
 TStringLong.cxx:5
 TStringLong.cxx:6
 TStringLong.cxx:7
 TStringLong.cxx:8
 TStringLong.cxx:9
 TStringLong.cxx:10
 TStringLong.cxx:11
 TStringLong.cxx:12
 TStringLong.cxx:13
 TStringLong.cxx:14
 TStringLong.cxx:15
 TStringLong.cxx:16
 TStringLong.cxx:17
 TStringLong.cxx:18
 TStringLong.cxx:19
 TStringLong.cxx:20
 TStringLong.cxx:21
 TStringLong.cxx:22
 TStringLong.cxx:23
 TStringLong.cxx:24
 TStringLong.cxx:25
 TStringLong.cxx:26
 TStringLong.cxx:27
 TStringLong.cxx:28
 TStringLong.cxx:29
 TStringLong.cxx:30
 TStringLong.cxx:31
 TStringLong.cxx:32
 TStringLong.cxx:33
 TStringLong.cxx:34
 TStringLong.cxx:35
 TStringLong.cxx:36
 TStringLong.cxx:37
 TStringLong.cxx:38
 TStringLong.cxx:39
 TStringLong.cxx:40
 TStringLong.cxx:41
 TStringLong.cxx:42
 TStringLong.cxx:43
 TStringLong.cxx:44
 TStringLong.cxx:45
 TStringLong.cxx:46
 TStringLong.cxx:47
 TStringLong.cxx:48
 TStringLong.cxx:49
 TStringLong.cxx:50
 TStringLong.cxx:51
 TStringLong.cxx:52
 TStringLong.cxx:53
 TStringLong.cxx:54
 TStringLong.cxx:55
 TStringLong.cxx:56
 TStringLong.cxx:57
 TStringLong.cxx:58
 TStringLong.cxx:59
 TStringLong.cxx:60
 TStringLong.cxx:61
 TStringLong.cxx:62
 TStringLong.cxx:63
 TStringLong.cxx:64
 TStringLong.cxx:65
 TStringLong.cxx:66
 TStringLong.cxx:67
 TStringLong.cxx:68
 TStringLong.cxx:69
 TStringLong.cxx:70
 TStringLong.cxx:71
 TStringLong.cxx:72
 TStringLong.cxx:73
 TStringLong.cxx:74
 TStringLong.cxx:75
 TStringLong.cxx:76
 TStringLong.cxx:77
 TStringLong.cxx:78
 TStringLong.cxx:79
 TStringLong.cxx:80
 TStringLong.cxx:81
 TStringLong.cxx:82
 TStringLong.cxx:83
 TStringLong.cxx:84
 TStringLong.cxx:85
 TStringLong.cxx:86
 TStringLong.cxx:87
 TStringLong.cxx:88
 TStringLong.cxx:89
 TStringLong.cxx:90
 TStringLong.cxx:91
 TStringLong.cxx:92
 TStringLong.cxx:93
 TStringLong.cxx:94
 TStringLong.cxx:95
 TStringLong.cxx:96
 TStringLong.cxx:97
 TStringLong.cxx:98
 TStringLong.cxx:99
 TStringLong.cxx:100
 TStringLong.cxx:101
 TStringLong.cxx:102
 TStringLong.cxx:103
 TStringLong.cxx:104
 TStringLong.cxx:105
 TStringLong.cxx:106
 TStringLong.cxx:107
 TStringLong.cxx:108
 TStringLong.cxx:109
 TStringLong.cxx:110
 TStringLong.cxx:111
 TStringLong.cxx:112
 TStringLong.cxx:113
 TStringLong.cxx:114
 TStringLong.cxx:115
 TStringLong.cxx:116
 TStringLong.cxx:117
 TStringLong.cxx:118
 TStringLong.cxx:119
 TStringLong.cxx:120
 TStringLong.cxx:121
 TStringLong.cxx:122
 TStringLong.cxx:123
 TStringLong.cxx:124
 TStringLong.cxx:125
 TStringLong.cxx:126
 TStringLong.cxx:127
 TStringLong.cxx:128
 TStringLong.cxx:129
 TStringLong.cxx:130
 TStringLong.cxx:131
 TStringLong.cxx:132
 TStringLong.cxx:133
 TStringLong.cxx:134
 TStringLong.cxx:135
 TStringLong.cxx:136
 TStringLong.cxx:137
 TStringLong.cxx:138
 TStringLong.cxx:139
 TStringLong.cxx:140
 TStringLong.cxx:141
 TStringLong.cxx:142