|
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 | |
| TStr () | |
| TStr (const TStr &Str) | |
| TStr (const TChA &ChA) | |
| TStr (const TSStr &SStr) | |
| TStr (const char *CStr) | |
| TStr (const char &Ch) | |
| TStr (const TMem &Mem) | |
| TStr (const PSIn &SIn) | |
| ~TStr () | |
| TStr (TSIn &SIn, const bool &IsSmall=false) | |
| void | Load (TSIn &SIn, const bool &IsSmall=false) |
| void | Save (TSOut &SOut, const bool &IsSmall=false) const |
| void | LoadXml (const PXmlTok &XmlTok, const TStr &Nm) |
| void | SaveXml (TSOut &SOut, const TStr &Nm) const |
| TStr & | operator= (const TStr &Str) |
| TStr & | operator= (const TChA &ChA) |
| TStr & | operator= (const char *CStr) |
| TStr & | operator= (const char &Ch) |
| TStr & | operator+= (const TStr &Str) |
| TStr & | operator+= (const char *CStr) |
| bool | operator== (const TStr &Str) const |
| bool | operator== (const char *CStr) const |
| bool | operator!= (const char *CStr) const |
| bool | operator< (const TStr &Str) const |
| char | operator[] (const int &ChN) const |
| int | GetMemUsed () const |
| char * | operator() () |
| const char * | operator() () const |
| char * | CStr () |
| const char * | CStr () const |
| void | PutCh (const int &ChN, const char &Ch) |
| char | GetCh (const int &ChN) const |
| char | LastCh () const |
| void | Clr () |
| int | Len () const |
| bool | Empty () const |
| bool | IsUc () const |
| TStr & | ToUc () |
| TStr | GetUc () const |
| int | CmpI (const TStr &Str) const |
| bool | EqI (const TStr &Str) const |
| bool | IsLc () const |
| TStr & | ToLc () |
| TStr | GetLc () const |
| TStr & | ToCap () |
| TStr | GetCap () const |
| TStr & | ToTrunc () |
| TStr | GetTrunc () const |
| TStr & | ConvUsFromYuAscii () |
| TStr | GetUsFromYuAscii () const |
| TStr & | ToHex () |
| TStr | GetHex () const |
| TStr & | FromHex () |
| TStr | GetFromHex () const |
| TStr | GetSubStr (const int &BChN, const int &EChN) const |
| TStr | GetSubStr (const int &BChN) const |
| void | InsStr (const int &BChN, const TStr &Str) |
| void | DelChAll (const char &Ch) |
| void | DelSubStr (const int &BChN, const int &EChN) |
| bool | DelStr (const TStr &Str) |
| TStr | LeftOf (const char &SplitCh) const |
| TStr | LeftOfLast (const char &SplitCh) const |
| TStr | RightOf (const char &SplitCh) const |
| TStr | RightOfLast (const char &SplitCh) const |
| void | SplitOnCh (TStr &LStr, const char &SplitCh, TStr &RStr) const |
| void | SplitOnLastCh (TStr &LStr, const char &SplitCh, TStr &RStr) const |
| void | SplitOnAllCh (const char &SplitCh, TStrV &StrV, const bool &SkipEmpty=true) const |
| void | SplitOnAllAnyCh (const TStr &SplitChStr, TStrV &StrV, const bool &SkipEmpty=true) const |
| void | SplitOnWs (TStrV &StrV) const |
| void | SplitOnNonAlNum (TStrV &StrV) const |
| void | SplitOnStr (const TStr &SplitStr, TStrV &StrV) const |
| void | SplitOnStr (TStr &LeftStr, const TStr &MidStr, TStr &RightStr) const |
| TStr | Mid (const int &BChN, const int &Chs) const |
| TStr | Mid (const int &BChN) const |
| TStr | Left (const int &EChN) const |
| TStr | Right (const int &BChN) const |
| TStr | Slice (int BChN, int EChNP1) const |
| TStr | operator() (const int &BChN, const int &EChNP1) 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 TStr &Str, const int &BChN=0) const |
| bool | IsChIn (const char &Ch) const |
| bool | IsStrIn (const TStr &Str) const |
| bool | IsPrefix (const char *Str) const |
| bool | IsPrefix (const TStr &Str) const |
| bool | IsSuffix (const char *Str) const |
| bool | IsSuffix (const TStr &Str) const |
| int | ChangeCh (const char &SrcCh, const char &DstCh, const int &BChN=0) |
| int | ChangeChAll (const char &SrcCh, const char &DstCh) |
| int | ChangeStr (const TStr &SrcStr, const TStr &DstStr, const int &BChN=0) |
| int | ChangeStrAll (const TStr &SrcStr, const TStr &DstStr, const bool &FromStartP=false) |
| TStr | Reverse () const |
| int | GetPrimHashCd () const |
| int | GetSecHashCd () const |
| bool | IsBool (bool &Val) const |
| bool | IsInt (const bool &Check, const int &MnVal, const int &MxVal, int &Val) const |
| bool | IsInt (int &Val) const |
| bool | IsInt () const |
| int | GetInt () const |
| int | GetInt (const int &DfVal) const |
| bool | IsUInt (const bool &Check, const uint &MnVal, const uint &MxVal, uint &Val) const |
| bool | IsUInt (uint &Val) const |
| bool | IsUInt () const |
| uint | GetUInt () const |
| uint | GetUInt (const uint &DfVal) const |
| bool | IsInt64 (const bool &Check, const int64 &MnVal, const int64 &MxVal, int64 &Val) const |
| bool | IsInt64 (int64 &Val) const |
| bool | IsInt64 () const |
| int64 | GetInt64 () const |
| int64 | GetInt64 (const int64 &DfVal) const |
| bool | IsUInt64 (const bool &Check, const uint64 &MnVal, const uint64 &MxVal, uint64 &Val) const |
| bool | IsUInt64 (uint64 &Val) const |
| bool | IsUInt64 () const |
| uint64 | GetUInt64 () const |
| uint64 | GetUInt64 (const uint64 &DfVal) const |
| bool | IsHexInt (const bool &Check, const int &MnVal, const int &MxVal, int &Val) const |
| bool | IsHexInt (int &Val) const |
| bool | IsHexInt () const |
| int | GetHexInt () const |
| int | GetHexInt (const int &DfVal) const |
| bool | IsHexInt64 (const bool &Check, const int64 &MnVal, const int64 &MxVal, int64 &Val) const |
| bool | IsHexInt64 (int64 &Val) const |
| bool | IsHexInt64 () const |
| int64 | GetHexInt64 () const |
| int64 | GetHexInt64 (const int64 &DfVal) const |
| bool | IsFlt (const bool &Check, const double &MnVal, const double &MxVal, double &Val, const char &DecDelimCh='.') const |
| bool | IsFlt (double &Val) const |
| bool | IsFlt () const |
| double | GetFlt () const |
| double | GetFlt (const double &DfVal) const |
| bool | IsWord (const bool &WsPrefixP=true, const bool &FirstUcAllowedP=true) const |
| bool | IsWs () const |
| bool | IsWcMatch (const int &StrBChN, const TStr &WcStr, const int &WcStrBChN, TStrV &StarStrV, const char &StarCh='*', const char &QuestCh='?') const |
| bool | IsWcMatch (const TStr &WcStr, TStrV &StarStrV, const char &StarCh='*', const char &QuestCh='?') const |
| bool | IsWcMatch (const TStr &WcStr, const char &StarCh, const char &QuestCh) const |
| bool | IsWcMatch (const TStr &WcStr, const int &StarStrN, TStr &StarStr) const |
| bool | IsWcMatch (const TStr &WcStr) const |
| TStr | GetWcMatch (const TStr &WcStr, const int &StarStrN=0) const |
| TStr | GetFPath () const |
| TStr | GetFBase () const |
| TStr | GetFMid () const |
| TStr | GetFExt () const |
| void | SaveTxt (const PSOut &SOut) const |
| void | SaveTxt (const TStr &FNm) const |
| TStr | GetStr () const |
| char * | GetCStr () const |
Static Public Member Functions | |
| static TStr | GetNrFPath (const TStr &FPath) |
| static TStr | GetNrFMid (const TStr &FMid) |
| static TStr | GetNrFExt (const TStr &FExt) |
| static TStr | GetNrNumFExt (const int &FExtN) |
| static TStr | GetNrFNm (const TStr &FNm) |
| static TStr | GetNrAbsFPath (const TStr &FPath, const TStr &BaseFPath=TStr()) |
| static bool | IsAbsFPath (const TStr &FPath) |
| static TStr | PutFExt (const TStr &FNm, const TStr &FExt) |
| static TStr | PutFExtIfEmpty (const TStr &FNm, const TStr &FExt) |
| static TStr | PutFBase (const TStr &FNm, const TStr &FBase) |
| static TStr | PutFBaseIfEmpty (const TStr &FNm, const TStr &FBase) |
| static TStr | AddToFMid (const TStr &FNm, const TStr &ExtFMid) |
| static TStr | GetNumFNm (const TStr &FNm, const int &Num) |
| static TStr | GetFNmStr (const TStr &Str, const bool &AlNumOnlyP=true) |
| static TStr | LoadTxt (const PSIn &SIn) |
| static TStr | LoadTxt (const TStr &FNm) |
| static TStr & | GetChStr (const char &Ch) |
| static TStr & | GetDChStr (const char &Ch1, const char &Ch2) |
| static TStr | GetStr (const TStr &Str, const char *FmtStr) |
| static TStr | GetStr (const TStr &Str, const TStr &FmtStr) |
| static TStr | GetStr (const TStrV &StrV, const TStr &DelimiterStr) |
| static TStr | Fmt (const char *FmtStr,...) |
| static TStr | GetSpaceStr (const int &Spaces) |
| static TStr | MkClone (const TStr &Str) |
| static TStr | GetNullStr () |
Private Member Functions | |
| TStr (const char &Ch, bool) | |
| TStr (const char &Ch1, const char &Ch2, bool) | |
| void | Optimize () |
Static Private Member Functions | |
| static TRStr * | GetRStr (const char *CStr) |
Private Attributes | |
| TRStr * | RStr |
Friends | |
| TStr | operator+ (const TStr &LStr, const TStr &RStr) |
| TStr | operator+ (const TStr &LStr, const char *RCStr) |
| TStr::TStr | ( | const char & | Ch, |
| bool | |||
| ) | [inline, private] |
| TStr::TStr | ( | const char & | Ch1, |
| const char & | Ch2, | ||
| bool | |||
| ) | [inline, private] |
| TStr::TStr | ( | ) | [inline] |
Definition at line 416 of file dt.h.
References TRStr::GetNullRStr(), TRStr::MkRef(), and RStr.
Referenced by Fmt(), GetCap(), GetChStr(), GetDChStr(), GetFExt(), GetFromHex(), GetHex(), GetLc(), GetNrFExt(), GetNrNumFExt(), GetStr(), GetSubStr(), GetTrunc(), GetUc(), GetUsFromYuAscii(), Load(), LoadTxt(), MkClone(), SplitOnAllAnyCh(), SplitOnAllCh(), SplitOnNonAlNum(), and SplitOnWs().
{RStr=TRStr::GetNullRStr(); RStr->MkRef();}


| TStr::TStr | ( | const TStr & | Str | ) | [inline] |
| TStr::TStr | ( | const TChA & | ChA | ) | [inline] |
| TStr::TStr | ( | const TSStr & | SStr | ) | [inline] |
| TStr::TStr | ( | const char * | CStr | ) | [inline] |
| TStr::TStr | ( | const char & | Ch | ) | [inline, explicit] |
Definition at line 421 of file dt.h.
References GetChStr(), TRStr::MkRef(), and RStr.

| TStr::TStr | ( | const TMem & | Mem | ) | [inline] |
Definition at line 422 of file dt.h.
References CStr(), TMem::Len(), TRStr::MkRef(), Optimize(), and RStr.

| TStr::TStr | ( | const PSIn & | SIn | ) | [inline, explicit] |
Definition at line 425 of file dt.h.
References CStr(), TSIn::GetBf(), TSIn::Len(), TRStr::MkRef(), Optimize(), and RStr.
{
int SInLen=SIn->Len(); RStr=new TRStr(SInLen); RStr->MkRef();
SIn->GetBf(CStr(), SInLen); Optimize();}

| TStr::~TStr | ( | ) | [inline] |
| TStr::TStr | ( | TSIn & | SIn, |
| const bool & | IsSmall = false |
||
| ) | [inline, explicit] |
Definition at line 429 of file dt.h.
References TRStr::MkRef(), Optimize(), and RStr.

| TStr TStr::AddToFMid | ( | const TStr & | FNm, |
| const TStr & | ExtFMid | ||
| ) | [static] |
| int TStr::ChangeCh | ( | const char & | SrcCh, |
| const char & | DstCh, | ||
| const int & | BChN = 0 |
||
| ) |
Definition at line 1083 of file dt.cpp.
References PutCh(), and SearchCh().
Referenced by GetNrFPath().


