70 virtual int Len()
const=0;
71 virtual char GetCh()=0;
73 virtual int GetBf(
const void* Bf,
const TSize& BfL)=0;
83 void* Bf=(
void*)
new char[BfL];
Cs+=
GetBf(Bf, BfL);
return Bf;}
96 void Load(
char*& CStr,
const int& MxCStrLen,
const int& CStrLen){
97 CStr=
new char[MxCStrLen+1];
Cs+=
GetBf(CStr, CStrLen+1);}
98 void Load(
char*& CStr);
123 Val.
Load(SIn);
return SIn;
131 int UpdateLnLen(
const int& StrLen,
const bool& ForceInLn=
false);
143 virtual int PutCh(
const char& Ch)=0;
144 virtual int PutBf(
const void* LBf,
const TSize& LBfL)=0;
145 virtual void Flush()=0;
149 int PutCh(
const char& Ch,
const int& Chs);
151 int PutInt(
const int& Int);
152 int PutInt(
const int& Int,
const char* FmtStr);
155 int PutFlt(
const double& Flt);
156 int PutFlt(
const double& Flt,
const char* FmtStr);
157 int PutStr(
const char* CStr);
159 int PutStr(
const TStr& Str,
const char* FmtStr);
160 int PutStr(
const TStr& Str,
const bool& ForceInLn=
false);
166 int PutLn(
const int& Lns=1);
168 int PutSep(
const int& NextStrLen=0);
186 void Save(
const char* CStr);
215 Val.
Save(SOut);
return SOut;
228 virtual void SetPos(
const int& Pos)=0;
229 virtual void MovePos(
const int& DPos)=0;
230 virtual int GetPos()
const=0;
232 virtual void Clr()=0;
248 bool Eof(){
return feof(stdin)!=0;}
249 int Len()
const {
return -1;}
250 char GetCh(){
return char(getchar());}
252 int Ch=getchar(); ungetc(Ch, stdin);
return char(Ch);}
253 int GetBf(
const void* LBf,
const TSize& LBfL);
268 int PutCh(
const char& Ch){putchar(Ch);
return Ch;}
269 int PutBf(
const void *LBf,
const TSize& LBfL);
282 void SetFPos(
const int& FPos)
const;
286 int FindEol(
int& BfN,
bool& CrEnd);
293 TFIn(
const TStr& FNm,
bool& OpenedP);
304 else {
return Bf[
BfC++];}}
307 else {
return Bf[
BfC];}}
308 int GetBf(
const void* LBf,
const TSize& LBfL);
332 TFOut(
const TStr& _FNm,
const bool& Append=
false);
333 TFOut(
const TStr& _FNm,
const bool& Append,
bool& OpenedP);
334 static PSOut
New(
const TStr& FNm,
const bool& Append=
false);
335 static PSOut
New(
const TStr& FNm,
const bool& Append,
bool& OpenedP);
338 int PutCh(
const char& Ch);
339 int PutBf(
const void* LBf,
const TSize& LBfL);
358 static PSInOut
New(
const TStr& FNm,
const TFAccess& FAccess,
const bool& CreateIfNo);
368 int GetBf(
const void* LBf,
const TSize& LBfL);
378 int PutBf(
const void* LBf,
const TSize& LBfL);
396 TMIn(
const void* _Bf,
const uint64& _BfL,
const bool& TakeBf=
false);
398 TMIn(
const char* CStr);
400 TMIn(
const TStr& Str,
bool FromFile);
402 static PSIn New(
const void* _Bf,
const uint64& _BfL,
const bool& TakeBf=
false);
403 static PSIn New(
const char* CStr);
415 int GetBf(
const void* LBf,
const TSize& LBfL);
447 void Resize(
const int& ReqLen = -1);
452 TMOut(
const int& _MxBfL=1024);
455 TMOut(
char* _Bf,
const int& _MxBfL);
460 int PutBf(
const void* LBf,
const TSize& LBfL);
469 void CutBf(
const int& CutBfL);
470 PSIn GetSIn(
const bool& IsCut=
true,
const int& CutBfL=-1);
526 TFRnd& operator=(const TFRnd&);
529 const
bool& CreateIfNo=true, const
int& _HdLen=-1, const
int& _RecLen=-1);
531 const
TFAccess& FAccess, const
bool& CreateIfNo=true,
532 const
int& HdLen=-1, const
int& RecLen=-1){
533 return new TFRnd(FNm, FAccess, CreateIfNo, HdLen, RecLen);}
538 HdLen=_HdLen; RecLen=_RecLen; RecAct=(HdLen>=0)&&(RecLen>0);}
540 void SetFPos(
const int& FPos);
541 void MoveFPos(
const int& DFPos);
545 bool Eof(){
return GetFPos()==GetFLen();}
547 void SetRecN(
const int& RecN);
551 void GetBf(
void* Bf,
const TSize& BfL);
552 void PutBf(
const void* Bf,
const TSize& BfL);
556 int FPos=GetFPos(); SetFPos(0); GetBf(Hd, HdLen); SetFPos(FPos);}
558 int FPos=GetFPos(); SetFPos(0); PutBf(Hd, HdLen); SetFPos(FPos);}
559 void GetRec(
void* Rec,
const int& RecN=-1){
560 IAssert(RecAct);
if (RecN!=-1){SetRecN(RecN);} GetBf(Rec, RecLen);}
561 void PutRec(
const void* Rec,
const int& RecN=-1){
562 IAssert(RecAct);
if (RecN!=-1){SetRecN(RecN);} PutBf(Rec, RecLen);}
566 void PutCh(
const char& Ch){PutBf(&Ch,
sizeof(Ch));}
567 void PutCh(
const char& Ch,
const int& Chs);
568 char GetCh(){
char Ch; GetBf(&Ch,
sizeof(Ch));
return Ch;}
571 void PutInt(
const int& Int){PutBf(&Int,
sizeof(Int));}
572 int GetInt(){
int Int; GetBf(&Int,
sizeof(Int));
return Int;}
575 void PutStr(
const TStr& Str);
576 TStr GetStr(
const int& StrLen);
577 TStr GetStr(
const int& MxStrLen,
bool& IsOk);
578 void PutSIn(
const PSIn& SIn,
TCs& Cs);
579 PSIn GetSIn(
const int& SInLen,
TCs& Cs);
596 static void Copy(
const TStr& SrcFNm,
const TStr& DstFNm,
597 const bool& ThrowExceptP=
true,
const bool& FailIfExistsP=
false);
598 static void Del(
const TStr& FNm,
const bool& ThrowExceptP=
true);
599 static void DelWc(
const TStr& WcStr,
const bool& RecurseDirP=
false);
int PutMem(const TMem &Mem)
void Save(const uint &UInt)
TCs & operator+=(const TCs &Cs)
int GetBf(const void *LBf, const TSize &LBfL)
static PSOut New(const TStr &FNm, const bool &Append=false)
TSIn & operator>>(bool &Bool)
TFInOut & operator=(const TFIn &)
int PutStrFmtLn(const char *FmtStr,...)
int GetBf(const void *LBf, const TSize &LBfL)
TSIn & operator>>(double &Double)
virtual TSOut & operator()(TSOut &SOut) const =0
virtual int PutCh(const char &Ch)=0
virtual int PutBf(const void *LBf, const TSize &LBfL)=0
static void Rename(const TStr &SrcFNm, const TStr &DstFNm)
static bool Exists(const TStr &FNm)
TSOut & operator<<(const short &Sh)
TSOut & operator<<(TSOut &SOut, const T &Val)
static const TStr GifFExt
void Save(const char *CStr, const TSize &CStrLen)
int PutCh(const char &Ch)
void AppendBf(const void *LBf, const TSize &LBfL)
PSIn GetSIn(const bool &IsCut=true, const int &CutBfL=-1)
int PutBf(const void *LBf, const TSize &LBfL)
TSOut & operator<<(const uint64 &UInt)
void PutInt(const int &Int)
int FindEol(int &BfN, bool &CrEnd)
int PutCh(const char &Ch)
void Save(const void *Bf, const TSize &BfL)
TSIn & operator>>(float &Flt)
TSIn & operator>>(TSIn &SIn, T &Val)
TSIn & operator>>(uint &UInt)
TSOut & operator<<(const int64 &Int)
void PutRec(const void *Rec, const int &RecN=-1)
void CutBf(const int &CutBfL)
TSOut & operator<<(const char &Ch)
void Load(char *&CStr, const int &MxCStrLen, const int &CStrLen)
UndefDefaultCopyAssign(TLnRet)
int PutBf(const void *LBf, const TSize &LBfL)
virtual int GetBf(const void *Bf, const TSize &BfL)=0
static const TStr HtmlFExt
int PutCh(const char &Ch)
static TPt< TSOut > New()
TSOut & operator<<(const double &Double)
int PutBf(const void *LBf, const TSize &LBfL)
void Save(const int64 &Int)
bool GetNextLnBf(TChA &LnChA)
void PutUInt(const uint &UInt)
TSOut & operator<<(const ushort &USh)
int PutSepLn(const int &Lns=0)
int PutLn(const int &Lns=1)
static PSOut New(const int &MxBfL=1024)
TSIn & operator>>(uint64 &UInt)
bool GetNextLnBf(TChA &LnChA)
virtual void SetPos(const int &Pos)=0
int UpdateLnLen(const int &StrLen, const bool &ForceInLn=false)
void SetFastMode(const bool &_FastMode)
#define ClassTP(TNm, PNm)
void PutCs(const TCs &Cs)
static uint64 GetSize(const TStr &FNm)
TFOut & operator=(const TFOut &)
static PSIn New(const TStr &FNm)
void SkipCommentLines()
Move stream pointer along until a non commented line is found.
int GetBf(const void *LBf, const TSize &LBfL)
TMOut & operator=(const TMOut &)
TCs & operator=(const TCs &Cs)
void PutHd(const void *Hd)
static const TStr TxtFExt
static TCs GetCsFromBf(char *Bf, const int &BfL)
static void DelWc(const TStr &WcStr, const bool &RecurseDirP=false)
static TStr GetUniqueFNm(const TStr &FNm)
bool GetNextLnBf(TChA &LnChA)
virtual TFileId GetFileId() const
static const TStr HtmFExt
TFIn & operator=(const TFIn &)
unsigned long long uint64
TSOut & operator=(const TSOut &)
void Save(const uint64 &UInt)
void * LoadNewBf(const int &BfL)
void Save(const double &Flt)
TCs & operator+=(const char &Ch)
int PutBool(const bool &Bool)
TCs & operator+=(const int &Int)
void Save(const PSIn &SIn, const TSize &BfL=-1)
static void Copy(const TStr &SrcFNm, const TStr &DstFNm, const bool &ThrowExceptP=true, const bool &FailIfExistsP=false)
static void Del(const TStr &FNm, const bool &ThrowExceptP=true)
uint64 CountNewLinesInRange(uint64 Lb, uint64 Ub)
Finds number of new line chars in interval [Lb, Ub)
int PutBf(const void *LBf, const TSize &LBfL)
int PutSep(const int &NextStrLen=0)
void SetHdRecLen(const int &_HdLen, const int &_RecLen)
int PutInt(const int &Int)
TSIn & operator>>(short &Sh)
TSOut & operator<<(TSOut &(*FuncPt)(TSOut &))
TSOut & operator<<(const long double &LDouble)
TSIn & operator=(const TSIn &)
void MovePos(const int &DPos)
void SaveBf(const void *Bf, const TSize &BfL)
void PutCh(const char &Ch)
static const TPt< TSOut > StdOut
int FindEol(uint64 &BfN, bool &CrEnd)
TChRet(const PSIn &_SIn, const char &_EofCh=0)
int PutIndent(const int &IndentLev=1)
static PSIn New(const void *_Bf, const uint64 &_BfL, const bool &TakeBf=false)
void Save(const uchar &UCh)
int PutFlt(const double &Flt)
void Save(const bool &Bool)
void Save(const ushort &UShort)
TFileId GetFileId() const
static PSInOut New(const TStr &FNm, const TFAccess &FAccess, const bool &CreateIfNo)
uint64 GetLineEndPos(uint64 Ind)
Finds end of line in which Ind is present.
TSIn & operator>>(int &Int)
TSInOut & operator=(const TSInOut &)
TFileId GetFileId() const
TSOut & operator<<(const uint &Int)
uint64 GetLineStartPos(uint64 Ind)
Finds beginning of line in which Ind is present.
TSOut & operator<<(const TSOutMnp &Mnp)
int PutDosLn(const int &Lns=1)
void GetRec(void *Rec, const int &RecN=-1)
void Save(const short &Short)
virtual void MovePos(const int &DPos)=0
char * GetLine(uint64 Ind)
static const TPt< TSIn > StdIn
TStdOut & operator=(const TStdOut &)
void Save(const ldouble &LFlt)
int GetBf(const void *LBf, const TSize &LBfL)
void Save(const sdouble &SFlt)
void Load(ushort &UShort)
int PutStr(const char *CStr)
TMIn & operator=(const TMIn &)
void LoadBf(const void *Bf, const TSize &BfL)
virtual int GetSize() const =0
TSIn & operator>>(long double &LDouble)
virtual TStr GetSNm() const
TStdIn & operator=(const TStdIn &)
TSOut & operator<<(PSIn &SIn)
int PutCh(const char &Ch)
void SetPos(const int &Pos)
TChRet & operator=(const TChRet &)
TSIn & operator>>(char &Ch)
virtual int GetPos() const =0
static uint64 GetLastWriteTm(const TStr &FNm)
static uint64 GetCreateTm(const TStr &FNm)
TSOut & operator<<(const float &Flt)
void Resize(const int &ReqLen=-1)
void Save(const char &Ch)
char GetCh(const int &ChN) const
virtual bool GetNextLnBf(TChA &LnChA)=0
virtual int Len() const =0
int PutStrLn(const TStr &Str, const bool &ForceInLn=false)
int PutStrFmt(const char *FmtStr,...)
bool operator==(const TCs &Cs) const
void EnableLnTrunc(const int &_MxLnLen)
TSOut & operator<<(const bool &Bool)
int PutUInt(const uint &Int)
void PutUCh(const uchar &UCh)
bool GetNextLnBf(TChA &LnChA)
TStr GetEolnLn(const bool &DoAddEoln, const bool &DoCutBf)
void Save(const int &Int)
TSOut & operator<<(const int &Int)
TSIn & operator>>(int64 &Int)
void SetFPos(const int &FPos) const
TSIn & operator>>(uchar &UCh)
TSOut & operator<<(const uchar &UCh)
static const TStr JarFExt
bool GetNextLn(TStr &LnStr)
static uint64 GetLastAccessTm(const TStr &FNm)
TSIn & operator>>(ushort &USh)