SNAP Library 2.1, Developer Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TWChA Class Reference

#include <wch.h>

Collaboration diagram for TWChA:

List of all members.

Public Member Functions

 TWChA (const int &MxWChs=0)
 TWChA (const TWChA &WChA)
 TWChA (const TWChV &_WChV)
 TWChA (const char *CStr)
 TWChA (const TChA &ChA)
 TWChA (const TStr &Str)
 ~TWChA ()
 TWChA (TSIn &SIn)
void Save (TSOut &SOut)
TWChAoperator= (const TWChA &WChA)
TWChAoperator= (const char *CStr)
TWChAoperator= (const TChA &ChA)
TWChAoperator= (const TStr &Str)
bool operator== (const TWChA &WChA) const
bool operator== (const char *CStr) const
TWChAoperator+= (const char &Ch)
TWChAoperator+= (const TWCh &WCh)
TWChAoperator+= (const char *CStr)
TWChAoperator+= (const TChA &ChA)
TWChAoperator+= (const TStr &Str)
TWChAoperator+= (const TWChA &WChA)
TWCh operator[] (const int &ChN) const
int GetMemUsed ()
void Clr ()
int Len () const
bool Empty () const
TStr GetStr () const
void GetSubWChA (const int &BChN, const int &EChN, TWChA &WChA) const
void InsStr (const int &BChN, const TStr &Str)
void DelSubStr (const int &BChN, const int &EChN)
bool DelStr (const TStr &Str)
void SplitOnCh (TStr &LStr, const char &SplitCh, TStr &RStr) const
int SearchCh (const TWCh &WCh, const int &BChN=0) const
int SearchStr (const TWChA &WChA, const int &BChN=0) const
bool IsChIn (const char &Ch) const
bool IsStrIn (const TWChA &WChA) const
bool IsPrefix (const TWChA &WChA) const
bool IsSufix (const TWChA &WChA) const
int ChangeStr (const TStr &SrcStr, const TStr &DstStr, const int &BChN=0)
int ChangeStrAll (const TStr &SrcStr, const TStr &DstStr)
void SaveTxt (const PSOut &SOut) const

Static Public Member Functions

static void LoadTxt (const PSIn &SIn, TWChA &WChA)

Static Public Attributes

static TWChA EmptyWChA

Private Member Functions

void AddCStr (const char *CStr)
void PutCStr (const char *CStr)

Private Attributes

TWChV WChV

Detailed Description

Definition at line 52 of file wch.h.


Constructor & Destructor Documentation

TWChA::TWChA ( const int &  MxWChs = 0) [inline]

Definition at line 58 of file wch.h.

: WChV(MxWChs, 0){}
TWChA::TWChA ( const TWChA WChA) [inline]

Definition at line 59 of file wch.h.

: WChV(WChA.WChV){}
TWChA::TWChA ( const TWChV _WChV) [inline]

Definition at line 60 of file wch.h.

: WChV(_WChV){}
TWChA::TWChA ( const char *  CStr) [inline]

Definition at line 61 of file wch.h.

References PutCStr().

: WChV(){PutCStr(CStr);}

Here is the call graph for this function:

TWChA::TWChA ( const TChA ChA) [inline]

Definition at line 62 of file wch.h.

References TChA::CStr(), and PutCStr().

: WChV(){PutCStr(ChA.CStr());}

Here is the call graph for this function:

TWChA::TWChA ( const TStr Str) [inline]

Definition at line 63 of file wch.h.

References TStr::CStr(), and PutCStr().

: WChV(){PutCStr(Str.CStr());}

Here is the call graph for this function:

TWChA::~TWChA ( ) [inline]

Definition at line 64 of file wch.h.

{}
TWChA::TWChA ( TSIn SIn) [inline]

Definition at line 65 of file wch.h.

: WChV(SIn){}

Member Function Documentation

void TWChA::AddCStr ( const char *  CStr) [private]

Definition at line 15 of file wch.cpp.

References TVec< TVal, TSizeTy >::Add(), and WChV.

Referenced by operator+=().

                                   {
  int CStrLen=int(strlen(CStr));
  for (int ChN=0; ChN<CStrLen; ChN++){
    WChV.Add(TWCh(CStr[ChN]));}
}

Here is the call graph for this function:

Here is the caller graph for this function:

int TWChA::ChangeStr ( const TStr SrcStr,
const TStr DstStr,
const int &  BChN = 0 
)
int TWChA::ChangeStrAll ( const TStr SrcStr,
const TStr DstStr 
)
void TWChA::Clr ( ) [inline]

Definition at line 84 of file wch.h.

References TVec< TVal, TSizeTy >::Clr(), and WChV.

Referenced by LoadTxt().

{WChV.Clr();}

Here is the call graph for this function:

Here is the caller graph for this function:

bool TWChA::DelStr ( const TStr Str)
void TWChA::DelSubStr ( const int &  BChN,
const int &  EChN 
)
bool TWChA::Empty ( ) const [inline]

Definition at line 86 of file wch.h.

References TVec< TVal, TSizeTy >::Empty(), and WChV.

{return WChV.Empty();}

Here is the call graph for this function:

int TWChA::GetMemUsed ( ) [inline]

Definition at line 82 of file wch.h.

References TVec< TVal, TSizeTy >::GetMemUsed(), and WChV.

{return WChV.GetMemUsed();}

Here is the call graph for this function:

TStr TWChA::GetStr ( ) const

Definition at line 28 of file wch.cpp.

References TVec< TVal, TSizeTy >::Len(), and WChV.