| int TStr::ChangeChAll | ( | const char & | SrcCh, |
| const char & | DstCh | ||
| ) |
Definition at line 1089 of file dt.cpp.
References TRStr::CStr(), CStr(), Len(), TRStr::MkRef(), Optimize(), RStr, SearchCh(), and TRStr::UnRef().
Referenced by TMAGAffMtx::GetMtx(), and TKronMtx::GetMtx().
{
int FirstChN=SearchCh(SrcCh);
if (FirstChN==-1){
return 0;
} else {
TRStr* NewRStr=new TRStr(RStr->CStr());
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
char* ThisBf=CStr(); int StrLen=Len(); int Changes=0;
for (int ChN=FirstChN; ChN<StrLen; ChN++){
// slow: if (GetCh(ChN)==SrcCh){RStr->PutCh(ChN, DstCh); Changes++;}
if (ThisBf[ChN]==SrcCh){ThisBf[ChN]=DstCh; Changes++;}
}
Optimize();
return Changes;
}
}


| int TStr::ChangeStr | ( | const TStr & | SrcStr, |
| const TStr & | DstStr, | ||
| const int & | BChN = 0 |
||
| ) |
Definition at line 1106 of file dt.cpp.
References DelSubStr(), InsStr(), Len(), and SearchStr().
Referenced by ChangeStrAll(), and TFile::GetUniqueFNm().
{
int ChN=SearchStr(SrcStr, BChN);
if (ChN==-1){
return -1;
} else {
DelSubStr(ChN, ChN+SrcStr.Len()-1);
InsStr(ChN, DstStr);
return ChN;
}
}


| int TStr::ChangeStrAll | ( | const TStr & | SrcStr, |
| const TStr & | DstStr, | ||
| const bool & | FromStartP = false |
||
| ) |
Definition at line 1117 of file dt.cpp.
References ChangeStr(), and Len().
Referenced by TGnuPlot::AddPlot(), TGnuPlot::CreatePlotFile(), TXmlLx::GetChRefFromYuEntRef(), GetNrAbsFPath(), TXmlLx::GetUsAsciiStrFromXmlStr(), TUnicode::NormalizeCodecName(), and TUrl::TUrl().
{
const int DstStrLen=DstStr.Len();
int Changes=0-1; int BChN=0-DstStrLen;
do {
Changes++;
if (FromStartP){BChN=0-DstStrLen;}
BChN+=DstStrLen;
BChN=ChangeStr(SrcStr, DstStr, BChN);
} while (BChN!=-1);
return Changes;
}


| void TStr::Clr | ( | ) | [inline] |
Definition at line 479 of file dt.h.
References TRStr::GetNullRStr(), TRStr::MkRef(), RStr, and TRStr::UnRef().
Referenced by DelSubStr(), TUrl::GetAbs(), THttpResp::ParseHttpResp(), and TUrl::ToLcPath().


| int TStr::CmpI | ( | const TStr & | Str | ) | const [inline] |
| TStr & TStr::ConvUsFromYuAscii | ( | ) |
Definition at line 755 of file dt.cpp.
References TRStr::ConvUsFromYuAscii(), TRStr::CStr(), TRStr::MkRef(), Optimize(), RStr, and TRStr::UnRef().
{
TRStr* NewRStr=new TRStr(RStr->CStr()); NewRStr->ConvUsFromYuAscii();
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
Optimize(); return *this;
}

| int TStr::CountCh | ( | const char & | Ch, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 1009 of file dt.cpp.
References CStr(), TInt::GetMx(), and Len().
{
const int ThisLen=Len();
const char* ThisBf=CStr();
int Chs=0;
for (int ChN=TInt::GetMx(BChN, 0); ChN<ThisLen; ChN++){
if (ThisBf[ChN]==Ch){Chs++;}
}
return Chs;
}

| char* TStr::CStr | ( | ) | [inline] |
Definition at line 469 of file dt.h.
References TRStr::CStr(), and RStr.
Referenced by TStrHash< TDat, TStringPool, THashFunc >::AddDat(), TStrHash< TDat, TStringPool, THashFunc >::AddDatId(), TGnuPlot::AddErrBar(), TGnuPlot::AddFunc(), TStrHash< TDat, TStringPool, THashFunc >::AddKey(), TGnuPlot::AddPlot(), TBigStrPool::AddStr(), TStrPool::AddStr(), TStrPool64::AddStr(), anonymous_namespace{unicode.cpp}::AssertEq(), TKroneckerLL::ChainGelmapRubinPlot(), ChangeChAll(), CmpI(), CountCh(), TGnuPlot::CreatePlotFile(), TZipIn::CreateZipProcess(), TZipOut::CreateZipProcess(), TFile::Del(), TDir::DelDir(), DelSubStr(), TGHash< TDat >::DrawGViz(), TLocClust::DrawWhiskers(), TMAGAffMtx::Dump(), TCnCom::Dump(), TKronMtx::Dump(), TBigNet< TNodeData, IsDir >::Dump(), TSimpleGraph::Dump(), TTimeNENet::DumpTimeStat(), EqI(), ErrNotify(), TDir::GenDir(), TZipIn::GetCmd(), TZipOut::GetCmd(), GetCStr(), TBigStrPool::GetCStr(), TStrPool::GetCStr(), TBigStrPool::GetCStrFromOffset(), TExeTm::GetCurTm(), TStrHash< TDat, TStringPool, THashFunc >::GetDat(), TSecTm::GetDtStr(), GetFBase(), GetFExt(), TZipIn::GetFLen(), GetFMid(), GetFPath(), TEnv::GetIfArgPrefixBool(), TEnv::GetIfArgPrefixFlt(), TEnv::GetIfArgPrefixInt(), TEnv::GetIfArgPrefixStr(), TEnv::GetIfArgPrefixStrV(), TStrHash< TDat, TStringPool, THashFunc >::GetKeyId(), TKronMtx::GetMtxFromNm(), TStrHashF_OldGLib::GetPrimHashCd(), TStrHashF_DJB::GetPrimHashCd(), TILx::GetQStr(), TStrHashF_OldGLib::GetSecHashCd(), TStrHashF_DJB::GetSecHashCd(), TSecTm::GetStr(), TMom::GetStr(), GetStr(), TInt::GetStr(), TUInt::GetStr(), TFlt::GetStr(), TLFlt::GetStr(), GetSubStr(), TSecTm::GetTmSec(), THtmlDoc::GetTxtLnDoc(), TUInt::GetUIntFromIpStr(), TEnv::GetVarVal(), TStrUtil::GetXmlTagVal(), TKroneckerLL::GradDescentConvergence(), TAGM::GVizComGraph(), TSnap::TSnapDetail::GVizDoLayout(), TGStatVec::ImposeDistr(), TLocClustStat::ImposeNCP(), InfoNotify(), TUniChDb::InitDerivedCoreProperties(), TUniChDb::InitPropList(), TUniChDb::InitScripts(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TBigNet< TNodeData, IsDir >::InvertFromSources(), IsFlt(), TStrHash< TDat, TStringPool, THashFunc >::IsKey(), TStrHash< TDat, TStringPool, THashFunc >::IsKeyGetDat(), TNodeNet< TNodeData >::IsOk(), TUNGraph::IsOk(), TNGraph::IsOk(), TNodeEDatNet< TNodeData, TEdgeData >::IsOk(), TNEGraph::IsOk(), TBPGraph::IsOk(), TNodeEdgeNet< TNodeData, TEdgeData >::IsOk(), TChA::IsPrefix(), IsPrefix(), TChA::IsSuffix(), IsSuffix(), LeftOf(), LeftOfLast(), TTimeNet::LoadAmazon(), TTimeNet::LoadArxiv(), TTimeNet::LoadBipartite(), TKeyDatFl< TKey, TDat, THashFunc >::LoadDatV(), TTimeNENet::LoadEdgeTm(), TTimeNENet::LoadFlickr(), TKeyDatFl< TKey, TDat, THashFunc >::LoadHash(), TKeyDatFl< TKey, TDat, THashFunc >::LoadKeyV(), TTimeNet::LoadPatents(), TMAGNodeSimple::LoadTxt(), TMAGNodeBern::LoadTxt(), TMAGNodeBeta::LoadTxt(), TMAGParam< TNodeAttr >::LoadTxt(), TUniCaseFolding::LoadTxt(), TUniChDb::LoadTxt(), MkClone(), TNumericalStuff::nrerror(), TNativeCallbackNotify::OnNotify(), TStdNotify::OnNotify(), TStdErrNotify::OnNotify(), TNativeCallbackNotify::OnStatus(), TStdNotify::OnStatus(), TStdErrNotify::OnStatus(), TLogNotify::OnStatus(), TUniChDb::TUcdFileReader::Open(), operator!=(), TGStat::TCmpByVal::operator()(), TWChA::operator+=(), TMem::operator+=(), TChA::operator+=(), operator+=(), TCon::operator<<(), TWChA::operator=(), TChA::operator=(), operator==(), Optimize(), TGStat::Plot(), TGStatVec::Plot(), PlotAutoCorrelation(), TLocClustStat::PlotBestClustDens(), TLocClustStat::PlotBoltzmanCurve(), TTimeNet::PlotCCfOverTm(), TSnap::PlotClustCf(), TKronMtx::PlotCmpGraphs(), TLocClust::PlotCutDistr(), TTimeNet::PlotEffDiam(), TTimeNENet::PlotEffDiam(), TSnap::PlotEigValDistr(), TSnap::PlotEigValRank(), TForestFire::PlotFire(), TFfGGen::PlotFireSize(), PlotGrad(), TSnap::PlotHops(), TSnap::PlotInDegDistr(), TSnap::PlotInvParticipRat(), TTimeNet::PlotMedianDegOverTm(), TTimeNet::PlotMissingPast(), TTimeNENet::PlotMissingPast(), TLocClustStat::PlotNCP(), TLocClustStat::PlotNCPModul(), TLocClustStat::PlotNCPScatter(), TLocClustStat::PlotNcpTop10(), TSnap::PlotOutDegDistr(), TLocClust::PlotPhiDistr(), TLocClustStat::PlotPhiDistr(), TLocClustStat::PlotPhiInOut(), TSnap::PlotSccDistr(), TSnap::PlotShortPathDistr(), TSnap::PlotSngValDistr(), TSnap::PlotSngValRank(), TSnap::PlotSngVec(), PlotTrueAndEst(), TGnuPlot::PlotValV(), TLocClust::PlotVolDistr(), TSnap::PlotWccDistr(), TEnv::PrepArgs(), TUniChDb::PrintCharNames(), TSnap::PrintInfo(), TTmProfiler::PrintReport(), TLAMisc::PrintTFltV(), TLAMisc::PrintTFltVV(), TLAMisc::PrintTIntV(), TSOut::PutStr(), TFRnd::PutStr(), TEnv::PutVarVal(), TFile::Rename(), TVec< TVal >::Resize(), RightOf(), RightOfLast(), TGnuPlot::RunGnuPlot(), TGHash< TDat >::SaveDetailTxt(), TNetInfBs::SaveEdgeInfo(), TSnap::SaveEdgeList(), TTimeNENet::SaveEdgeTm(), TGnuPlot::SaveEps(), TSnap::SaveGViz(), TGraphKey::SaveGViz(), THtmlDoc::SaveHtmlToXml(), TSnap::SaveMatlabSparseMtx(), TSnap::SavePajek(), TLocClust::SavePajek(), TNetInfBs::SavePajek(), TNetInfBs::SavePlaneTextNet(), TGnuPlot::SavePng(), TGnuPlot::SaveTs(), TKronMtx::SaveTxt(), TCnCom::SaveTxt(), TMAGParam< TNodeAttr >::SaveTxt(), TGStatVec::SaveTxt(), TNcpGraphsBase::SaveTxt(), TGHash< TDat >::SaveTxt(), SaveTxt(), TLocClustStat::SaveTxtInfo(), TNcpGraphsBase::SaveTxtNcpMin(), SearchCh(), SearchChBack(), TChA::SearchStr(), SearchStr(), SplitOnAllAnyCh(), SplitOnAllCh(), SplitOnCh(), SplitOnLastCh(), SplitOnNonAlNum(), SplitOnWs(), StatNotify(), TChA::TChA(), TUniCodec::TestDecodeUtf16(), TUniCodec::TestDecodeUtf8(), TUniChDb::TestFindNextWordOrSentenceBoundary(), TKroneckerLL::TestGradDescent(), TKroneckerLL::TestSamplePerm(), TUniCodec::TestUtf16(), TUniCodec::TestUtf8(), TUniChDb::TestWbFindNonIgnored(), TFIn::TFIn(), TFInOut::TFInOut(), TFOut::TFOut(), TTimeNENet::TimeGrowth(), TMem::TMem(), TMIn::TMIn(), TNcpGraphsBase::TNcpGraphsBase(), ToTrunc(), TSparseRowMatrix::TSparseRowMatrix(), TStr(), TWChA::TWChA(), TZipIn::TZipIn(), TFPathNotify::UpdateSOut(), WarnNotify(), and TUniChDb::TSubcatHelper::~TSubcatHelper().


| const char* TStr::CStr | ( | ) | const [inline] |
| void TStr::DelChAll | ( | const char & | Ch | ) |
Definition at line 816 of file dt.cpp.
References TChA::Del(), and TChA::SearchCh().
{
TChA ChA(*this);
int ChN=ChA.SearchCh(Ch);
while (ChN!=-1){
ChA.Del(ChN);
ChN=ChA.SearchCh(Ch);
}
*this=ChA;
}

| bool TStr::DelStr | ( | const TStr & | Str | ) |
Definition at line 839 of file dt.cpp.
References DelSubStr(), Len(), and SearchStr().
Referenced by TUrl::GetAbsFromBase().
{
int ChN=SearchStr(Str);
if (ChN==-1){
return false;
} else {
DelSubStr(ChN, ChN+Str.Len()-1);
return true;
}
}


| void TStr::DelSubStr | ( | const int & | BChN, |
| const int & | EChN | ||
| ) |
Definition at line 826 of file dt.cpp.
References Clr(), CStr(), TInt::GetMn(), TInt::GetMx(), and Len().
Referenced by ChangeStr(), DelStr(), TUrl::GetAbsFromBase(), and TEnv::GetIfArgPrefixBool().
{
int BChN=TInt::GetMx(_BChN, 0);
int EChN=TInt::GetMn(_EChN, Len()-1);
int Chs=Len()-(EChN-BChN+1);
if (Chs==0){Clr();}
else if (Chs<Len()){
char* Bf=new char[Chs+1]; strncpy(Bf, CStr(), BChN);
strncpy(Bf+BChN, CStr()+EChN+1, Len()-EChN-1); Bf[Chs]=0;
TStr Str(Bf); delete[] Bf;
*this=Str;
}
}


| bool TStr::Empty | ( | ) | const [inline] |
Definition at line 481 of file dt.h.
References TRStr::Empty(), and RStr.
Referenced by TGnuPlot::AddExpFit(), TGnuPlot::AddFunc(), TGnuPlot::AddLinFit(), TGnuPlot::AddLogFit(), TGnuPlot::AddPwrFit1(), TGnuPlot::AddPwrFit2(), TGnuPlot::AddPwrFit3(), TXmlObjSer::AssertXmlHd(), TGnuPlot::CreatePlotFile(), TUrl::DefFinalUrl(), TMAGAffMtx::Dump(), TCnCom::Dump(), TKronMtx::Dump(), TBigNet< TNodeData, IsDir >::Dump(), TSimpleGraph::Dump(), TDbStr::Empty(), TFile::Exists(), TDbStr::Filled(), TUrl::GetAbs(), TUrl::GetAbsFromBase(), THttpResp::GetCookieKeyValDmPathQuV(), TSs::GetFldX(), TSs::GetFldY(), GetNrAbsFPath(), TGBlobBs::GetNrBlobBsFNm(), GetNrFExt(), TExpHelp::GetObjHdNmV(), TXmlLx::GetPEReference(), TPp::GetPp(), TXmlLx::GetReference(), TGnuPlot::GetSeriesPlotStr(), THttpLx::GetSpec(), TXmlObjSer::GetTagNm(), TXmlTok::GetTagTok(), TXmlDoc::GetTagTok(), THttpLx::GetToken(), TKroneckerLL::GradDescentConvergence(), TGStatVec::ImposeDistr(), TLocClustStat::ImposeNCP(), TUniChDb::InitSpecialCasing(), TEnv::IsEndOfRun(), TUrl::IsSite(), THtmlTok::IsUrlTok(), TUniChDb::LoadTxt(), TUniChDb::LoadTxt_ProcessDecomposition(), TStdNotify::OnStatus(), TStdErrNotify::OnStatus(), operator+(), TGStat::Plot(), TGStatVec::Plot(), TLocClustStat::PlotBestClustDens(), TTimeNet::PlotCCfOverTm(), TSnap::PlotClustCf(), TLocClust::PlotCutDistr(), TSnap::PlotEigValDistr(), TSnap::PlotEigValRank(), TSnap::PlotInDegDistr(), TSnap::PlotInvParticipRat(), TLocClustStat::PlotNCP(), TLocClustStat::PlotNCPModul(), TLocClustStat::PlotNCPScatter(), TLocClustStat::PlotNcpTop10(), TSnap::PlotOutDegDistr(), TLocClust::PlotPhiDistr(), TSnap::PlotSccDistr(), TSnap::PlotShortPathDistr(), TSnap::PlotSngValDistr(), TSnap::PlotSngValRank(), TSnap::PlotSngVec(), TLocClust::PlotVolDistr(), TSnap::PlotWccDistr(), TEnv::PrepArgs(), TSnap::PrintInfo(), PutFBaseIfEmpty(), PutFExtIfEmpty(), TSnap::SaveEdgeList(), TGnuPlot::SaveEps(), TSnap::SaveGViz(), TGraphKey::SaveGViz(), THtmlDoc::SaveHtmlToXml(), TGnuPlot::SavePng(), TGnuPlot::SaveTs(), TCnCom::SaveTxt(), TPp::SaveTxt(), SaveXml(), TFFile::TFFile(), TFIn::TFIn(), TGnuPlot::TGnuPlot(), THttpResp::THttpResp(), THttpRq::THttpRq(), TUrl::ToLcPath(), TPreproc::TPreproc(), TXmlObjSerTagNm::TXmlObjSerTagNm(), TZipIn::TZipIn(), TZipOut::TZipOut(), and TXmlObjSerTagNm::~TXmlObjSerTagNm().


Definition at line 1574 of file dt.cpp.
References GetNullStr(), and TStr().
Referenced by TNodeNet< TNodeData >::AddEdge(), TUNGraph::AddEdge(), TNGraph::AddEdge(), TNodeEDatNet< TNodeData, TEdgeData >::AddEdge(), TNEGraph::AddEdge(), TBPGraph::AddEdge(), TNodeEdgeNet< TNodeData, TEdgeData >::AddEdge(), TJsonVal::AddEscapeChAFromStr(), TGnuPlot::AddExpFit(), TGnuPlot::AddFunc(), TGnuPlot::AddLinFit(), TGnuPlot::AddLogFit(), TBigNet< TNodeData, IsDir >::AddNode(), TNodeNet< TNodeData >::AddNode(), TUNGraph::AddNode(), TNGraph::AddNode(), TNodeEDatNet< TNodeData, TEdgeData >::AddNode(), TNEGraph::AddNode(), TBPGraph::AddNode(), TNodeEdgeNet< TNodeData, TEdgeData >::AddNode(), TGnuPlot::AddPwrFit1(), TGnuPlot::AddPwrFit2(), TGnuPlot::AddPwrFit3(), TBigNet< TNodeData, IsDir >::AddUndirNode(), TKroneckerLL::ChainGelmapRubinPlot(), TZipIn::CreateZipProcess(), TZipOut::CreateZipProcess(), TNodeNet< TNodeData >::DelEdge(), TUNGraph::DelEdge(), TNGraph::DelEdge(), TNodeEDatNet< TNodeData, TEdgeData >::DelEdge(), TBPGraph::DelEdge(), TUNGraph::DelNode(), TBPGraph::DelNode(), TLinAlg::DotProduct(), TGHash< TDat >::DrawGViz(), TLocClust::DrawWhiskers(), TSsParser::DumpStr(), TFfGGen::GenFFGraphs(), TSnap::GenRndGnm(), TSnap::GenSmallWorld(), TJsonVal::GetChAFromVal(), TSnap::GetClustCf(), TZipIn::GetCmd(), TZipOut::GetCmd(), TSecTm::GetDtMdyStr(), TSecTm::GetDtStr(), TSecTm::GetDtYmdStr(), TBPGraph::GetEI(), TZipIn::GetFLen(), TFlt::GetGigaStr(), TUInt64::GetHexStr(), TBigNet< TNodeData, IsDir >::GetInNIdV(), TSsParser::GetInt(), TFlt::GetKiloStr(), TFlt::GetMegaStr(), TKronMtx::GetMtxFromNm(), TMAGAffMtx::GetMtxStr(), TKronMtx::GetMtxStr(), TFfGGen::GetParamStr(), TSecTm::GetStr(), TTuple< TVal, NVals >::GetStr(), TUInt64::GetStr(), TUInt::GetStrFromIpUInt(), TXmlParser::GetTag(), TXmlParser::GetTagVal(), TSecTm::GetTmMinStr(), TSecTm::GetTmSec(), TSecTm::GetTmStr(), TUInt::GetUIntFromIpStr(), TFile::GetUniqueFNm(), TSecTm::GetYmdTmStr(), TKroneckerLL::GradDescentConvergence(), TAGM::GVizComGraph(), TSnap::TSnapDetail::GVizDoLayout(), TGStatVec::ImposeDistr(), TLocClustStat::ImposeNCP(), TGraphAnf< PGraph >::InitAnfBits(), TBigNet< TNodeData, IsDir >::IsOk(), TNodeNet< TNodeData >::IsOk(), TUNGraph::IsOk(), TNGraph::IsOk(), TNodeEDatNet< TNodeData, TEdgeData >::IsOk(), TNEGraph::IsOk(), TBPGraph::IsOk(), TNodeEdgeNet< TNodeData, TEdgeData >::IsOk(), TSparseSVD::Lanczos(), TSs::LoadTxt(), TLogNotify::OnStatus(), TGStat::TCmpByVal::operator()(), TStrPool::operator=(), TVecPool< TVal >::operator=(), TLocClustStat::ParamStr(), TGStat::Plot(), TGStatVec::Plot(), PlotAutoCorrelation(), TLocClustStat::PlotBestClustDens(), TLocClustStat::PlotBoltzmanCurve(), TTimeNet::PlotCCfOverTm(), TSnap::PlotClustCf(), TKronMtx::PlotCmpGraphs(), TLocClust::PlotCutDistr(), TTimeNet::PlotEffDiam(), TTimeNENet::PlotEffDiam(), TSnap::PlotEigValDistr(), TSnap::PlotEigValRank(), TForestFire::PlotFire(), TFfGGen::PlotFireSize(), PlotGrad(), TSnap::PlotHops(), TSnap::PlotInDegDistr(), TSnap::PlotInvParticipRat(), TTimeNet::PlotMedianDegOverTm(), TTimeNet::PlotMissingPast(), TLocClustStat::PlotNCP(), TLocClustStat::PlotNCPModul(), TLocClustStat::PlotNCPScatter(), TLocClustStat::PlotNcpTop10(), TSnap::PlotOutDegDistr(), TLocClust::PlotPhiDistr(), TLocClustStat::PlotPhiDistr(), TLocClustStat::PlotPhiInOut(), TSnap::PlotSccDistr(), TSnap::PlotShortPathDistr(), TSnap::PlotSngValDistr(), TSnap::PlotSngValRank(), TSnap::PlotSngVec(), TGnuPlot::PlotValV(), TLocClust::PlotVolDistr(), TSnap::PlotWccDistr(), TEnv::PutVarVal(), TVec< TVal >::Resize(), TBigStrPool::Resize(), TStrPool::Resize(), TStrPool64::Resize(), TVecPool< TVal >::Resize(), TGnuPlot::RunGnuPlot(), TNetInfBs::SaveCascades(), TNIBs::SaveCascades(), TGnuPlot::SaveEps(), TNetInfBs::SaveGroundTruth(), TNIBs::SaveGroundTruth(), TNIBs::SaveGroundTruthPajek(), TNIBs::SaveInferred(), TNIBs::SaveInferredEdges(), TNIBs::SaveInferredPajek(), TLAMisc::SaveMatlabTFltIntKdV(), TSnap::SavePajek(), TLocClust::SavePajek(), TGnuPlot::SavePng(), TNIBs::SaveSites(), THist::SaveStat(), TMAGNodeSimple::SaveTxt(), TMAGNodeBern::SaveTxt(), TMAGNodeBeta::SaveTxt(), TGStatVec::SaveTxt(), TLocClustStat::SaveTxtInfo(), TNcpGraphsBase::SaveTxtNcpMin(), TNodeEDatNet< TNodeData, TEdgeData >::SetEDat(), TNodeEdgeNet< TNodeData, TEdgeData >::SetEDat(), TNodeNet< TNodeData >::SetNDat(), TNodeEDatNet< TNodeData, TEdgeData >::SetNDat(), TNodeEdgeNet< TNodeData, TEdgeData >::SetNDat(), TKroneckerLL::TestGradDescent(), TKroneckerLL::TestSamplePerm(), TFullColMatrix::TFullColMatrix(), TTimeNENet::TimeGrowth(), TNcpGraphsBase::TNcpGraphsBase(), TStrPool::TStrPool(), TVecPool< TVal >::TVecPool(), TZipIn::TZipIn(), TFPathNotify::UpdateSOut(), and TStrPool::~TStrPool().
{
char Bf[10*1024];
va_list valist;
va_start(valist, FmtStr);
const int RetVal=vsnprintf(Bf, 10*1024-2, FmtStr, valist);
va_end(valist);
return RetVal!=-1 ? TStr(Bf) : TStr::GetNullStr();
}


| TStr & TStr::FromHex | ( | ) |
Definition at line 774 of file dt.cpp.
References TRStr::Bf, TCh::GetHex(), IAssert, Len(), and RStr.
{
int StrLen=Len(); IAssert(StrLen%2==0);
TChA ChA; int ChN=0;
while (ChN<StrLen){
char MshCh=RStr->Bf[ChN]; ChN++;
char LshCh=RStr->Bf[ChN]; ChN++;
uchar Ch=uchar(TCh::GetHex(MshCh)*16+TCh::GetHex(LshCh));
ChA+=Ch;
}
*this=ChA;
return *this;
}

| TStr TStr::GetCap | ( | ) | const [inline] |
| char TStr::GetCh | ( | const int & | ChN | ) | const [inline] |
Definition at line 476 of file dt.h.
References TRStr::GetCh(), and RStr.
Referenced by TLxChDef::GetUcStr(), TUrlLxChDef::InclStr(), TLxChDef::IsNmStr(), IsWcMatch(), and LastCh().


| TStr & TStr::GetChStr | ( | const char & | Ch | ) | [static] |
Definition at line 1526 of file dt.cpp.
References TVec< TVal >::Empty(), TVec< TVal >::Gen(), and TStr().
Referenced by operator=(), and TStr().
{
static char MnCh=char(CHAR_MIN);
static char MxCh=char(CHAR_MAX);
static int Chs=int(MxCh)-int(MnCh)+1;
static TStrV ChStrV;
if (ChStrV.Empty()){
ChStrV.Gen(Chs);
for (int ChN=0; ChN<Chs; ChN++){
ChStrV[ChN]=TStr(char(MnCh+ChN), true);}
}
return ChStrV[int(Ch-MnCh)];
}


| char* TStr::GetCStr | ( | ) | const [inline] |
| TStr & TStr::GetDChStr | ( | const char & | Ch1, |
| const char & | Ch2 | ||
| ) | [static] |
Definition at line 1539 of file dt.cpp.
References TVVec< TVal >::At(), TVVec< TVal >::Empty(), Fail, TVVec< TVal >::Gen(), TCh::Mn, TStr(), and TCh::Vals.
{
Fail; // temporary
static TStrVV DChStrVV;
if (DChStrVV.Empty()){
DChStrVV.Gen(TCh::Vals, TCh::Vals);
for (int Ch1N=0; Ch1N<TCh::Vals; Ch1N++){
for (int Ch2N=0; Ch2N<TCh::Vals; Ch2N++){
DChStrVV.At(Ch1N, Ch2N)=
TStr(char(TCh::Mn+Ch1N), char(TCh::Mn+Ch2N), true);
}
}
}
return DChStrVV.At(int(Ch1-TCh::Mn), int(Ch2-TCh::Mn));
}

| TStr TStr::GetFBase | ( | ) | const |
Definition at line 1371 of file dt.cpp.
References CStr(), GetSubStr(), and Len().
Referenced by TEnv::PrepArgs(), PutFBaseIfEmpty(), and TFFile::TFFile().
{
int ThisLen=Len(); const char* ThisBf=CStr();
int ChN=ThisLen-1;
while ((ChN>=0)&&(ThisBf[ChN]!='/')&&(ThisBf[ChN]!='\\')){ChN--;}
return GetSubStr(ChN+1, ThisLen);
}


| TStr TStr::GetFExt | ( | ) | const |
Definition at line 1396 of file dt.cpp.
References CStr(), GetSubStr(), Len(), and TStr().
Referenced by AddToFMid(), TSnap::DrawGViz(), TZipIn::GetCmd(), TZipOut::GetCmd(), TGBlobBs::GetNrBlobBsFNm(), GetNrFNm(), GetNumFNm(), TAGM::GVizComGraph(), TSnap::TSnapDetail::GVizDoLayout(), TZipIn::IsZipFNm(), TZipOut::IsZipFNm(), PutFExtIfEmpty(), TSsParser::TSsParser(), and TZipIn::TZipIn().
{
int ThisLen=Len(); const char* ThisBf=CStr();
int ChN=ThisLen-1;
while ((ChN>=0)&&(ThisBf[ChN]!='/')&&(ThisBf[ChN]!='\\')&&
(ThisBf[ChN]!='.')){ChN--;}
if ((ChN>=0)&&(ThisBf[ChN]=='.')){return GetSubStr(ChN, Len());}
else {return TStr();}
}


| double TStr::GetFlt | ( | ) | const [inline] |
Definition at line 622 of file dt.h.
References IAssert, and IsFlt().
Referenced by TEnv::GetIfArgPrefixFlt(), TMAGNodeSimple::LoadTxt(), TMAGNodeBern::LoadTxt(), TMAGNodeBeta::LoadTxt(), and TFlt::TFlt().


| double TStr::GetFlt | ( | const double & | DfVal | ) | const [inline] |
| TStr TStr::GetFMid | ( | ) | const |
Definition at line 1378 of file dt.cpp.
References CStr(), GetSubStr(), and Len().
Referenced by AddToFMid(), TGraphKey::DrawGViz(), TZipOut::GetCmd(), GetNrFNm(), TMBlobBs::GetNrFPathFMid(), GetNumFNm(), PutFExt(), PutFExtIfEmpty(), TGnuPlot::SaveEps(), TGnuPlot::SavePng(), and TNcpGraphsBase::TNcpGraphsBase().
{
int ThisLen=Len(); const char* ThisBf=CStr();
int ChN=ThisLen-1;
while ((ChN>=0)&&(ThisBf[ChN]!='/')&&(ThisBf[ChN]!='\\')&&(ThisBf[ChN]!='.')){
ChN--;}
if (ChN<0){
return *this;
} else {
if (ThisBf[ChN]=='.'){
int EChN= --ChN;
while ((ChN>=0)&&(ThisBf[ChN]!='/')&&(ThisBf[ChN]!='\\')){ChN--;}
return GetSubStr(ChN+1, EChN);
} else {
return GetSubStr(ChN+1, ThisLen);
}
}
}


| TStr TStr::GetFNmStr | ( | const TStr & | Str, |
| const bool & | AlNumOnlyP = true |
||
| ) | [static] |
Definition at line 1506 of file dt.cpp.
References TChA::Len(), and TChA::PutCh().
{
TChA FNm=Str;
for (int ChN=0; ChN<FNm.Len(); ChN++){
uchar Ch=FNm[ChN];
if (AlNumOnlyP){
if (
(('0'<=Ch)&&(Ch<='9'))||
(('A'<=Ch)&&(Ch<='Z'))||
(('a'<=Ch)&&(Ch<='z'))||
(Ch=='-')||(Ch=='_')){}
else {Ch='_';}
} else {
if ((Ch<=' ')||(Ch=='/')||(Ch=='\\')||(Ch==':')||(Ch=='.')){
Ch='_';}
}
FNm.PutCh(ChN, Ch);
}
return FNm;
}

| TStr TStr::GetFPath | ( | ) | const |
Definition at line 1364 of file dt.cpp.
References CStr(), GetSubStr(), and Len().
Referenced by AddToFMid(), TUnicodeDef::GetDfFNm(), TEnv::GetExeFPath(), GetNrFNm(), TMBlobBs::GetNrFPathFMid(), GetNumFNm(), PutFBase(), PutFBaseIfEmpty(), PutFExt(), PutFExtIfEmpty(), and TFFile::TFFile().
{
int ThisLen=Len(); const char* ThisBf=CStr();
int ChN=ThisLen-1;
while ((ChN>=0)&&(ThisBf[ChN]!='/')&&(ThisBf[ChN]!='\\')){ChN--;}
return GetSubStr(0, ChN);
}


| TStr TStr::GetFromHex | ( | ) | const [inline] |
| TStr TStr::GetHex | ( | ) | const [inline] |
Definition at line 505 of file dt.h.
References TStr().
Referenced by TXmlLx::GetSymStr(), IsHexInt(), and IsHexInt64().
{return TStr(*this).ToHex();}


| int TStr::GetHexInt | ( | ) | const [inline] |
| int TStr::GetHexInt | ( | const int & | DfVal | ) | const [inline] |
Definition at line 607 of file dt.h.
References IsHexInt().
{
int Val; if (IsHexInt(false, 0, 0, Val)){return Val;} else {return DfVal;}}

| int64 TStr::GetHexInt64 | ( | ) | const [inline] |
Definition at line 613 of file dt.h.
References IAssert, and IsHexInt64().
{
int64 Val; IAssert(IsHexInt64(false, 0, 0, Val)); return Val;}

| int64 TStr::GetHexInt64 | ( | const int64 & | DfVal | ) | const [inline] |
Definition at line 615 of file dt.h.
References IsHexInt64().
{
int64 Val; if (IsHexInt64(false, 0, 0, Val)){return Val;} else {return DfVal;}}

| int TStr::GetInt | ( | ) | const [inline] |
Definition at line 572 of file dt.h.
References IAssertR, and IsInt().
Referenced by TSecTm::GetDtTmFromDmyStr(), TSecTm::GetDtTmFromHmsStr(), TSecTm::GetDtTmFromMdyHmsPmStr(), TSecTm::GetDtTmFromMdyStr(), TSecTm::GetDtTmFromYmdHmsStr(), TUrlLx::GetHostPort(), TEnv::GetIfArgPrefixInt(), TTm::GetTmFromWebLogDateTimeStr(), TTm::GetTmFromWebLogTimeStr(), TTimeNet::LoadAmazon(), TTimeNet::LoadPatents(), and THttpRq::ParseHttpRq().


| int TStr::GetInt | ( | const int & | DfVal | ) | const [inline] |
| int64 TStr::GetInt64 | ( | ) | const [inline] |
| int64 TStr::GetInt64 | ( | const int64 & | DfVal | ) | const [inline] |
| TStr TStr::GetLc | ( | ) | const [inline] |
Definition at line 492 of file dt.h.
References TStr().
Referenced by TUrl::DefFinalUrl(), TUrl::GetAbsFromBase(), TZipIn::GetCmd(), TZipOut::GetCmd(), TTmInfo::GetDayOfWeekN(), TTmInfo::GetMonthN(), TSs::GetSsFmtFromStr(), TXmlLx::GetSym(), TUrl::GetTopDownDocNm(), TUnicode::GetUtf8CaseFolded(), TUrl::IsAbs(), and TUnicode::NormalizeCodecName().
{return TStr(*this).ToLc();}


| int TStr::GetMemUsed | ( | ) | const [inline] |
Definition at line 465 of file dt.h.
References TRStr::GetMemUsed(), and RStr.
{return sizeof(TRStr*)+RStr->GetMemUsed();}

| TStr TStr::GetNrAbsFPath | ( | const TStr & | FPath, |
| const TStr & | BaseFPath = TStr() |
||
| ) | [static] |
Definition at line 1446 of file dt.cpp.
References ChangeStrAll(), Empty(), TDir::GetCurDir(), GetNrFPath(), IAssert, and IsAbsFPath().
{
TStr NrBaseFPath;
if (BaseFPath.Empty()){
NrBaseFPath=GetNrFPath(TDir::GetCurDir());
} else {
NrBaseFPath=GetNrFPath(BaseFPath);
}
IAssert(IsAbsFPath(NrBaseFPath));
TStr NrFPath=GetNrFPath(FPath);
TStr NrAbsFPath;
if (IsAbsFPath(NrFPath)){
NrAbsFPath=NrFPath;
} else {
NrAbsFPath=GetNrFPath(NrBaseFPath+NrFPath);
}
NrAbsFPath.ChangeStrAll("/./", "/");
NrAbsFPath.ChangeStrAll("\\.\\", "\\");
return NrAbsFPath;
}

| TStr TStr::GetNrFExt | ( | const TStr & | FExt | ) | [static] |
Definition at line 1430 of file dt.cpp.
References Empty(), and TStr().
Referenced by GetNrFNm(), and TFFile::TFFile().


| TStr TStr::GetNrFMid | ( | const TStr & | FMid | ) | [static] |
Definition at line 1420 of file dt.cpp.
References TCh::IsAlNum(), and Len().
Referenced by TMBlobBs::GetNrFPathFMid().
{
TChA NrFMid;
int FMidLen=FMid.Len();
for (int ChN=0; ChN<FMidLen; ChN++){
char Ch=FMid[ChN];
if (TCh::IsAlNum(Ch)){NrFMid+=Ch;} else {NrFMid+='_';}
}
return NrFMid;
}


| TStr TStr::GetNrFNm | ( | const TStr & | FNm | ) | [static] |
Definition at line 1442 of file dt.cpp.
References GetFExt(), GetFMid(), GetFPath(), GetNrFExt(), and GetNrFPath().
{
return GetNrFPath(FNm.GetFPath())+FNm.GetFMid()+GetNrFExt(FNm.GetFExt());
}

| TStr TStr::GetNrFPath | ( | const TStr & | FPath | ) | [static] |
Definition at line 1405 of file dt.cpp.
References ChangeCh(), and Len().
Referenced by TDir::GetCurDir(), TDir::GetExeDir(), GetNrAbsFPath(), GetNrFNm(), TMBlobBs::GetNrFPathFMid(), and TFFile::TFFile().
{
TChA NrFPath(FPath.Len()+4); NrFPath+=FPath;
NrFPath.ChangeCh('\\', '/');
if (NrFPath.Empty()){NrFPath="./";}
if ((NrFPath.Len()>=2)&&isalpha(NrFPath[0])&&(NrFPath[1]==':')){
if (NrFPath.Len()==2){NrFPath+="./";}
if ((NrFPath[2]!='.')&&(NrFPath[2]!='/')){NrFPath.Ins(2, "./");}
if (NrFPath[NrFPath.Len()-1]!='/'){NrFPath+="/";}
} else {
if ((NrFPath[0]!='.')&&(NrFPath[0]!='/')){NrFPath.Ins(0, "./");}
if (NrFPath[NrFPath.Len()-1]!='/'){NrFPath+="/";}
}
return NrFPath;
}


| TStr TStr::GetNrNumFExt | ( | const int & | FExtN | ) | [static] |
Definition at line 1435 of file dt.cpp.
References GetStr(), Len(), and TStr().
Referenced by TMBlobBs::GetSegFNm().
{
TStr FExtNStr=TInt::GetStr(FExtN);
while (FExtNStr.Len()<3){
FExtNStr=TStr("0")+FExtNStr;}
return FExtNStr;
}


| TStr TStr::GetNullStr | ( | ) | [static] |
Definition at line 1601 of file dt.cpp.
Referenced by Fmt(), TBigStrPool::GetCStr(), TStrPool::GetCStr(), TBigStrPool::GetCStrFromOffset(), TBigStrPool::GetStr(), TStrPool::GetStr(), TBigStrPool::GetStrFromOffset(), TChA::GetSubStr(), TTmInfo::GetTmUnitStr(), TSs::GetVal(), TSnap::TSnapDetail::GVizGetLayoutStr(), TTimeNet::PlotEffDiam(), TTimeNENet::PlotEffDiam(), and SplitOnStr().
{
static TStr NullStr="";
return NullStr;
}

| TStr TStr::GetNumFNm | ( | const TStr & | FNm, |
| const int & | Num | ||
| ) | [static] |
Definition at line 1502 of file dt.cpp.
References GetFExt(), GetFMid(), GetFPath(), and GetStr().
{
return FNm.GetFPath()+FNm.GetFMid()+TInt::GetStr(Num, "%03d")+FNm.GetFExt();
}

| int TStr::GetPrimHashCd | ( | ) | const [inline] |
Definition at line 563 of file dt.h.
References TRStr::GetPrimHashCd(), and RStr.
Referenced by TDbStr::GetPrimHashCd().
{return RStr->GetPrimHashCd();}


| TRStr * TStr::GetRStr | ( | const char * | CStr | ) | [static, private] |
Definition at line 695 of file dt.cpp.
References TRStr::GetNullRStr().
Referenced by operator=(), and TStr().
{
int CStrLen;
if (CStr==NULL){CStrLen=0;} else {CStrLen=int(strlen(CStr));}
if (CStrLen==0){return TRStr::GetNullRStr();}
// next lines are not multi-threading safe
//else if (CStrLen==1){return GetChStr(CStr[0]).RStr;}
//else if (CStrLen==2){return GetDChStr(CStr[0], CStr[1]).RStr;}
else {return new TRStr(CStr);}
}


| int TStr::GetSecHashCd | ( | ) | const [inline] |
Definition at line 564 of file dt.h.
References TRStr::GetSecHashCd(), and RStr.
Referenced by TDbStr::GetSecHashCd().
{return RStr->GetSecHashCd();}


| TStr TStr::GetSpaceStr | ( | const int & | Spaces | ) | [static] |
Definition at line 1583 of file dt.cpp.
References TVec< TVal >::Add(), and TVec< TVal >::Len().
Referenced by THtmlLx::GetPreSpaceStr(), and TTmProfiler::PrintReport().
{
static TStrV SpaceStrV;
if (SpaceStrV.Len()==0){
for (int SpaceStrN=0; SpaceStrN<10; SpaceStrN++){
TChA SpaceChA;
for (int ChN=0; ChN<SpaceStrN; ChN++){SpaceChA+=' ';}
SpaceStrV.Add(SpaceChA);
}
}
if ((0<=Spaces)&&(Spaces<SpaceStrV.Len())){
return SpaceStrV[Spaces];
} else {
TChA SpaceChA;
for (int ChN=0; ChN<Spaces; ChN++){SpaceChA+=' ';}
return SpaceChA;
}
}


| TStr TStr::GetStr | ( | ) | const [inline] |
Definition at line 672 of file dt.h.
Referenced by GetNrNumFExt(), GetNumFNm(), TJsonVal::GetObjStr(), GetStr(), THtmlDoc::GetTok(), TXmlDoc::LoadTxtElement(), and TSOut::PutStr().
{return *this;}

| TStr TStr::GetStr | ( | const TStr & | Str, |
| const char * | FmtStr | ||
| ) | [static] |
| static TStr TStr::GetStr | ( | const TStr & | Str, |
| const TStr & | FmtStr | ||
| ) | [inline, static] |
| TStr TStr::GetStr | ( | const TStrV & | StrV, |
| const TStr & | DelimiterStr | ||
| ) | [static] |
Definition at line 1564 of file dt.cpp.
References TVec< TVal >::Empty(), TVec< TVal >::Len(), and TStr().
{
if (StrV.Empty()){return TStr();}
TChA ResStr=StrV[0];
for (int StrN=1; StrN<StrV.Len(); StrN++){
ResStr+=DelimiterStr;
ResStr+=StrV[StrN];
}
return ResStr;
}

| TStr TStr::GetSubStr | ( | const int & | BChN, |
| const int & | EChN | ||
| ) | const |
Definition at line 787 of file dt.cpp.
References CStr(), TInt::GetMn(), TInt::GetMx(), Len(), and TStr().
Referenced by TSnap::DrawGViz(), TUrl::GetAbsFromBase(), TEnv::GetArgPostfix(), TEnv::GetExeFNm(), GetFBase(), GetFExt(), GetFMid(), GetFPath(), THtmlTok::GetFullStr(), TEnv::GetIfArgPrefixStr(), TEnv::GetIfArgPrefixStrV(), TTypeNm< Type >::GetNrTypeNm(), THtmlDoc::GetTxtLnDoc(), TAGM::GVizComGraph(), InsStr(), THtmlTok::IsUrlTok(), Left(), LeftOf(), LeftOfLast(), TTimeNet::LoadAmazon(), TUniChDb::LoadTxt_ProcessDecomposition(), Mid(), TUniChDb::TUcdFileReader::ParseCodePointRange(), Right(), RightOf(), RightOfLast(), THtmlDoc::SaveHtmlToXml(), TMAGParam< TNodeAttr >::SaveTxt(), Slice(), SplitOnCh(), SplitOnLastCh(), SplitOnStr(), TMacro::SplitVarNm(), TNcpGraphsBase::TNcpGraphsBase(), and ToTrunc().
{
int StrLen=Len();
int BChN=TInt::GetMx(_BChN, 0);
int EChN=TInt::GetMn(_EChN, StrLen-1);
int Chs=EChN-BChN+1;
if (Chs<=0){return TStr();}
else if (Chs==StrLen){return *this;}
else {
char* Bf=new char[Chs+1]; strncpy(Bf, CStr()+BChN, Chs); Bf[Chs]=0;
TStr Str(Bf); delete[] Bf;
return Str;
}
}


| TStr TStr::GetSubStr | ( | const int & | BChN | ) | const [inline] |
Definition at line 510 of file dt.h.
References GetSubStr(), and Len().
Referenced by GetSubStr().


| TStr TStr::GetTrunc | ( | ) | const [inline] |
Definition at line 499 of file dt.h.
References TStr().
Referenced by THttpResp::GetCookieKeyValDmPathQuV(), and TSs::GetFldY().
{return TStr(*this).ToTrunc();}


| TStr TStr::GetUc | ( | ) | const [inline] |
Definition at line 486 of file dt.h.
References TStr().
Referenced by TExpBi::AddBi(), TExp::EvalExp(), TFRnd::GetFAccessFromStr(), TExpHelp::GetObj(), TPp::GetPpN(), TBool::GetValFromStr(), TGStatVec::ImposeDistr(), TExpBi::IsExpBiId(), TExpEnv::IsFuncOk(), THttp::IsGifFExt(), THttp::IsHtmlFExt(), TUrl::IsInHost(), TUrl::IsInPath(), THtmlTok::IsRedirUrlTok(), THtmlTok::IsUrlTok(), TBool::IsValStr(), TGStat::Plot(), and TFOut::TFOut().
{return TStr(*this).ToUc();}


| uint TStr::GetUInt | ( | ) | const [inline] |
| uint TStr::GetUInt | ( | const uint & | DfVal | ) | const [inline] |
| uint64 TStr::GetUInt64 | ( | ) | const [inline] |
| uint64 TStr::GetUInt64 | ( | const uint64 & | DfVal | ) | const [inline] |
Definition at line 599 of file dt.h.
References IsUInt64().

| TStr TStr::GetUsFromYuAscii | ( | ) | const [inline] |
| TStr TStr::GetWcMatch | ( | const TStr & | WcStr, |
| const int & | StarStrN = 0 |
||
| ) | const |
Definition at line 1354 of file dt.cpp.
References IAssert, IsWcMatch(), and TVec< TVal >::Len().
{
TStrV StarStrV;
if (IsWcMatch(WcStr, StarStrV)&&(StarStrV.Len()>=StarStrN)){
IAssert(StarStrN>=0);
return StarStrV[StarStrV.Len()-StarStrN-1];
} else {
return "";
}
}

| void TStr::InsStr | ( | const int & | BChN, |
| const TStr & | Str | ||
| ) |
Definition at line 801 of file dt.cpp.
References GetSubStr(), IAssert, and Len().
Referenced by ChangeStr(), and TFile::GetUniqueFNm().
{
int ThisLen=Len();
IAssert((0<=BChN)&&(BChN<=ThisLen));
TStr NewStr;
if (BChN==0){
NewStr=Str+*this;
} else
if (BChN==ThisLen){
NewStr=*this+Str;
} else {
NewStr=GetSubStr(0, BChN-1)+Str+GetSubStr(BChN, ThisLen-1);
}
*this=NewStr;
}


| bool TStr::IsAbsFPath | ( | const TStr & | FPath | ) | [static] |
Definition at line 1466 of file dt.cpp.
References Len().
Referenced by GetNrAbsFPath().
{
if ((FPath.Len()>=3)&&isalpha(FPath[0])&&(FPath[1]==':')&&
((FPath[2]=='/')||(FPath[2]=='\\'))){
return true;
}
return false;
}


| bool TStr::IsBool | ( | bool & | Val | ) | const |
Definition at line 1129 of file dt.cpp.
Referenced by TXmlObjSer::GetBoolArg().
{
if (operator==("T")){Val=true; return true;}
else if (operator==("F")){Val=false; return true;}
else {return false;}
}

| bool TStr::IsChIn | ( | const char & | Ch | ) | const [inline] |
Definition at line 547 of file dt.h.
References SearchCh().
Referenced by TXmlLx::GetArgValQCh(), THttpResp::GetCookieKeyValDmPathQuV(), TUrl::GetUrlFromShortcut(), and TUrl::IsScript().
{return SearchCh(Ch)!=-1;}


| bool TStr::IsFlt | ( | const bool & | Check, |
| const double & | MnVal, | ||
| const double & | MxVal, | ||
| double & | Val, | ||
| const char & | DecDelimCh = '.' |
||
| ) | const |
Definition at line 1240 of file dt.cpp.
References CStr(), TChRet::Eof(), TChRet::GetCh(), TCh::IsNum(), TCh::IsWs(), and TStrIn::New().
Referenced by TXmlObjSer::GetFltArg().
{
// parsing format {ws} [+/-] +{d} ([.]{d}) ([E|e] [+/-] +{d})
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
if ((Ch()=='+')||(Ch()=='-')){Ch.GetCh();}
if (!TCh::IsNum(Ch())&&Ch()!=DecDelimCh){return false;}
while (TCh::IsNum(Ch.GetCh())){}
if (Ch()==DecDelimCh){
Ch.GetCh();
while (TCh::IsNum(Ch.GetCh())){}
}
if ((Ch()=='e')||(Ch()=='E')){
Ch.GetCh();
if ((Ch()=='+')||(Ch()=='-')){Ch.GetCh();}
if (!TCh::IsNum(Ch())){return false;}
while (TCh::IsNum(Ch.GetCh())){}
}
if (!Ch.Eof()){return false;}
double _Val=atof(CStr());
if (Check&&((_Val<MnVal)||(_Val>MxVal))){
return false;
} else {
Val=_Val; return true;
}
}


| bool TStr::IsFlt | ( | double & | Val | ) | const [inline] |
| bool TStr::IsFlt | ( | ) | const [inline] |
| bool TStr::IsHexInt | ( | const bool & | Check, |
| const int & | MnVal, | ||
| const int & | MxVal, | ||
| int & | Val | ||
| ) | const |
Definition at line 1166 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), GetHex(), TCh::GetHex(), TCh::IsHex(), TCh::IsWs(), and TStrIn::New().
Referenced by TUniChDb::TUcdFileReader::ParseCodePoint().
{
// parsing format {ws} [+/-][0x] +{XXX}
int _Val=0;
bool Minus=false;
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
if (Ch()=='+'){Minus=false; Ch.GetCh();}
if (Ch()=='-'){Minus=true; Ch.GetCh();}
if (Ch()=='0'){
Ch.GetCh();
if (tolower(Ch())=='x' ){
Ch.GetCh(); if (Ch.Eof()){return false;}
}
}
if (! Ch.Eof()) _Val = TCh::GetHex(Ch());
while (TCh::IsHex(Ch.GetCh())){_Val=16*_Val+TCh::GetHex(Ch());}
if (Minus){_Val=-_Val;}
if (Check&&((_Val<MnVal)||(_Val>MxVal))){return false;}
if (Ch.Eof()){Val=_Val; return true;} else {return false;}
}


| bool TStr::IsHexInt | ( | int & | Val | ) | const [inline] |
Definition at line 603 of file dt.h.
References IsHexInt().
Referenced by IsHexInt().
{return IsHexInt(false, 0, 0, Val);}


| bool TStr::IsHexInt | ( | ) | const [inline] |
Definition at line 604 of file dt.h.
References IsHexInt().
Referenced by GetHexInt(), and IsHexInt().
{int Val; return IsHexInt(false, 0, 0, Val);}


| bool TStr::IsHexInt64 | ( | const bool & | Check, |
| const int64 & | MnVal, | ||
| const int64 & | MxVal, | ||
| int64 & | Val | ||
| ) | const |
Definition at line 1218 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), GetHex(), TCh::GetHex(), TCh::IsHex(), TCh::IsWs(), and TStrIn::New().
{
// parsing format {ws} [+/-][0x] +{XXX}
int64 _Val=0;
bool Minus=false;
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
if (Ch()=='+'){Minus=false; Ch.GetCh();}
if (Ch()=='-'){Minus=true; Ch.GetCh();}
if (Ch()=='0'){
Ch.GetCh();
if (tolower(Ch())=='x' ){
Ch.GetCh(); if (Ch.Eof()){return false;}
}
}
if (!Ch.Eof()) _Val=TCh::GetHex(Ch());
while (TCh::IsHex(Ch.GetCh())){_Val=16*_Val+TCh::GetHex(Ch());}
if (Minus){_Val=-_Val;}
if (Check&&((_Val<MnVal)||(_Val>MxVal))){return false;}
if (Ch.Eof()){Val=_Val; return true;} else {return false;}
}

| bool TStr::IsHexInt64 | ( | int64 & | Val | ) | const [inline] |
Definition at line 611 of file dt.h.
References IsHexInt64().
Referenced by IsHexInt64().
{return IsHexInt64(false, 0, 0, Val);}


| bool TStr::IsHexInt64 | ( | ) | const [inline] |
Definition at line 612 of file dt.h.
References IsHexInt64().
Referenced by GetHexInt64(), and IsHexInt64().
{int64 Val; return IsHexInt64(false, 0, 0, Val);}


| bool TStr::IsInt | ( | const bool & | Check, |
| const int & | MnVal, | ||
| const int & | MxVal, | ||
| int & | Val | ||
| ) | const |
Definition at line 1135 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), TCh::GetNum(), TCh::IsNum(), TCh::IsWs(), and TStrIn::New().
Referenced by TSecTm::GetDtTmFromMdyHmsPmStr(), TSecTm::GetDtTmFromYmdHmsStr(), TXmlObjSer::GetIntArg(), and TUniChDb::LoadTxt().
{
// parsing format {ws} [+/-] +{ddd}
int _Val=0;
bool Minus=false;
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
if (Ch()=='+'){Minus=false; Ch.GetCh();}
if (Ch()=='-'){Minus=true; Ch.GetCh();}
if (!TCh::IsNum(Ch())){return false;}
_Val=TCh::GetNum(Ch());
while (TCh::IsNum(Ch.GetCh())){_Val=10*_Val+TCh::GetNum(Ch());}
if (Minus){_Val=-_Val;}
if (Check&&((_Val<MnVal)||(_Val>MxVal))){return false;}
if (Ch.Eof()){Val=_Val; return true;} else {return false;}
}


