SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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.

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:547
char * CStr()
Definition: dt.h:476
TStr anonymous_namespace{unicode.cpp}::CombinePath ( const TStr s,
const TStr t 
)

Definition at line 32 of file unicode.cpp.

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

Variable Documentation

TVectorBuilder anonymous_namespace{unicode.cpp}::VB

Definition at line 30 of file unicode.cpp.