SNAP Library 2.0, User Reference  2013-05-13 16:33:57
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
wch.cpp
Go to the documentation of this file.
00001 
00002 // Wide-Char
00003 const TWCh TWCh::Mn(0, 0);
00004 const TWCh TWCh::Mx(0xFF, 0xFF);
00005 const int TWCh::Vals=0x10000;
00006 
00007 const TWCh TWCh::StartWCh(0xFE, 0xFF);
00008 const TWCh TWCh::TabWCh(TCh::TabCh);
00009 const TWCh TWCh::LfWCh(TCh::LfCh);
00010 const TWCh TWCh::CrWCh(TCh::CrCh);
00011 const TWCh TWCh::SpaceWCh(' ');
00012 
00014 // Wide-Char-Array
00015 void TWChA::AddCStr(const char* CStr){
00016   int CStrLen=int(strlen(CStr));
00017   for (int ChN=0; ChN<CStrLen; ChN++){
00018     WChV.Add(TWCh(CStr[ChN]));}
00019 }
00020 
00021 void TWChA::PutCStr(const char* CStr){
00022   int CStrLen=int(strlen(CStr));
00023   WChV.Gen(CStrLen, 0);
00024   for (int ChN=0; ChN<CStrLen; ChN++){
00025     WChV.Add(TWCh(CStr[ChN]));}
00026 }
00027 
00028 TStr TWChA::GetStr() const {
00029   TChA ChA;
00030   for (int WChN=0; WChN<WChV.Len(); WChN++){
00031     ChA+=WChV[WChN].GetCh();}
00032   return ChA;
00033 }
00034 
00035 void TWChA::LoadTxt(const PSIn& SIn, TWChA& WChA){
00036   WChA.Clr();
00037   TWCh WCh=TWCh::LoadTxt(SIn);
00038   IAssert(WCh==TWCh::StartWCh);
00039   while (!SIn->Eof()){
00040     WChA+=TWCh::LoadTxt(SIn);}
00041 }
00042 
00043 void TWChA::SaveTxt(const PSOut& SOut) const {
00044   TWCh::StartWCh.SaveTxt(SOut);
00045   for (int WChN=0; WChN<WChV.Len(); WChN++){
00046     WChV[WChN].SaveTxt(SOut);}
00047 }
00048 
00049 TWChA TWChA::EmptyWChA;
00050