| bool TStr::IsInt | ( | int & | Val | ) | const [inline] |
| bool TStr::IsInt | ( | ) | const [inline] |
| bool TStr::IsInt64 | ( | const bool & | Check, |
| const int64 & | MnVal, | ||
| const int64 & | MxVal, | ||
| int64 & | Val | ||
| ) | const |
Definition at line 1187 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), TCh::GetNum(), TCh::IsNum(), TCh::IsWs(), and TStrIn::New().
Referenced by TXmlObjSer::GetInt64Arg().
{
// parsing format {ws} [+/-] +{ddd}
int64 _Val=0;
bool Minus=false;
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
if (Ch()=='+'){Minus=false; Ch.GetCh();}
if (Ch()=='-'){Minus=true; Ch.GetCh();}
if (!TCh::IsNum(Ch())){return false;}
_Val=TCh::GetNum(Ch());
while (TCh::IsNum(Ch.GetCh())){_Val=10*_Val+TCh::GetNum(Ch());}
if (Minus){_Val=-_Val;}
if (Check&&((_Val<MnVal)||(_Val>MxVal))){return false;}
if (Ch.Eof()){Val=_Val; return true;} else {return false;}
}


| bool TStr::IsInt64 | ( | int64 & | Val | ) | const [inline] |
| bool TStr::IsInt64 | ( | ) | const [inline] |
| bool TStr::IsLc | ( | ) | const [inline] |
Definition at line 490 of file dt.h.
References TRStr::IsLc(), and RStr.
Referenced by TUrl::ToLcPath().


| bool TStr::IsPrefix | ( | const char * | Str | ) | const |
Definition at line 1057 of file dt.cpp.
References TRStr::Bf, Len(), min, and RStr.
Referenced by TUrl::GetAbsFromBase(), TEnv::GetExeFNm(), TTypeNm< Type >::GetNrTypeNm(), TUrl::IsAbs(), and IsPrefix().
{
size_t len = strlen(Str);
size_t thisLen = Len();
if (len > thisLen) {
return false;
} else {
size_t minLen = min(len, thisLen);
int cmp = strncmp(Str, RStr->Bf, minLen);
return cmp == 0;
}
}


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

| bool TStr::IsSuffix | ( | const char * | Str | ) | const |
Definition at line 1069 of file dt.cpp.
References TRStr::Bf, Len(), and RStr.
Referenced by THttpResp::AddFldVal(), and IsSuffix().
{
size_t len = strlen(Str);
size_t thisLen = Len();
if (len > thisLen) {
// too long to be a suffix anyway
return false;
} else {
// move to the point in the buffer where we would expect the suffix to be
const char *ending = RStr->Bf + thisLen - len;
int cmp = strncmp(Str, ending, len);
return cmp == 0;
}
}


| bool TStr::IsSuffix | ( | const TStr & | Str | ) | const [inline] |
| bool TStr::IsUc | ( | ) | const [inline] |
| bool TStr::IsUInt | ( | const bool & | Check, |
| const uint & | MnVal, | ||
| const uint & | MxVal, | ||
| uint & | Val | ||
| ) | const |
Definition at line 1152 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), TCh::GetNum(), TCh::IsNum(), TCh::IsWs(), and TStrIn::New().
{
// parsing format {ws} [+]{ddd}
uint _Val=0;
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
if (Ch()=='+'){Ch.GetCh();}
if (!TCh::IsNum(Ch())){return false;}
_Val=TCh::GetNum(Ch());
while (TCh::IsNum(Ch.GetCh())){_Val=10*_Val+TCh::GetNum(Ch());}
if (Check&&((_Val<MnVal)||(_Val>MxVal))){return false;}
if (Ch.Eof()){Val=_Val; return true;} else {return false;}
}

| bool TStr::IsUInt | ( | uint & | Val | ) | const [inline] |
| bool TStr::IsUInt | ( | ) | const [inline] |
| bool TStr::IsUInt64 | ( | const bool & | Check, |
| const uint64 & | MnVal, | ||
| const uint64 & | MxVal, | ||
| uint64 & | Val | ||
| ) | const |
Definition at line 1204 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), TCh::GetNum(), TCh::IsNum(), TCh::IsWs(), and TStrIn::New().
{
// parsing format {ws} [+]{ddd}
uint64 _Val=0;
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
if (Ch()=='+'){Ch.GetCh();}
if (!TCh::IsNum(Ch())){return false;}
_Val=TCh::GetNum(Ch());
while (TCh::IsNum(Ch.GetCh())){_Val=10*_Val+TCh::GetNum(Ch());}
if (Check&&((_Val<MnVal)||(_Val>MxVal))){return false;}
if (Ch.Eof()){Val=_Val; return true;} else {return false;}
}

| bool TStr::IsUInt64 | ( | uint64 & | Val | ) | const [inline] |
Definition at line 595 of file dt.h.
References IsUInt64().
Referenced by IsUInt64().
{return IsUInt64(false, 0, 0, Val);}


| bool TStr::IsUInt64 | ( | ) | const [inline] |
Definition at line 596 of file dt.h.
References IsUInt64().
Referenced by GetUInt64(), and IsUInt64().


| bool TStr::IsWcMatch | ( | const int & | StrBChN, |
| const TStr & | WcStr, | ||
| const int & | WcStrBChN, | ||
| TStrV & | StarStrV, | ||
| const char & | StarCh = '*', |
||
| const char & | QuestCh = '?' |
||
| ) | const |
Definition at line 1286 of file dt.cpp.
References TVec< TVal >::Add(), GetCh(), and Len().
Referenced by GetWcMatch(), and IsWcMatch().
{
int StrLen=Len(); int WcStrLen=WcStr.Len();
int StrChN=StrBChN; int WcStrChN=WcStrBChN;
while ((StrChN<StrLen)&&(WcStrChN<WcStrLen)){
if ((WcStr[WcStrChN]==QuestCh)||(GetCh(StrChN)==WcStr[WcStrChN])){
StrChN++; WcStrChN++;
} else
if (WcStr[WcStrChN]==StarCh){
TChA StarChA; // string substituted by star character
for (int AfterStrChN=StrChN; AfterStrChN<=StrLen; AfterStrChN++){
if (AfterStrChN>StrChN){
StarChA+=GetCh(AfterStrChN-1);}
if (IsWcMatch(AfterStrChN, WcStr, WcStrChN+1, StarStrV, StarCh, QuestCh)){
StarStrV.Add(StarChA); return true;
}
}
return false;
} else {
return false;
}
}
if (StrChN==StrLen){
for (int AfterWcStrChN=WcStrChN; AfterWcStrChN<WcStrLen; AfterWcStrChN++){
if (WcStr[AfterWcStrChN]!=StarCh){return false;}}
return true;
} else {
return false;
}
}


| bool TStr::IsWcMatch | ( | const TStr & | WcStr, |
| TStrV & | StarStrV, | ||
| const char & | StarCh = '*', |
||
| const char & | QuestCh = '?' |
||
| ) | const |
Definition at line 1318 of file dt.cpp.
References IsWcMatch(), and TVec< TVal >::Reverse().
{
bool WcMatch=IsWcMatch(0, WcStr, 0, StarStrV, StarCh, QuestCh);
if (WcMatch){
StarStrV.Reverse();
return true;
} else {
return false;
}
}

| bool TStr::IsWcMatch | ( | const TStr & | WcStr, |
| const char & | StarCh, | ||
| const char & | QuestCh | ||
| ) | const |
Definition at line 1329 of file dt.cpp.
References IsWcMatch().

| bool TStr::IsWcMatch | ( | const TStr & | WcStr, |
| const int & | StarStrN, | ||
| TStr & | StarStr | ||
| ) | const |
Definition at line 1335 of file dt.cpp.
References IsWcMatch(), and TVec< TVal >::Len().
{
TStrV StarStrV;
if (IsWcMatch(WcStr, StarStrV)){
if (StarStrV.Len()>StarStrN){
StarStr=StarStrV[StarStrV.Len()-StarStrN-1];
} else {
StarStr="";
}
return true;
} else {
return false;
}
}

| bool TStr::IsWcMatch | ( | const TStr & | WcStr | ) | const |
Definition at line 1349 of file dt.cpp.
References IsWcMatch().