Referenced by operator==().

                         {
  TChA ChA;
  for (int WChN=0; WChN<WChV.Len(); WChN++){
    ChA+=WChV[WChN].GetCh();}
  return ChA;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TWChA::GetSubWChA ( const int &  BChN,
const int &  EChN,
TWChA WChA 
) const [inline]

Definition at line 89 of file wch.h.

References TVec< TVal, TSizeTy >::GetSubValV(), and WChV.

                                                                       {
    WChV.GetSubValV(BChN, EChN, WChA.WChV);}

Here is the call graph for this function:

void TWChA::InsStr ( const int &  BChN,
const TStr Str 
)
bool TWChA::IsChIn ( const char &  Ch) const [inline]

Definition at line 100 of file wch.h.

References SearchCh().

{return SearchCh(Ch)!=-1;}

Here is the call graph for this function:

bool TWChA::IsPrefix ( const TWChA WChA) const [inline]

Definition at line 102 of file wch.h.

References TVec< TVal, TSizeTy >::GetSubValV(), Len(), and WChV.

                                         {
    TWChV SubWChV; WChV.GetSubValV(0, WChA.Len()-1, SubWChV);
    return SubWChV==WChA.WChV;}

Here is the call graph for this function:

bool TWChA::IsStrIn ( const TWChA WChA) const [inline]

Definition at line 101 of file wch.h.

References SearchStr().

{return SearchStr(WChA)!=-1;}

Here is the call graph for this function:

bool TWChA::IsSufix ( const TWChA WChA) const [inline]

Definition at line 105 of file wch.h.

References TVec< TVal, TSizeTy >::GetSubValV(), Len(), and WChV.

                                        {
    TWChV SubWChV; WChV.GetSubValV(Len()-WChA.Len(), Len()-1, SubWChV);
    return SubWChV==WChA.WChV;}

Here is the call graph for this function:

int TWChA::Len ( ) const [inline]

Definition at line 85 of file wch.h.

References TVec< TVal, TSizeTy >::Len(), and WChV.

Referenced by IsPrefix(), and IsSufix().

{return WChV.Len();}

Here is the call graph for this function:

Here is the caller graph for this function:

void TWChA::LoadTxt ( const PSIn SIn,
TWChA WChA 
) [static]

Definition at line 35 of file wch.cpp.

References Clr(), TSIn::Eof(), IAssert, and TWCh::StartWCh.

                                               {
  WChA.Clr();
  TWCh WCh=TWCh::LoadTxt(SIn);
  IAssert(WCh==TWCh::StartWCh);
  while (!SIn->Eof()){
    WChA+=TWCh::LoadTxt(SIn);}
}

Here is the call graph for this function:

TWChA& TWChA::operator+= ( const char &  Ch) [inline]

Definition at line 75 of file wch.h.

References TVec< TVal, TSizeTy >::Add(), and WChV.

{WChV.Add(TWCh(Ch)); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator+= ( const TWCh WCh) [inline]

Definition at line 76 of file wch.h.

References TVec< TVal, TSizeTy >::Add(), and WChV.

{WChV.Add(WCh); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator+= ( const char *  CStr) [inline]

Definition at line 77 of file wch.h.

References AddCStr().

{AddCStr(CStr); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator+= ( const TChA ChA) [inline]

Definition at line 78 of file wch.h.

References AddCStr(), and TChA::CStr().

{AddCStr(ChA.CStr()); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator+= ( const TStr Str) [inline]

Definition at line 79 of file wch.h.

References AddCStr(), and TStr::CStr().

{AddCStr(Str.CStr()); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator+= ( const TWChA WChA) [inline]

Definition at line 80 of file wch.h.

References TVec< TVal, TSizeTy >::AddV(), and WChV.

{WChV.AddV(WChA.WChV); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator= ( const TWChA WChA) [inline]

Definition at line 68 of file wch.h.

References WChV.

                                     {
    if (this!=&WChA){WChV=WChA.WChV;} return *this;}
TWChA& TWChA::operator= ( const char *  CStr) [inline]

Definition at line 70 of file wch.h.

References PutCStr().

{PutCStr(CStr); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator= ( const TChA ChA) [inline]

Definition at line 71 of file wch.h.

References TChA::CStr(), and PutCStr().

{PutCStr(ChA.CStr()); return *this;}

Here is the call graph for this function:

TWChA& TWChA::operator= ( const TStr Str) [inline]

Definition at line 72 of file wch.h.

References TStr::CStr(), and PutCStr().

{PutCStr(Str.CStr()); return *this;}

Here is the call graph for this function:

bool TWChA::operator== ( const TWChA WChA) const [inline]

Definition at line 73 of file wch.h.

References WChV.

{return WChV==WChA.WChV;}
bool TWChA::operator== ( const char *  CStr) const [inline]

Definition at line 74 of file wch.h.

References GetStr().

{return strcmp(GetStr().CStr(), CStr)!=0;}

Here is the call graph for this function:

TWCh TWChA::operator[] ( const int &  ChN) const [inline]

Definition at line 81 of file wch.h.

References WChV.

{return WChV[ChN];}
void TWChA::PutCStr ( const char *  CStr) [private]

Definition at line 21 of file wch.cpp.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Gen(), and WChV.

Referenced by operator=(), and TWChA().

                                   {
  int CStrLen=int(strlen(CStr));
  WChV.Gen(CStrLen, 0);
  for (int ChN=0; ChN<CStrLen; ChN++){
    WChV.Add(TWCh(CStr[ChN]));}
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TWChA::Save ( TSOut SOut) [inline]

Definition at line 66 of file wch.h.

References TVec< TVal, TSizeTy >::Save(), and WChV.

{WChV.Save(SOut);}

Here is the call graph for this function:

void TWChA::SaveTxt ( const PSOut SOut) const

Definition at line 43 of file wch.cpp.

References TVec< TVal, TSizeTy >::Len(), TWCh::SaveTxt(), TWCh::StartWCh, and WChV.

                                           {
  TWCh::StartWCh.SaveTxt(SOut);
  for (int WChN=0; WChN<WChV.Len(); WChN++){
    WChV[WChN].SaveTxt(SOut);}
}

Here is the call graph for this function:

int TWChA::SearchCh ( const TWCh WCh,
const int &  BChN = 0 
) const [inline]

Definition at line 96 of file wch.h.

References TVec< TVal, TSizeTy >::SearchForw(), and WChV.

Referenced by IsChIn().

                                                         {
    return WChV.SearchForw(WCh, BChN);}

Here is the call graph for this function:

Here is the caller graph for this function:

int TWChA::SearchStr ( const TWChA WChA,
const int &  BChN = 0 
) const [inline]

Definition at line 98 of file wch.h.

References TVec< TVal, TSizeTy >::SearchVForw(), and WChV.

Referenced by IsStrIn().

                                                            {
    return WChV.SearchVForw(WChA.WChV, BChN);}

Here is the call graph for this function:

Here is the caller graph for this function:

void TWChA::SplitOnCh ( TStr LStr,
const char &  SplitCh,
TStr RStr 
) const

Member Data Documentation

Definition at line 114 of file wch.h.


The documentation for this class was generated from the following files: