|
SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <dt.h>
Public Member Functions | |
| TChA (const int &_MxBfL=256) | |
| TChA (const char *CStr) | |
| TChA (const char *CStr, const int &StrLen) | |
| TChA (const TChA &ChA) | |
| TChA (const TStr &Str) | |
| TChA (const TMem &Mem) | |
| ~TChA () | |
| TChA (TSIn &SIn) | |
| void | Load (TSIn &SIn) |
| void | Save (TSOut &SOut, const bool &SaveCompact=true) const |
| void | LoadXml (const PXmlTok &XmlTok, const TStr &Nm) |
| void | SaveXml (TSOut &SOut, const TStr &Nm) const |
| TChA & | operator= (const TChA &ChA) |
| TChA & | operator= (const TStr &Str) |
| TChA & | operator= (const char *CStr) |
| bool | operator== (const TChA &ChA) const |
| bool | operator== (const char *_CStr) const |
| bool | operator== (const char &Ch) const |
| bool | operator!= (const TChA &ChA) const |
| bool | operator!= (const char *_CStr) const |
| bool | operator!= (const char &Ch) const |
| bool | operator< (const TChA &ChA) const |
| TChA & | operator+= (const TMem &Mem) |
| TChA & | operator+= (const TChA &ChA) |
| TChA & | operator+= (const TStr &Str) |
| TChA & | operator+= (const char *CStr) |
| TChA & | operator+= (const char &Ch) |
| char | operator[] (const int &ChN) const |
| char & | operator[] (const int &ChN) |
| int | GetMemUsed () const |
| char * | operator() () |
| const char * | operator() () const |
| char * | CStr () |
| const char * | CStr () const |
| void | Clr () |
| int | Len () const |
| bool | Empty () const |
| void | Ins (const int &BChN, const char *CStr) |
| void | Del (const int &ChN) |
| void | DelLastCh () |
| void | Push (const char &Ch) |
| char | Pop () |
| void | Trunc () |
| void | Trunc (const int &_BfL) |
| void | Reverse () |
| void | AddCh (const char &Ch, const int &MxLen=-1) |
| void | AddChTo (const char &Ch, const int &ToChN) |
| void | PutCh (const int &ChN, const char &Ch) |
| char | GetCh (const int &ChN) const |
| char | LastCh () const |
| char | LastLastCh () const |
| TChA | GetSubStr (const int &BChN, const int &EChN) const |
| int | CountCh (const char &Ch, const int &BChN=0) const |
| int | SearchCh (const char &Ch, const int &BChN=0) const |
| int | SearchChBack (const char &Ch, int BChN=-1) const |
| int | SearchStr (const TChA &Str, const int &BChN=0) const |
| int | SearchStr (const TStr &Str, const int &BChN=0) const |
| int | SearchStr (const char *CStr, const int &BChN=0) const |
| bool | IsStrIn (const TStr &Str) const |
| bool | IsPrefix (const char *CStr, const int &BChN=0) const |
| bool | IsPrefix (const TStr &Str) const |
| bool | IsPrefix (const TChA &Str) const |
| bool | IsSuffix (const char *CStr) const |
| bool | IsSuffix (const TStr &Str) const |
| bool | IsSuffix (const TChA &Str) const |
| bool | IsChIn (const char &Ch) const |
| void | ChangeCh (const char &SrcCh, const char &DstCh) |
| TChA & | ToUc () |
| TChA & | ToLc () |
| TChA & | ToTrunc () |
| void | CompressWs () |
| void | Swap (const int &ChN1, const int &ChN2) |
| void | Swap (TChA &ChA) |
| int | GetPrimHashCd () const |
| int | GetSecHashCd () const |
| void | SaveTxt (const PSOut &SOut) const |
Static Public Member Functions | |
| static void | LoadTxt (const PSIn &SIn, TChA &ChA) |
Private Member Functions | |
| void | Resize (const int &_MxBfL) |
Private Attributes | |
| int | MxBfL |
| int | BfL |
| char * | Bf |
| TChA::TChA | ( | const int & | _MxBfL = 256 | ) | [inline, explicit] |
| TChA::TChA | ( | const char * | CStr | ) | [inline] |
| TChA::TChA | ( | const char * | CStr, |
| const int & | StrLen | ||
| ) | [inline] |
| TChA::TChA | ( | const TChA & | ChA | ) | [inline] |
| TChA::TChA | ( | const TStr & | Str | ) |
| TChA::TChA | ( | const TMem & | Mem | ) | [inline] |
| TChA::~TChA | ( | ) | [inline] |
| TChA::TChA | ( | TSIn & | SIn | ) | [inline, explicit] |
| void TChA::AddCh | ( | const char & | Ch, |
| const int & | MxLen = -1 |
||
| ) | [inline] |
Definition at line 268 of file dt.h.
References BfL, and operator+=().
Referenced by AddChTo(), TJsonVal::AddEscapeChAFromStr(), TStrUtil::GetCleanStr(), TStrUtil::GetCleanWrdStr(), THtmlLx::GetEscCh(), TSIn::GetNextLn(), TStrUtil::GetNormalizedUrl(), TILx::GetStrToCh(), TILx::GetStrToEoln(), TILx::GetStrToEolnAndCh(), TILx::GetStrToEolnOrCh(), THtmlLx::GetSym(), TILx::GetSym(), THtmlLx::GetTag(), TLxChDef::GetUcStr(), THttpRq::ParseSearch(), and TStrUtil::RemoveHtmlTags().
{
if ((MxLen==-1)||(BfL<MxLen)){operator+=(Ch);}}


