32 auto cur = strm.tellg();
33 strm.seekg(0, std::ios::end);
34 auto end = strm.tellg();
42 Error(
"TString::ReadFile",
"file size too large (%lld, max = %d), clamping", fileSize,
MaxSize());
113 if (!strm.good())
break;
142 UInt_t wid = strm.width(0);
145 while ((wid == 0 ||
Length() < (
Int_t)wid) && strm.get(
c).good() &&
146 (hitSpace = isspace(
static_cast<unsigned char>(
c))) == 0) {
180 if (os.tie()) os.tie()->flush();
183 wid = (len < wid) ? wid - len : 0;
185 long flags = os.flags();
186 if (wid && !(flags & std::ios::left))
189 if (wid && (flags & std::ios::left))
193 if (os.flags() & std::ios::unitbuf)
212 if (fgets(buf,
sizeof(buf), fp) ==
nullptr)
break;
215 }
while (!ferror(fp) && !feof(fp) && strchr(buf,
'\n') ==
nullptr);
int Int_t
Signed integer 4 bytes (int).
int Ssiz_t
String size (currently int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
long long Long64_t
Portable signed long integer 8 bytes.
std::ostream & operator<<(std::ostream &os, const TString &s)
Write string to stream.
std::istream & operator>>(std::istream &strm, TString &s)
Read string from stream.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
Bool_t Gets(FILE *fp, Bool_t chop=kTRUE)
Read one line from the stream, including the \n, or until EOF.
std::istream & ReadToDelim(std::istream &str, char delim='\n')
Read up to an EOF, or a delimiting character, whichever comes first.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
static TString * ReadString(TBuffer &b, const TClass *clReq)
Read TString object from buffer.
static Ssiz_t AdjustCapacity(Ssiz_t oldCap, Ssiz_t newCap)
Calculate a nice capacity greater than or equal to newCap.
void Puts(FILE *fp)
Write string to the stream.
static constexpr Ssiz_t MaxSize()
std::istream & ReadFile(std::istream &str)
Replace string with the contents of strm, stopping at an EOF.
Ssiz_t Clobber(Ssiz_t nc)
Clear string and make sure it has a capacity of nc.
std::istream & ReadToken(std::istream &str)
Read a token, delimited by whitespace, from the input stream.
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
Read a line from stream upto newline skipping any whitespace.