| 
    SNAP Library 2.0, Developer Reference
    2013-05-13 16:33:57
    
   SNAP, a general purpose, high performance system for analysis and manipulation of large networks 
   | 
  
  
  
 
#include <console.h>
Public Member Functions | |
| TCon () | |
| ~TCon () | |
| int | PutCh (const int &Ch) | 
| void | PutBf (const void *LBf, const int &LBfL) | 
| void | Flush () | 
| TCon & | operator<< (const bool &Bool) | 
| TCon & | operator<< (const uchar &UCh) | 
| TCon & | operator<< (const char &Ch) | 
| TCon & | operator<< (const int &Int) | 
| TCon & | operator<< (const uint &Int) | 
| TCon & | operator<< (const short &Sh) | 
| TCon & | operator<< (const ushort &USh) | 
| TCon & | operator<< (const float &Flt) | 
| TCon & | operator<< (const double &Double) | 
| TCon & | operator<< (const long double &LDouble) | 
| TCon & | operator<< (const char *CStr) | 
| TCon & | operator<< (const TStr &Str) | 
| TCon & | operator<< (const TChA &ChA) | 
| TCon & | operator<< (const TConManip &Mnp) | 
| TCon & | operator<< (TCon &(*FuncPt)(TCon &)) | 
| void | operator() (const char *FmtStr,...) | 
Private Member Functions | |
| TCon (const TCon &) | |
| TCon & | operator= (const TCon &) | 
| TCon::TCon | ( | const TCon & | ) |  [private] | 
        
| TCon::TCon | ( | ) | 
Definition at line 3 of file console.cpp.
References IAssert.
           {
#if defined (GLib_CreateConsole)
  Ok = (AllocConsole() != 0);
  HStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
  IAssert(HStdOut != INVALID_HANDLE_VALUE);
#endif
}
| TCon::~TCon | ( | ) | 
Definition at line 11 of file console.cpp.
References IAssert.
            {
#if defined (GLib_CreateConsole)
  if (Ok) IAssert(FreeConsole());
#endif
}
| void TCon::Flush | ( | ) |  [inline] | 
        
| void TCon::operator() | ( | const char * | FmtStr, | 
| ... | |||
| ) | 
Definition at line 65 of file console.cpp.
References PutBf().
                                                {
  static char Bf [2048];
  va_list valist;  va_start(valist, FmtStr);
  int BfL=vsnprintf(Bf, 2048, FmtStr, valist); va_end(valist);
  if (BfL!=-1){PutBf((void *) Bf, BfL);}
  else {PutBf((void *) Bf, 2048);}
}

| TCon& TCon::operator<< | ( | const bool & | Bool | ) |  [inline] | 
        
| TCon& TCon::operator<< | ( | const char & | Ch | ) |  [inline] | 
        
| TCon & TCon::operator<< | ( | const int & | Int | ) | 
Definition at line 29 of file console.cpp.
References PutBf().
                                       {
  char Bf[255];
  sprintf(Bf, "%d", Int);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

Definition at line 36 of file console.cpp.
References PutBf().
                                         {
  char Bf[255];
  sprintf(Bf, "%u", UInt);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

| TCon& TCon::operator<< | ( | const short & | Sh | ) |  [inline] | 
        
Definition at line 42 of file console.h.
References operator<<().
Referenced by operator<<().
{ operator<<((int) Sh); return *this; }


Definition at line 43 of file console.h.
References operator<<().
Referenced by operator<<().
{ operator<<((uint) USh); return *this; }


| TCon & TCon::operator<< | ( | const float & | Flt | ) | 
Definition at line 43 of file console.cpp.
References PutBf().
                                         {
  char Bf[255];
  sprintf(Bf, "%g", Flt);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

| TCon & TCon::operator<< | ( | const double & | Double | ) | 
Definition at line 51 of file console.cpp.
References PutBf().
                                             {
  char Bf[255];
  sprintf(Bf, "%g", Double);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

| TCon & TCon::operator<< | ( | const long double & | LDouble | ) | 
Definition at line 58 of file console.cpp.
References PutBf().
                                                   {
  char Bf[255];
  sprintf(Bf, "%Lg", LDouble);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

| TCon& TCon::operator<< | ( | const char * | CStr | ) |  [inline] | 
        
Definition at line 48 of file console.h.
References TStr::CStr(), TStr::Len(), and PutBf().

Definition at line 49 of file console.h.
References TChA::CStr(), TChA::Len(), and PutBf().

| void TCon::PutBf | ( | const void * | LBf, | 
| const int & | LBfL | ||
| ) | 
Definition at line 17 of file console.cpp.
References IAssert.
Referenced by operator()(), operator<<(), and PutCh().
                                                 {
#if defined (GLib_Console)
  #if defined (GLib_CreateConsole)
    DWORD ChsWritten;
    WriteConsole(HStdOut, LBf, LBfL, &ChsWritten, 0);
    IAssert(ChsWritten == static_cast<DWORD>(LBfL));
  #else
    fwrite(LBf, sizeof(char), LBfL, stdout);
  #endif
#endif
}

| int TCon::PutCh | ( | const int & | Ch | ) |  [inline] |