| void TChA::AddChTo | ( | const char & | Ch, |
| const int & | ToChN | ||
| ) | [inline] |
| void TChA::ChangeCh | ( | const char & | SrcCh, |
| const char & | DstCh | ||
| ) |
| void TChA::Clr | ( | ) | [inline] |
Definition at line 255 of file dt.h.
Referenced by TSsParser::DumpStr(), TXmlLx::GetAttList(), TXmlLx::GetCDSect(), TXmlLx::GetComment(), TSecTm::GetDtTmFromDmyStr(), TSecTm::GetDtTmFromHmsStr(), TSecTm::GetDtTmFromMdyHmsPmStr(), TSecTm::GetDtTmFromMdyStr(), TSecTm::GetDtTmFromYmdHmsStr(), TXmlLx::GetElement(), THtmlLx::GetEscCh(), TUrlLx::GetHost(), TUrlLx::GetHPath(), TILx::GetLnV(), TSIn::GetNextLn(), TXmlLx::GetNotation(), TXmlLx::GetPI(), TXmlParser::GetPlainStrFromXmlStr(), TILx::GetStrToCh(), TILx::GetStrToEoln(), TILx::GetStrToEolnAndCh(), TILx::GetStrToEolnOrCh(), THtmlLx::GetSym(), TXmlLx::GetSym(), TILx::GetSym(), TXmlParser::GetSym(), THtmlLx::GetTag(), TTm::GetTmFromWebLogDateTimeStr(), TTm::GetTmFromWebLogTimeStr(), TXmlLx::GetWs(), TStrUtil::GetXmlTagNmVal2(), TSs::LoadTxt(), TSs::LoadTxtFldV(), TSsParser::Next(), THttpRq::ParseSearch(), TUniChDb::TUcdFileReader::ReadNextLine(), TStrUtil::RemoveHtmlTags(), THtmlDoc::SaveHtmlToXml(), and Trunc().

| void TChA::CompressWs | ( | ) |
Definition at line 563 of file dt.cpp.
References GetCh(), TCh::IsWs(), Len(), PutCh(), and Trunc().
{
int StrLen=Len(); int SrcChN=0; int DstChN=0;
while ((SrcChN<StrLen)&&TCh::IsWs(GetCh(SrcChN))){SrcChN++;}
while (SrcChN<StrLen){
if ((TCh::IsWs(GetCh(SrcChN)))&&(DstChN>0)&&(TCh::IsWs(GetCh(DstChN-1)))){
SrcChN++;
} else {
PutCh(DstChN, GetCh(SrcChN)); SrcChN++; DstChN++;
}
}
if ((DstChN>0)&&(TCh::IsWs(GetCh(DstChN-1)))){DstChN--;}
Trunc(DstChN);
}

