SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
anonymous_namespace{unicode.cpp} Namespace Reference

Classes

class  TVectorBuilder
 
class  TVectorBuilder2
 

Functions

TStr CombinePath (const TStr &s, const TStr &t)
 
void AssertEq (const TIntV &v1, const TIntV &v2, const TStr &explanation, FILE *f)
 

Variables

TVectorBuilder VB
 

Function Documentation

void anonymous_namespace{unicode.cpp}::AssertEq ( const TIntV v1,
const TIntV v2,
const TStr explanation,
FILE *  f 
)

Definition at line 39 of file unicode.cpp.

References TStr::CStr(), Fail, and TVec< TVal, TSizeTy >::Len().

40 {
41  const int n = v1.Len();
42  bool ok = (n == v2.Len());
43  if (ok) for (int i = 0; i < n && ok; i++) ok = ok && (v1[i] == v2[i]);
44  if (! ok)
45  {
46  if (! f) f = stderr;
47  fprintf(f, "%s: [", explanation.CStr());
48  for (int i = 0; i < v1.Len(); i++) fprintf(f, "%s%04x", (i == 0 ? "" : " "), int(v1[i]));
49  fprintf(f, "] != [");
50  for (int i = 0; i < v2.Len(); i++) fprintf(f, "%s%04x", (i == 0 ? "" : " "), int(v2[i]));
51  fprintf(f, "]\n");
52  Fail;
53  }
54 }
#define Fail
Definition: bd.h:238
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
char * CStr()
Definition: dt.h:476

Here is the call graph for this function:

TStr anonymous_namespace{unicode.cpp}::CombinePath ( const TStr s,
const TStr t 
)

Definition at line 32 of file unicode.cpp.

References TStr::Len().

Referenced by TUniChDb::InitDerivedCoreProperties(), TUniChDb::InitLineBreaks(), TUniChDb::InitPropList(), TUniChDb::InitScripts(), TUniChDb::InitSpecialCasing(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TUniChDb::LoadTxt(), TUniChDb::Test(), TUniChDb::TestComposition(), and TUniChDb::TestFindNextWordOrSentenceBoundary().

33 {
34  int n = s.Len(); if (n <= 0) return t;
35  if (s[n - 1] == '\\' || s[n - 1] == '/' || s[n - 1] == ':') return s + t;
36  return s + "\\" + t;
37 }
int Len() const
Definition: dt.h:487

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

TVectorBuilder anonymous_namespace{unicode.cpp}::VB