SNAP Library , User Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <unicode.h>
Public Member Functions | |
TUcdFileReader () | |
TUcdFileReader (const TStr &fileName) | |
void | Open (const TStr &fileName) |
void | Close () |
~TUcdFileReader () | |
bool | GetNextLine (TStrV &dest) |
Static Public Member Functions | |
static int | ParseCodePoint (const TStr &s) |
static void | ParseCodePointList (const TStr &s, TIntV &dest, bool ClrDestP=true) |
static void | ParseCodePointRange (const TStr &s, int &from, int &to) |
Public Attributes | |
TChA | comment |
Protected Member Functions | |
int | GetCh () |
void | PutBack (int c) |
bool | ReadNextLine () |
Protected Attributes | |
TChA | buf |
FILE * | f |
int | putBackCh |
Private Member Functions | |
TUcdFileReader & | operator= (const TUcdFileReader &r) |
TUcdFileReader (const TUcdFileReader &r) |
TUniChDb::TUcdFileReader::TUcdFileReader | ( | const TUcdFileReader & | r | ) | [inline, private] |
TUniChDb::TUcdFileReader::TUcdFileReader | ( | ) | [inline] |
TUniChDb::TUcdFileReader::TUcdFileReader | ( | const TStr & | fileName | ) | [inline] |
TUniChDb::TUcdFileReader::~TUcdFileReader | ( | ) | [inline] |
void TUniChDb::TUcdFileReader::Close | ( | ) | [inline] |
int TUniChDb::TUcdFileReader::GetCh | ( | ) | [inline, protected] |
bool TUniChDb::TUcdFileReader::GetNextLine | ( | TStrV & | dest | ) | [inline] |
Definition at line 1685 of file unicode.h.
{ dest.Clr(); while (true) { if (! ReadNextLine()) return false; TStr line = buf; line.ToTrunc(); if (line.Len() <= 0) continue; line.SplitOnAllCh(';', dest, false); for (int i = 0; i < dest.Len(); i++) dest[i].ToTrunc(); return true; }}
void TUniChDb::TUcdFileReader::Open | ( | const TStr & | fileName | ) | [inline] |
TUcdFileReader& TUniChDb::TUcdFileReader::operator= | ( | const TUcdFileReader & | r | ) | [inline, private] |
Definition at line 1677 of file unicode.h.
{ Fail; return *((TUcdFileReader *) 0); }
static int TUniChDb::TUcdFileReader::ParseCodePoint | ( | const TStr & | s | ) | [inline, static] |
static void TUniChDb::TUcdFileReader::ParseCodePointList | ( | const TStr & | s, |
TIntV & | dest, | ||
bool | ClrDestP = true |
||
) | [inline, static] |
static void TUniChDb::TUcdFileReader::ParseCodePointRange | ( | const TStr & | s, |
int & | from, | ||
int & | to | ||
) | [inline, static] |
Definition at line 1702 of file unicode.h.
{ // xxxx or xxxx..yyyy int i = s.SearchStr(".."); if (i < 0) { from = ParseCodePoint(s); to = from; return; } from = ParseCodePoint(s.GetSubStr(0, i - 1)); to = ParseCodePoint(s.GetSubStr(i + 2, s.Len() - 1)); }
void TUniChDb::TUcdFileReader::PutBack | ( | int | c | ) | [inline, protected] |
bool TUniChDb::TUcdFileReader::ReadNextLine | ( | ) | [inline, protected] |
Definition at line 1662 of file unicode.h.
{ buf.Clr(); comment.Clr(); bool inComment = false, first = true; while (true) { int c = GetCh(); if (c == EOF) return ! first; else if (c == 13) { c = GetCh(); if (c != 10) PutBack(c); return true; } else if (c == 10) return true; else if (c == '#') inComment = true; if (! inComment) buf += char(c); else comment += char(c); } /*first = false;*/}
TChA TUniChDb::TUcdFileReader::buf [protected] |
FILE* TUniChDb::TUcdFileReader::f [protected] |
int TUniChDb::TUcdFileReader::putBackCh [protected] |