| int TChA::CountCh | ( | const char & | Ch, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 444 of file dt.cpp.
References Bf, TInt::GetMx(), and Len().
{
int ChN=TInt::GetMx(BChN, 0);
const int ThisLen=Len();
int Cnt = 0;
while (ChN<ThisLen){if (Bf[ChN]==Ch){ Cnt++;} ChN++;}
return Cnt;
}

| char* TChA::CStr | ( | ) | [inline] |
Definition at line 252 of file dt.h.
References Bf.
Referenced by TStrHash< TDat, TStringPool, THashFunc >::AddDat(), TStrHash< TDat, TStringPool, THashFunc >::AddDatId(), TStrHash< TDat, TStringPool, THashFunc >::AddKey(), TStrUtil::CountWords(), TSsParser::DumpStr(), TCodecWrapper< TCodecImpl_ >::FromUnicode(), TStrUtil::GetCleanStr(), TStrUtil::GetCleanWrdStr(), TStrHash< TDat, TStringPool, THashFunc >::GetDat(), TSecTm::GetDtTmFromStr(), GetNthOccurence(), TXmlParser::GetPlainStrFromXmlStr(), GetPrimHashCd(), GetSecHashCd(), GetSubStr(), TILx::GetSym(), TXmlParser::GetSym(), TXmlParser::GetTag(), TXmlParser::GetTagVal(), TStrUtil::GetXmlTagNmVal2(), TStrHash< TDat, TStringPool, THashFunc >::IsKey(), TStrHash< TDat, TStringPool, THashFunc >::IsKeyGetDat(), IsPrefix(), IsSuffix(), LoadTxt(), TSsParser::Next(), operator!=(), TWChA::operator+=(), operator+=(), operator<(), TCon::operator<<(), TWChA::operator=(), operator=(), TStr::operator=(), operator==(), TSOut::PutStr(), TStrUtil::RemoveHtmlTags(), THtmlDoc::SaveHtmlToXml(), SaveTxt(), SearchStr(), TStrUtil::SplitLines(), TStrUtil::SplitOnCh(), TStrUtil::SplitSentences(), TStrUtil::SplitWords(), TChA(), TMd5Sig::TMd5Sig(), TMIn::TMIn(), TStr::TStr(), TWChA::TWChA(), and T8BitCodec< TEncoding_ISO8859_3 >::UniToStr().
{return Bf;}

| const char* TChA::CStr | ( | ) | const [inline] |
| void TChA::Del | ( | const int & | ChN | ) |
| void TChA::DelLastCh | ( | ) | [inline] |
| bool TChA::Empty | ( | ) | const [inline] |
Definition at line 257 of file dt.h.
References BfL.
Referenced by THtmlLx::GetCh(), TXmlLx::GetCh(), TUrl::GetDocStrFromUrlStr(), TILx::GetLnV(), TSIn::GetNextLn(), TStrUtil::GetNormalizedUrl(), TWebPg::GetOutDescUrlStrKdV(), TXmlLx::GetPlainStrFromXmlStr(), TXmlParser::GetPlainStrFromXmlStr(), TXmlLx::GetReference(), THtmlLx::GetSym(), TXmlLx::GetSymStr(), THttpLx::GetToken(), THtmlDoc::GetTxtLnDoc(), THttpLx::GetUrl(), THttpLx::GetUrlStr(), TSs::LoadTxtFldV(), THtmlLx::PutCh(), and THtmlDoc::SaveHtmlToXml().
{return BfL==0;}

| char TChA::GetCh | ( | const int & | ChN | ) | const [inline] |
Definition at line 274 of file dt.h.
References operator[]().
Referenced by CompressWs(), SearchChBack(), Swap(), ToTrunc(), and Trunc().
{return operator[](ChN);}


| int TChA::GetMemUsed | ( | ) | const [inline] |
| int TChA::GetPrimHashCd | ( | ) | const |
Definition at line 589 of file dt.cpp.
References CStr().
{
return TStrHashF_DJB::GetPrimHashCd(CStr());
}

| int TChA::GetSecHashCd | ( | ) | const |
Definition at line 593 of file dt.cpp.
References CStr().
{
return TStrHashF_DJB::GetSecHashCd(CStr());
}

| TChA TChA::GetSubStr | ( | const int & | BChN, |
| const int & | EChN | ||
| ) | const |
Definition at line 430 of file dt.cpp.
References CStr(), TInt::GetMn(), TInt::GetMx(), TStr::GetNullStr(), Len(), and TChA().
Referenced by TStrUtil::GetDomNm(), TStrUtil::GetDomNm2(), TStrUtil::GetNormalizedUrl(), TStrUtil::GetShorStr(), TStrUtil::GetWebsiteNm(), and TStrUtil::StripEnd().
{
int BChN=TInt::GetMx(_BChN, 0);
int EChN=TInt::GetMn(_EChN, Len()-1);
int Chs=EChN-BChN+1;
if (Chs<=0){return TStr::GetNullStr();}
else if (Chs==Len()){return *this;}
else {
//char* Bf=new char[Chs+1]; strncpy(Bf, CStr()+BChN, Chs); Bf[Chs]=0;
//TStr Str(Bf); delete[] Bf;
//return Str;
return TChA(CStr()+BChN, Chs);
}
}


| void TChA::Ins | ( | const int & | BChN, |
| const char * | CStr | ||
| ) |
Definition at line 389 of file dt.cpp.
References Assert, Bf, BfL, and Resize().
Referenced by TTm::GetTmFromIdStr().
{
Assert((0<=BChN)&&(BChN<=BfL)); //** ali je <= v (BChN<=BfL) upravicen?
int CStrLen=int(strlen(CStr)); Resize(BfL+CStrLen);
memmove(Bf+BChN+CStrLen, Bf+BChN, BfL-BChN+1);
memmove(Bf+BChN, CStr, CStrLen); BfL+=CStrLen;
}


| bool TChA::IsChIn | ( | const char & | Ch | ) | const [inline] |
Definition at line 294 of file dt.h.
References SearchCh().
{return SearchCh(Ch)!=-1;}

| bool TChA::IsPrefix | ( | const char * | CStr, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 481 of file dt.cpp.
References Bf, CStr(), and Len().
Referenced by TStrUtil::GetDomNm(), TStrUtil::GetDomNm2(), TStrUtil::GetNormalizedUrl(), TStrUtil::GetWebsiteNm(), and IsPrefix().
{
if (BChN+(int)strlen(CStr)>Len()){return false;}
const char* B = Bf+BChN;
const char* C = CStr;
while (*C!=0 && *B==*C) {
B++; C++;
}
if (*C==0){return true;}
else {return false;}
}


| bool TChA::IsPrefix | ( | const TStr & | Str | ) | const |
Definition at line 492 of file dt.cpp.
References TStr::CStr(), and IsPrefix().

| bool TChA::IsPrefix | ( | const TChA & | Str | ) | const |
| bool TChA::IsStrIn | ( | const TStr & | Str | ) | const [inline] |
Definition at line 286 of file dt.h.
References SearchStr().
{return SearchStr(Str)!=-1;}

| bool TChA::IsSuffix | ( | const char * | CStr | ) | const |
Definition at line 500 of file dt.cpp.
Referenced by TStrUtil::GetWebsiteNm(), and IsSuffix().
{
if ((int)strlen(CStr) > Len()) { return false; }
const char* E = Bf+Len()-1;
const char* C = CStr+strlen(CStr)-1;
while (C >= CStr && *E==*C) {
E--; C--;
}
if (C+1 == CStr) { return true; }
else { return false; }
}


| bool TChA::IsSuffix | ( | const TStr & | Str | ) | const |
Definition at line 511 of file dt.cpp.
References TStr::CStr(), and IsSuffix().

| bool TChA::IsSuffix | ( | const TChA & | Str | ) | const |
| char TChA::LastCh | ( | ) | const [inline] |
Definition at line 275 of file dt.h.
References Assert, Bf, and BfL.
Referenced by TXmlLx::GetCDSect(), TUStr::GetChTypeStr(), THtmlLx::GetSym(), TXmlLx::GetSym(), TXmlObjSer::GetTagNm(), THtmlDoc::GetTxtLnDoc(), TSs::LoadTxtFldV(), and TXmlLx::ToNrSpacing().

| char TChA::LastLastCh | ( | ) | const [inline] |
| int TChA::Len | ( | ) | const [inline] |
Definition at line 256 of file dt.h.
References BfL.
Referenced by AddChTo(), ChangeCh(), CompressWs(), CountCh(), TUrl::DecodeUrlStr(), TUrlLx::Eof(), THtmlLx::GetAsciiStr(), TXmlLx::GetCDSect(), TUStr::GetChTypeStr(), TStrUtil::GetCleanStr(), TStrUtil::GetCleanWrdStr(), THtmlLxChDef::GetCSZFromWin1250(), THtmlLxChDef::GetCSZFromYuascii(), TStrUtil::GetDomNm(), THtmlLx::GetEscapedStr(), TStr::GetFNmStr(), THtmlLxChDef::GetIsoCeFromYuascii(), THtmlLxChDef::GetLcChA(), TStrUtil::GetShorStr(), GetSubStr(), TXmlLx::GetSym(), TXmlParser::GetSym(), TXmlObjSer::GetTagNm(), TTm::GetTmFromIdStr(), THtmlLxChDef::GetUcChA(), TUrl::GetUrlSearchStr(), TXmlLx::GetUsAsciiStrFromXmlStr(), TStrUtil::GetWebsiteNm(), THtmlLxChDef::GetWin1250FromYuascii(), TXmlDoc::GetXmlStr(), TXmlLx::GetXmlStrFromPlainStr(), IsPrefix(), THttpLx::IsRespStatusLn(), IsSuffix(), TXmlLx::IsTagNm(), TSsParser::Next(), operator+=(), TCon::operator<<(), TUniChDb::TSubcatHelper::ProcessComment(), TSOut::PutStr(), TStrUtil::RemoveHtmlTags(), TSs::SaveTxt(), SaveTxt(), SearchCh(), SearchChBack(), TStrUtil::SplitSentences(), TStrUtil::StripEnd(), TMacro::TMacro(), TMd5Sig::TMd5Sig(), TMIn::TMIn(), TXmlLx::ToNrSpacing(), and ToTrunc().
{return BfL;}

| void TChA::Load | ( | TSIn & | SIn | ) | [inline] |
| void TChA::LoadTxt | ( | const PSIn & | SIn, |
| TChA & | ChA | ||
| ) | [static] |
| void TChA::LoadXml | ( | const PXmlTok & | XmlTok, |
| const TStr & | Nm | ||
| ) |
| bool TChA::operator!= | ( | const TChA & | ChA | ) | const [inline] |
| bool TChA::operator!= | ( | const char * | _CStr | ) | const [inline] |
| bool TChA::operator!= | ( | const char & | Ch | ) | const [inline] |
| char* TChA::operator() | ( | ) | [inline] |
| const char* TChA::operator() | ( | ) | const [inline] |
Definition at line 369 of file dt.cpp.
References Bf, BfL, TMem::GetBf(), TMem::Len(), and Resize().
Referenced by AddCh(), and Push().


| TChA & TChA::operator+= | ( | const char * | CStr | ) |
| TChA& TChA::operator+= | ( | const char & | Ch | ) | [inline] |
| bool TChA::operator< | ( | const TChA & | ChA | ) | const [inline] |
| TChA & TChA::operator= | ( | const char * | CStr | ) |
| bool TChA::operator== | ( | const TChA & | ChA | ) | const [inline] |
| bool TChA::operator== | ( | const char * | _CStr | ) | const [inline] |
| bool TChA::operator== | ( | const char & | Ch | ) | const [inline] |
| char TChA::operator[] | ( | const int & | ChN | ) | const [inline] |
| char& TChA::operator[] | ( | const int & | ChN | ) | [inline] |
| char TChA::Pop | ( | ) | [inline] |
Definition at line 262 of file dt.h.
References Bf, BfL, and IAssert.
Referenced by THttpResp::AddFldVal(), DelLastCh(), TXmlLx::GetCDSect(), THtmlLx::GetCh(), TXmlLx::GetCh(), THtmlLx::GetFullBTagStr(), THtmlLx::GetSym(), TILx::GetSym(), TXmlObjSer::GetTagNm(), TSs::LoadTxtFldV(), THtmlLx::PutCh(), and TXmlLx::ToNrSpacing().

| void TChA::Push | ( | const char & | Ch | ) | [inline] |
Definition at line 261 of file dt.h.
References operator+=().
Referenced by TXmlParser::GetSym(), TXmlLx::PutCh(), and THtmlLx::PutCh().
{operator+=(Ch);}


| void TChA::PutCh | ( | const int & | ChN, |
| const char & | Ch | ||
| ) | [inline] |
Definition at line 272 of file dt.h.
References Assert, Bf, and BfL.
Referenced by CompressWs(), TStr::GetFNmStr(), THtmlLxChDef::GetLcChA(), TXmlObjSer::GetTagNm(), THtmlLxChDef::GetUcChA(), TXmlLx::GetUsAsciiStrFromXmlStr(), THttpLx::IsRespStatusLn(), TSs::SaveTxt(), Swap(), TXmlLx::ToNrSpacing(), ToTrunc(), and Trunc().

| void TChA::Resize | ( | const int & | _MxBfL | ) | [private] |
Definition at line 330 of file dt.cpp.
References Bf, IAssert, and MxBfL.
Referenced by Ins(), and operator+=().
{
if (_MxBfL<=MxBfL){return;}
else {if (MxBfL*2<_MxBfL){MxBfL=_MxBfL;} else {MxBfL*=2;}}
char* NewBf=new char[MxBfL+1]; IAssert(NewBf!=NULL);
strcpy(NewBf, Bf);
delete[] Bf; Bf=NewBf;
}

| void TChA::Reverse | ( | ) |
| void TChA::Save | ( | TSOut & | SOut, |
| const bool & | SaveCompact = true |
||
| ) | const [inline] |
| void TChA::SaveTxt | ( | const PSOut & | SOut | ) | const |
| void TChA::SaveXml | ( | TSOut & | SOut, |
| const TStr & | Nm | ||
| ) | const |
Definition at line 343 of file dt.cpp.
References BfL, TInt::GetStr(), TXmlLx::GetXmlStrFromPlainStr(), TSOut::PutStr(), and XSaveHdArg.
{
XSaveHdArg(Nm, "BfL", TInt::GetStr(BfL));
SOut.PutStr(TXmlLx::GetXmlStrFromPlainStr(*this));
}

| int TChA::SearchCh | ( | const char & | Ch, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 452 of file dt.cpp.
References Bf, TInt::GetMx(), and Len().
Referenced by TStr::DelChAll(), TStrUtil::GetDomNm(), TStrUtil::GetWebsiteNm(), and IsChIn().
{
int ChN=TInt::GetMx(BChN, 0);
const int ThisLen=Len();
while (ChN<ThisLen){if (Bf[ChN]==Ch){return ChN;} ChN++;}
return -1;
}


| int TChA::SearchChBack | ( | const char & | Ch, |
| int | BChN = -1 |
||
| ) | const |
Definition at line 459 of file dt.cpp.
References GetCh(), and Len().
Referenced by TStrUtil::GetDomNm().
{
if (BChN >= Len() || BChN < 0) { BChN = Len()-1; }
for (int i = BChN; i >= 0; i--) {
if (GetCh(i) == Ch) { return i; }
}
return -1;
}


| int TChA::SearchStr | ( | const TChA & | Str, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 467 of file dt.cpp.
References CStr().
Referenced by TStrUtil::GetWebsiteNm(), IsStrIn(), and SearchStr().


| int TChA::SearchStr | ( | const TStr & | Str, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 471 of file dt.cpp.
References TStr::CStr(), and SearchStr().

| int TChA::SearchStr | ( | const char * | CStr, |
| const int & | BChN = 0 |
||
| ) | const |
| void TChA::Swap | ( | const int & | ChN1, |
| const int & | ChN2 | ||
| ) |
| void TChA::Swap | ( | TChA & | ChA | ) |
| TChA & TChA::ToLc | ( | ) |
Definition at line 534 of file dt.cpp.
References Bf.
Referenced by TStrUtil::GetDomNm(), TUrlLx::GetHost(), TStrUtil::GetNormalizedUrl(), and TUrlLx::GetScheme().
{
char *c = Bf;
while (*c) {
*c = (char) tolower(*c); c++;
}
return *this;
}

| TChA & TChA::ToTrunc | ( | ) |
Definition at line 550 of file dt.cpp.
References GetCh(), TCh::IsWs(), Len(), PutCh(), and Trunc().
Referenced by TILx::GetStrToEoln().
{
int StrLen=Len(); int BChN=0; int EChN=StrLen-1;
while ((BChN<StrLen)&&TCh::IsWs(GetCh(BChN))){BChN++;}
while ((EChN>=0)&&TCh::IsWs(GetCh(EChN))){EChN--;}
if ((BChN!=0)||(EChN!=StrLen-1)){
int DstChN=0;
for (int SrcChN=BChN; SrcChN<=EChN; SrcChN++){
PutCh(DstChN, GetCh(SrcChN)); DstChN++;}
Trunc(DstChN);
}
return *this;
}


| TChA & TChA::ToUc | ( | ) |
| void TChA::Trunc | ( | ) |
Definition at line 402 of file dt.cpp.
References BfL, Clr(), GetCh(), and PutCh().
Referenced by CompressWs(), TILx::GetSym(), TUrl::GetTopDownDocNm(), TSs::LoadTxtFldV(), TXmlLx::ToNrSpacing(), ToTrunc(), and TPreproc::TPreproc().
{
int BChN=0; while ((BChN<BfL)&&(GetCh(BChN)<=' ')){BChN++;}
int EChN=BfL-1; while ((0<=EChN)&&(GetCh(EChN)<=' ')){EChN--;}
if (BChN<=EChN){
for (int ChN=BChN; ChN<=EChN; ChN++){
PutCh(ChN-BChN, GetCh(ChN));}
Trunc(EChN-BChN+1);
} else {
Clr();
}
/* int BChN=0; while ((BChN<BfL)&&(Bf[BChN]<=' ')){BChN++;}
int EChN=BfL-1; while ((0<=EChN)&&(Bf[EChN]<=' ')){EChN--;}
if (BChN<=EChN){
for (int ChN=BChN; ChN<=EChN; ChN++){Bf[ChN-BChN]=Bf[ChN];}
Bf[BfL=EChN+1]=0;
} else {
Clr();
}*/
}


| void TChA::Trunc | ( | const int & | _BfL | ) | [inline] |
char* TChA::Bf [private] |
Definition at line 201 of file dt.h.
Referenced by ChangeCh(), Clr(), CountCh(), CStr(), Del(), Ins(), IsPrefix(), IsSuffix(), LastCh(), LastLastCh(), Load(), LoadTxt(), operator!=(), operator()(), operator+=(), operator=(), operator==(), operator[](), Pop(), PutCh(), Resize(), Reverse(), Save(), SearchCh(), SearchStr(), Swap(), TChA(), ToLc(), ToUc(), Trunc(), and ~TChA().
int TChA::BfL [private] |
Definition at line 200 of file dt.h.
Referenced by AddCh(), Clr(), Del(), Empty(), Ins(), LastCh(), LastLastCh(), Len(), Load(), LoadTxt(), operator!=(), operator+=(), operator=(), operator==(), operator[](), Pop(), PutCh(), Reverse(), Save(), SaveXml(), Swap(), TChA(), and Trunc().
int TChA::MxBfL [private] |
Definition at line 200 of file dt.h.
Referenced by GetMemUsed(), Load(), LoadTxt(), operator+=(), operator=(), Resize(), Save(), Swap(), and TChA().