30 if (
this!=&Ss){CellStrVV=Ss.
CellStrVV;}
return *
this;}
33 TStr& At(
const int& X,
const int& Y);
34 void PutVal(
const int& X,
const int& Y,
const TStr& Str);
35 TStr GetVal(
const int& X,
const int& Y)
const;
39 int GetXLen(
const int& Y)
const;
41 void DelX(
const int& X);
42 void DelY(
const int& Y);
43 int SearchX(
const int& Y,
const TStr& Str)
const;
44 int SearchY(
const int& X,
const TStr& Str)
const;
48 int GetFldX(
const TStr& FldNm,
const TStr& NewFldNm=
"",
const int& Y=0)
const;
49 int GetFldY(
const TStr& FldNm,
const TStr& NewFldNm=
"",
const int& X=0)
const;
55 const PNotify& Notify=NULL,
const bool& IsExcelEoln=
true,
56 const int& MxY=-1,
const TIntV& AllowedColNV=
TIntV(),
const bool& IsQStr=
true);
57 void SaveTxt(
const TStr& FNm,
const PNotify& Notify=NULL)
const;
58 static void LoadTxtFldV(
59 const TSsFmt& SsFmt,
const PSIn& SIn,
char& Ch,
60 TStrV& FldValV,
const bool& IsExcelEoln=
true,
const bool& IsQStr=
true);
63 static TSsFmt GetSsFmtFromStr(
const TStr& SsFmtNm);
64 static TStr GetStrFromSsFmt(
const TSsFmt& SsFmt);
65 static TStr GetSsFmtNmVStr();
92 TSsParser(const
TStr& FNm, const
TSsFmt _SsFmt=
ssfTabSep, const
bool& _SkipLeadBlanks=false, const
bool& _SkipCmt=true, const
bool& _SkipEmptyFld=false);
100 TSsParser(const
TStr& FNm, const
char& Separator, const
bool& _SkipLeadBlanks=false, const
bool& _SkipCmt=true, const
bool& _SkipEmptyFld=false);
114 int Len()
const {
return FldV.Len(); }
120 bool IsCmt()
const {
return Len()>0 && GetFld(0)[0] ==
'#'; }
122 bool Eof()
const {
return FInPt->Eof(); }
124 TChA GetLnStr()
const {
TChA LnOut;
for (
int i = 0; i < Len(); i++) { LnOut+=GetFld(i); LnOut+=
' '; }
if (LnOut.
Len() > 0) LnOut.
DelLastCh();
return LnOut; }
129 const char*
GetFld(
const int& FldN)
const {
return FldV[FldN]; }
131 char*
GetFld(
const int& FldN) {
return FldV[FldN]; }
133 const char* operator [] (
const int& FldN)
const {
return FldV[FldN]; }
135 char* operator [] (
const int& FldN) {
return FldV[FldN]; }
138 bool GetInt(
const int& FldN,
int& Val)
const;
141 int Val=0;
IAssertR(GetInt(FldN, Val),
TStr::Fmt(
"Field %d not INT.\n%s", FldN, DumpStr()).CStr());
return Val; }
143 bool IsInt(
const int& FldN)
const {
int v;
return GetInt(FldN, v); }
146 bool GetFlt(
const int& FldN,
double& Val)
const;
148 bool IsFlt(
const int& FldN)
const {
double v;
return GetFlt(FldN, v); }
153 bool GetUInt64(
const int& FldN,
uint64& Val)
const;
159 const char* DumpStr()
const;
#define IAssertR(Cond, Reason)
#define UndefDefaultCopyAssign(TNm)
TChA GetLnStr() const
Returns the current line.
int GetFlds() const
Returns the number of fields in the current line.
const char * GetFld(const int &FldN) const
Returns the contents of the field at index FldN.
double GetFlt(const int &FldN) const
Assumes FldN is a floating point number its value is returned. If FldN is not an integer an exception...
TSsFmt
Spread-Sheet Separator Format.
#define ClassTP(TNm, PNm)
bool IsUInt64(const int &FldN) const
Checks whether fields FldN is unsigned 64-bit integer number.
bool Eof() const
Checks for end of file.
unsigned long long uint64
TStr GetFldNm(const int &FldX) const
Whitespace (space or tab) separated.
int Len() const
Returns the number of fields in the current line.
int GetInt(const int &FldN) const
Assumes FldN is an integer its value is returned. If FldN is not an integer an exception is thrown...
uint64 GetUInt64(const int &FldN) const
Assumes FldN is a 64-bit unsigned integer point number its value is returned. If FldN is not a 64-bit...
static TStr Fmt(const char *FmtStr,...)
uint64 GetLineNo() const
Returns the line number of the current line.
static PSs Load(TSIn &SIn)
char * GetFld(const int &FldN)
Returns the contents of the field at index FldN.
bool IsInt(const int &FldN) const
Checks whether fields FldN is an integer.
bool IsCmt() const
Checks whether the current line is a comment (starts with '#').
Vector is a sequence TVal objects representing an array that can change in size.
TSs & operator=(const TSs &Ss)
bool IsFlt(const int &FldN) const
Checks whether fields FldN is a float.