| bool TStr::IsWord | ( | const bool & | WsPrefixP = true, |
| const bool & | FirstUcAllowedP = true |
||
| ) | const |
Definition at line 1267 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), TCh::IsAlNum(), TCh::IsAlpha(), TCh::IsUc(), TCh::IsWs(), and TStrIn::New().
{
// parsing format {ws} (A-Z,a-z) *{A-Z,a-z,0-9}
TChRet Ch(TStrIn::New(*this));
if (WsPrefixP){while (TCh::IsWs(Ch.GetCh())){}}
else {Ch.GetCh();}
if (!TCh::IsAlpha(Ch())){return false;}
else if (!FirstUcAllowedP&&(TCh::IsUc(Ch()))){return false;}
while (TCh::IsAlNum(Ch.GetCh())){}
if (!Ch.Eof()){return false;}
return true;
}

| bool TStr::IsWs | ( | ) | const |
Definition at line 1279 of file dt.cpp.
References TChRet::Eof(), TChRet::GetCh(), TCh::IsWs(), and TStrIn::New().
{
// if string is just a bunch of whitespace chars
TChRet Ch(TStrIn::New(*this));
while (TCh::IsWs(Ch.GetCh())){}
return Ch.Eof();
}

| char TStr::LastCh | ( | ) | const [inline] |
Definition at line 477 of file dt.h.
References GetCh(), and Len().
Referenced by TEnv::GetIfArgPrefixBool(), TEnv::GetIfArgPrefixStr(), TStdNotify::OnStatus(), and TStdErrNotify::OnStatus().


| TStr TStr::Left | ( | const int & | EChN | ) | const [inline] |
| TStr TStr::LeftOf | ( | const char & | SplitCh | ) | const |
| TStr TStr::LeftOfLast | ( | const char & | SplitCh | ) | const |
| int TStr::Len | ( | ) | const [inline] |
Definition at line 480 of file dt.h.
References TRStr::Len(), and RStr.
Referenced by TJsonVal::AddEscapeChAFromStr(), TBigStrPool::AddStr(), TStrPool::AddStr(), TStrPool64::AddStr(), TTmProfiler::AddTimer(), TBlobBs::AssertVersionStr(), ChangeChAll(), ChangeStr(), ChangeStrAll(), anonymous_namespace{unicode.cpp}::CombinePath(), CountCh(), DelStr(), DelSubStr(), TMem::DoFitStr(), TSnap::DrawGViz(), FromHex(), TUrl::GetAbsFromBase(), TEnv::GetArgPostfix(), TBlobBs::GetBlobBsStateStr(), TBlobBs::GetBlockLenV(), GetCStr(), TUrl::GetDmNm(), TUrl::GetDocStrFromUrlStr(), TMacro::GetDstSubstStr(), TMacro::GetDstTxtStr(), TSecTm::GetDtTmFromDmyStr(), TSecTm::GetDtTmFromHmsStr(), TSecTm::GetDtTmFromMdyHmsPmStr(), TSecTm::GetDtTmFromMdyStr(), TSecTm::GetDtTmFromYmdHmsStr(), THtmlLxChDef::GetEscStr(), TEnv::GetExeFNm(), GetFBase(), GetFExt(), TBlobBs::GetFFreeBlobPtV(), GetFMid(), GetFPath(), THtmlTok::GetFullStr(), TEnv::GetIfArgPrefixBool(), TEnv::GetIfArgPrefixStr(), TEnv::GetIfArgPrefixStrV(), THttpChDef::GetLcStr(), TBlobBs::GetMxSegLen(), TUniChDb::TUcdFileReader::GetNextLine(), GetNrFMid(), GetNrFPath(), GetNrNumFExt(), TTypeNm< Type >::GetNrTypeNm(), TEnv::GetPrefixArgN(), TILx::GetQStr(), THttpResp::GetSIn(), TUrlLx::GetStr(), GetSubStr(), TTm::GetTmFromWebLogDateTimeStr(), TTm::GetTmFromWebLogTimeStr(), THtmlDoc::GetTxtLnDoc(), TLxChDef::GetUcStr(), TFile::GetUniqueFNm(), TUnicode::GetUtf8CaseFolded(), TAGM::GVizComGraph(), TUrlLxChDef::InclStr(), TUniChDb::InitLineBreaks(), InsStr(), TBigNet< TNodeData, IsDir >::InvertFromSources(), IsAbsFPath(), TEnv::IsEndOfRun(), THtmlTok::IsHTag(), TLxChDef::IsNmStr(), IsPrefix(), IsSuffix(), TWebPg::IsTxt(), THtmlTok::IsUrlTok(), IsWcMatch(), LastCh(), Left(), LeftOf(), LeftOfLast(), TUniChDb::LoadTxt(), TUniChDb::LoadTxt_ProcessDecomposition(), Mid(), TMem::operator+=(), TChA::operator+=(), TCon::operator<<(), TChA::operator=(), TUniChDb::TUcdFileReader::ParseCodePointRange(), TEnv::PrepArgs(), TTmProfiler::PrintReport(), TXmlLx::PutStr(), THtmlLx::PutStr(), TSOut::PutStr(), TFRnd::PutStr(), Right(), RightOf(), RightOfLast(), THtmlDoc::SaveHtmlToXml(), TMAGParam< TNodeAttr >::SaveTxt(), SaveTxt(), TUniChDb::SbEx_Add(), SearchCh(), SearchChBack(), TLxChDef::SetChTy(), THtmlLxChDef::SetChTy(), TXmlChDef::SetChTy(), THttpChDef::SetChTy(), THttpChDef::SetLcCh(), TLxChDef::SetUcCh(), THtmlLxChDef::SetUcCh(), Slice(), SplitOnAllAnyCh(), SplitOnAllCh(), SplitOnCh(), SplitOnLastCh(), SplitOnNonAlNum(), SplitOnStr(), SplitOnWs(), TMacro::SplitVarNm(), TChA::TChA(), TUniCodec::TestDecodeUtf16(), TUniCodec::TestDecodeUtf8(), TMacro::TMacro(), TMIn::TMIn(), ToHex(), ToTrunc(), TCodecBase::ToUnicode(), and T8BitCodec< TEncoding_ISO8859_3 >::ToUnicode().


| void TStr::Load | ( | TSIn & | SIn, |
| const bool & | IsSmall = false |
||
| ) | [inline] |
| static TStr TStr::LoadTxt | ( | const PSIn & | SIn | ) | [inline, static] |
| static TStr TStr::LoadTxt | ( | const TStr & | FNm | ) | [inline, static] |
| void TStr::LoadXml | ( | const PXmlTok & | XmlTok, |
| const TStr & | Nm | ||
| ) |
Definition at line 716 of file dt.cpp.
References TXmlTok::GetTokStr(), operator=(), and XLoadHd.

Definition at line 532 of file dt.h.
References GetSubStr().
{ return GetSubStr(BChN, BChN+Chs-1); }

| static TStr TStr::MkClone | ( | const TStr & | Str | ) | [inline, static] |
| bool TStr::operator!= | ( | const char * | CStr | ) | const [inline] |
| char* TStr::operator() | ( | ) | [inline] |
| const char* TStr::operator() | ( | ) | const [inline] |
| TStr TStr::operator() | ( | const int & | BChN, |
| const int & | EChNP1 | ||
| ) | const [inline] |
Definition at line 446 of file dt.h.
References TRStr::CStr(), TRStr::MkRef(), Optimize(), RStr, and TRStr::UnRef().
{
TRStr* NewRStr=new TRStr(RStr->CStr(), Str.RStr->CStr());
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
Optimize(); return *this;}

| TStr& TStr::operator+= | ( | const char * | CStr | ) | [inline] |
Definition at line 450 of file dt.h.
References TRStr::CStr(), CStr(), TRStr::MkRef(), Optimize(), RStr, and TRStr::UnRef().
{
TRStr* NewRStr=new TRStr(RStr->CStr(), CStr);
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
Optimize(); return *this;}

| bool TStr::operator< | ( | const TStr & | Str | ) | const [inline] |
Definition at line 440 of file dt.h.
References TChA::CStr(), GetRStr(), TRStr::MkRef(), RStr, and TRStr::UnRef().

| TStr& TStr::operator= | ( | const char * | CStr | ) | [inline] |
| TStr& TStr::operator= | ( | const char & | Ch | ) | [inline] |
Definition at line 444 of file dt.h.
References GetChStr(), TRStr::MkRef(), RStr, and TRStr::UnRef().

| bool TStr::operator== | ( | const TStr & | Str | ) | const [inline] |
| bool TStr::operator== | ( | const char * | CStr | ) | const [inline] |
| char TStr::operator[] | ( | const int & | ChN | ) | const [inline] |
| void TStr::Optimize | ( | ) | [private] |
Definition at line 705 of file dt.cpp.
References TRStr::CStr(), CStr(), TRStr::GetNullRStr(), TRStr::MkRef(), RStr, and TRStr::UnRef().
Referenced by ChangeChAll(), ConvUsFromYuAscii(), operator+=(), PutCh(), ToCap(), ToLc(), ToUc(), and TStr().
{
char* CStr=RStr->CStr(); int CStrLen=int(strlen(CStr));
TRStr* NewRStr;
if (CStrLen==0){NewRStr=TRStr::GetNullRStr();}
// next lines are not multi-threading safe
//else if (CStrLen==1){NewRStr=GetChStr(CStr[0]).RStr;}
//else if (CStrLen==2){NewRStr=GetDChStr(CStr[0], CStr[1]).RStr;}
else {NewRStr=RStr;}
NewRStr->MkRef(); RStr->UnRef(); RStr=NewRStr;
}


| void TStr::PutCh | ( | const int & | ChN, |
| const char & | Ch | ||
| ) | [inline] |
Definition at line 472 of file dt.h.
References TRStr::CStr(), TRStr::MkRef(), Optimize(), TRStr::PutCh(), RStr, and TRStr::UnRef().
Referenced by ChangeCh().
{
TRStr* NewRStr=new TRStr(RStr->CStr());
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
RStr->PutCh(ChN, Ch); Optimize();}


| TStr TStr::PutFBase | ( | const TStr & | FNm, |
| const TStr & | FBase | ||
| ) | [static] |
Definition at line 1486 of file dt.cpp.
References GetFPath().
{
return FNm.GetFPath()+FBase;
}

| TStr TStr::PutFBaseIfEmpty | ( | const TStr & | FNm, |
| const TStr & | FBase | ||
| ) | [static] |
Definition at line 1490 of file dt.cpp.
References Empty(), GetFBase(), and GetFPath().

| TStr TStr::PutFExt | ( | const TStr & | FNm, |
| const TStr & | FExt | ||
| ) | [static] |
| TStr TStr::PutFExtIfEmpty | ( | const TStr & | FNm, |
| const TStr & | FExt | ||
| ) | [static] |
| TStr TStr::Reverse | ( | ) | const [inline] |
Definition at line 560 of file dt.h.
References TChA::Reverse().
{
TChA ChA(*this); ChA.Reverse(); return ChA;}

| TStr TStr::Right | ( | const int & | BChN | ) | const [inline] |
| TStr TStr::RightOf | ( | const char & | SplitCh | ) | const |
| TStr TStr::RightOfLast | ( | const char & | SplitCh | ) | const |
| void TStr::Save | ( | TSOut & | SOut, |
| const bool & | IsSmall = false |
||
| ) | const [inline] |
Definition at line 433 of file dt.h.
References RStr, and TRStr::Save().
Referenced by TPpVal::Save(), TGStat::Save(), TPp::Save(), TNodeInfo::Save(), TExpHelpObj::Save(), TDbStr::Save(), and TFlt::Save().


| void TStr::SaveTxt | ( | const PSOut & | SOut | ) | const [inline] |
Definition at line 664 of file dt.h.
References CStr(), Len(), and TSOut::SaveBf().
Referenced by THtmlDoc::SaveHtmlToTxt(), and SaveTxt().


| void TStr::SaveTxt | ( | const TStr & | FNm | ) | const [inline] |
Definition at line 666 of file dt.h.
References TFOut::New(), and SaveTxt().
{
PSOut SOut=TFOut::New(FNm); SaveTxt(SOut);}

| void TStr::SaveXml | ( | TSOut & | SOut, |
| const TStr & | Nm | ||
| ) | const |
Definition at line 722 of file dt.cpp.
References Empty(), TXmlLx::GetXmlStrFromPlainStr(), TSOut::PutStr(), XSaveBETag, and XSaveHd.
{
TStr XmlStr=TXmlLx::GetXmlStrFromPlainStr(*this);
if (XmlStr.Empty()){XSaveBETag(Nm);}
else {XSaveHd(Nm); SOut.PutStr(XmlStr);}
}

| int TStr::SearchCh | ( | const char & | Ch, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 1019 of file dt.cpp.
References CStr(), TInt::GetMx(), and Len().
Referenced by ChangeCh(), ChangeChAll(), TFile::GetUniqueFNm(), TUrl::IsAbs(), IsChIn(), TUniChDb::LoadTxt_ProcessDecomposition(), TMacro::SplitVarNm(), and TNcpGraphsBase::TNcpGraphsBase().
{
int ThisLen=Len(); const char* ThisBf=CStr();
int ChN=TInt::GetMx(BChN, 0);
while (ChN<ThisLen){
if (ThisBf[ChN]==Ch){return ChN;}
ChN++;
}
return -1;
}


| int TStr::SearchChBack | ( | const char & | Ch, |
| int | BChN = -1 |
||
| ) | const |
Definition at line 1029 of file dt.cpp.
Referenced by TNcpGraphsBase::TNcpGraphsBase().
{
const int StrLen=Len();
if (BChN==-1||BChN>=StrLen){BChN=StrLen-1;}
const char* ThisBf=CStr();
const char* Pt=ThisBf + BChN;
while (Pt>=ThisBf) {
if (*Pt==Ch){return (int)(Pt-ThisBf);}
Pt--;
}
return -1;
}


| int TStr::SearchStr | ( | const TStr & | Str, |
| const int & | BChN = 0 |
||
| ) | const |
Definition at line 1041 of file dt.cpp.
References CStr(), and TInt::GetMx().
Referenced by ChangeStr(), DelStr(), TUrl::GetAbsFromBase(), IsStrIn(), TUniChDb::TUcdFileReader::ParseCodePointRange(), SplitOnStr(), and TNcpGraphsBase::TNcpGraphsBase().
{
int NrBChN=TInt::GetMx(BChN, 0);
const char* StrPt=strstr((const char*)CStr()+NrBChN, Str.CStr());
if (StrPt==NULL){return -1;}
else {return int(StrPt-CStr());}
/* // slow implementation
int ThisLen=Len(); int StrLen=Str.Len();
int ChN=TInt::GetMx(BChN, 0);
while (ChN<ThisLen-StrLen+1){
if (strncmp(CStr()+ChN, Str.CStr(), StrLen)==0){
return ChN;}
ChN++;
}
return -1;*/
}


| TStr TStr::Slice | ( | int | BChN, |
| int | EChNP1 | ||
| ) | const [inline] |
Definition at line 540 of file dt.h.
References GetSubStr(), and Len().
Referenced by operator()().
{ if(BChN<0){BChN=Len()+BChN;} if(EChNP1<=0){EChNP1=Len()+EChNP1;} return GetSubStr(BChN, EChNP1-1); }


| void TStr::SplitOnAllAnyCh | ( | const TStr & | SplitChStr, |
| TStrV & | StrV, | ||
| const bool & | SkipEmpty = true |
||
| ) | const |
Definition at line 920 of file dt.cpp.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), CStr(), forever, Len(), and TStr().
{
// reset string output-vector
StrV.Clr();
// prepare working-copy of string
char* Bf=new char[Len()+1];
strcpy(Bf, CStr());
char* CurStrBf=Bf; // pointer to current string
// prepare pointer to split-char-string
const char* SplitChBf=SplitChStr.CStr();
forever{
char* BfC=CurStrBf; // set the counter for working-string
while (*BfC!=0){
const char* SplitChBfC=SplitChBf; // set counter for split-char-string
while ((*SplitChBfC!=0)&&(*SplitChBfC!=*BfC)){SplitChBfC++;}
if (*SplitChBfC!=0){break;} // if split-char found
BfC++;
}
bool IsEnd=(*BfC==0);
*BfC=0;
if ((BfC>CurStrBf)||(!SkipEmpty)){StrV.Add(TStr(CurStrBf));}
if (IsEnd){break;}
CurStrBf=BfC+1;
}
// delete working-copy
delete[] Bf;
}

| void TStr::SplitOnAllCh | ( | const char & | SplitCh, |
| TStrV & | StrV, | ||
| const bool & | SkipEmpty = true |
||
| ) | const |
Definition at line 902 of file dt.cpp.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), CStr(), forever, Len(), and TStr().
Referenced by TNetInfBs::AddCasc(), TNIBs::AddCasc(), TNIBs::BSG(), THttpResp::GetCookieKeyValDmPathQuV(), TMAGAffMtx::GetMtx(), TKronMtx::GetMtx(), TUniChDb::TUcdFileReader::GetNextLine(), TUrl::GetTopDownDocNm(), TUInt::GetUIntFromIpStr(), TUInt::IsIpStr(), TTimeNet::LoadAmazon(), TNetInfBs::LoadCascadesTxt(), TNIBs::LoadCascadesTxt(), TNIBs::LoadGroundTruthNodesTxt(), TNetInfBs::LoadGroundTruthTxt(), TNIBs::LoadGroundTruthTxt(), TNIBs::LoadInferredNodesTxt(), TNIBs::LoadInferredTxt(), TTimeNet::LoadPatents(), TUniChDb::SbEx_AddMulti(), TNIBs::SG(), and TEnv::TEnv().
{
StrV.Clr();
char* Bf=new char[Len()+1];
strcpy(Bf, CStr());
char* CurStrBf=Bf;
forever{
char* BfC=CurStrBf;
while ((*BfC!=0)&&(*BfC!=SplitCh)){BfC++;}
bool IsEnd=(*BfC=='\0');
*BfC=0;
if ((BfC>CurStrBf)||(!SkipEmpty)){StrV.Add(TStr(CurStrBf));}
if (IsEnd){break;}
CurStrBf=BfC+1;
}
delete[] Bf;
}


| void TStr::SplitOnCh | ( | TStr & | LStr, |
| const char & | SplitCh, | ||
| TStr & | RStr | ||
| ) | const |
Definition at line 877 of file dt.cpp.
References CStr(), GetSubStr(), and Len().
Referenced by TPp::GetPp(), TXmlTok::GetTagTok(), TXmlDoc::GetTagTok(), TEnv::GetVarNmV(), and TTimeNet::LoadPatents().
{
int ThisLen=Len(); const char* ThisBf=CStr();
int ChN=0;
while ((ChN<ThisLen)&&(ThisBf[ChN]!=SplitCh)){ChN++;}
if (ChN==ThisLen){
LStr=GetSubStr(0, ThisLen-1); RStr="";
} else {
LStr=GetSubStr(0, ChN-1); RStr=GetSubStr(ChN+1, ThisLen-1);
}
}


| void TStr::SplitOnLastCh | ( | TStr & | LStr, |
| const char & | SplitCh, | ||
| TStr & | RStr | ||
| ) | const |
Definition at line 888 of file dt.cpp.
References CStr(), GetSubStr(), and Len().
Referenced by TXmlTok::GetTagTokV(), and TXmlDoc::GetTagTokV().
{
int ThisLen=Len(); const char* ThisBf=CStr();
int ChN=Len()-1;
while ((ChN>=0)&&(ThisBf[ChN]!=SplitCh)){ChN--;}
if (ChN==-1){
LStr=""; RStr=*this;
} else
if (ChN==0){
LStr=""; RStr=GetSubStr(1, ThisLen-1);
} else {
LStr=GetSubStr(0, ChN-1); RStr=GetSubStr(ChN+1, ThisLen-1);
}
}


| void TStr::SplitOnNonAlNum | ( | TStrV & | StrV | ) | const |
Definition at line 966 of file dt.cpp.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), CStr(), forever, TCh::IsAlNum(), Len(), and TStr().
Referenced by TUrl::GetDocStrFromUrlStr().
{
StrV.Clr();
char* Bf=new char[Len()+1];
strcpy(Bf, CStr());
char* StrBf=Bf;
forever{
while ((*StrBf!=0)&&(!TCh::IsAlNum(*StrBf))){StrBf++;}
char* BfC=StrBf;
while ((*BfC!=0)&&(TCh::IsAlNum(*BfC))){BfC++;}
bool IsEnd=(*BfC=='\0');
*BfC=0;
if (BfC>StrBf){StrV.Add(TStr(StrBf));}
if (IsEnd){break;}
StrBf=BfC+1;
}
delete[] Bf;
}


| void TStr::SplitOnStr | ( | const TStr & | SplitStr, |
| TStrV & | StrV | ||
| ) | const |
Definition at line 984 of file dt.cpp.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), GetSubStr(), Len(), and SearchStr().
Referenced by THtmlTok::IsUrlTok().
{
StrV.Clr();
int SplitStrLen=SplitStr.Len();
int PrevChN=0; int ChN=0;
while ((ChN=SearchStr(SplitStr, ChN))!=-1){
// extract & add string
TStr SubStr=GetSubStr(PrevChN, ChN-1);
StrV.Add(SubStr);
PrevChN=ChN=ChN+SplitStrLen;
}
// add last string
TStr LastSubStr=GetSubStr(PrevChN, Len()-1);
StrV.Add(LastSubStr);
}


| void TStr::SplitOnStr | ( | TStr & | LeftStr, |
| const TStr & | MidStr, | ||
| TStr & | RightStr | ||
| ) | const |
Definition at line 999 of file dt.cpp.
References GetNullStr(), GetSubStr(), Len(), and SearchStr().
{
const int ChN=SearchStr(MidStr);
if (ChN==-1){
LeftStr=*this; RightStr=GetNullStr();
} else {
LeftStr=GetSubStr(0, ChN-1);
RightStr=GetSubStr(ChN+MidStr.Len(), Len()-1);
}
}

| void TStr::SplitOnWs | ( | TStrV & | StrV | ) | const |
Definition at line 948 of file dt.cpp.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), CStr(), forever, TCh::IsWs(), Len(), and TStr().
Referenced by TZipIn::GetFLen(), TTimeNet::LoadArxiv(), TUniChDb::TUcdFileReader::ParseCodePointList(), TUnicode::RegisterCodec(), and TUnicode::UnregisterCodec().
{
StrV.Clr();
char* Bf=new char[Len()+1];
strcpy(Bf, CStr());
char* StrBf=Bf;
forever{
while ((*StrBf!=0)&&(TCh::IsWs(*StrBf))){StrBf++;}
char* BfC=StrBf;
while ((*BfC!=0)&&(!TCh::IsWs(*BfC))){BfC++;}
bool IsEnd=(*BfC=='\0');
*BfC=0;
if (BfC>StrBf){StrV.Add(TStr(StrBf));}
if (IsEnd){break;}
StrBf=BfC+1;
}
delete[] Bf;
}


| TStr & TStr::ToCap | ( | ) |
Definition at line 740 of file dt.cpp.
References TRStr::CStr(), TRStr::MkRef(), Optimize(), RStr, TRStr::ToCap(), and TRStr::UnRef().
Referenced by TSecTm::GetDtTmFromDmyStr().
{
TRStr* NewRStr=new TRStr(RStr->CStr()); NewRStr->ToCap();
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
Optimize(); return *this;
}


| TStr & TStr::ToHex | ( | ) |
Definition at line 761 of file dt.cpp.
References TRStr::Bf, TCh::GetHexCh(), Len(), and RStr.
{
TChA ChA;
int StrLen=Len();
for (int ChN=0; ChN<StrLen; ChN++){
uchar Ch=uchar(RStr->Bf[ChN]);
char MshCh=TCh::GetHexCh((Ch/16)%16);
char LshCh=TCh::GetHexCh(Ch%16);
ChA+=MshCh; ChA+=LshCh;
}
*this=ChA;
return *this;
}

| TStr & TStr::ToLc | ( | ) |
Definition at line 734 of file dt.cpp.
References TRStr::CStr(), TRStr::MkRef(), Optimize(), RStr, TRStr::ToLc(), and TRStr::UnRef().
Referenced by TUrl::ToLcPath().
{
TRStr* NewRStr=new TRStr(RStr->CStr()); NewRStr->ToLc();
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
Optimize(); return *this;
}


| TStr & TStr::ToTrunc | ( | ) |
Definition at line 746 of file dt.cpp.
References CStr(), GetSubStr(), TCh::IsWs(), and Len().
Referenced by THttpResp::GetCookieKeyValDmPathQuV(), TUniChDb::TUcdFileReader::GetNextLine(), TUniChDb::LoadTxt_ProcessDecomposition(), and TUrl::TUrl().
{
int ThisLen=Len(); char* ThisBf=CStr();
int BChN=0; int EChN=ThisLen-1;
while ((BChN<ThisLen)&&TCh::IsWs(ThisBf[BChN])){BChN++;}
while ((EChN>=0)&&TCh::IsWs(ThisBf[EChN])){EChN--;}
*this=GetSubStr(BChN, EChN);
return *this;
}


| TStr & TStr::ToUc | ( | ) |
Definition at line 728 of file dt.cpp.
References TRStr::CStr(), TRStr::MkRef(), Optimize(), RStr, TRStr::ToUc(), and TRStr::UnRef().
Referenced by TFFile::TFFile().
{
TRStr* NewRStr=new TRStr(RStr->CStr()); NewRStr->ToUc();
RStr->UnRef(); RStr=NewRStr; RStr->MkRef();
Optimize(); return *this;
}


TRStr* TStr::RStr [private] |
Definition at line 407 of file dt.h.
Referenced by ChangeChAll(), Clr(), ConvUsFromYuAscii(), CStr(), Empty(), FromHex(), GetCh(), GetMemUsed(), GetPrimHashCd(), GetSecHashCd(), IsLc(), IsPrefix(), IsSuffix(), IsUc(), Len(), operator!=(), operator()(), operator+=(), operator<(), operator=(), operator==(), operator[](), Optimize(), PutCh(), Save(), ToCap(), ToHex(), ToLc(), ToUc(), TStr(), and ~TStr().